Skip to content

Technisch Plan & Gemaakte Keuzes

Volledig technisch ontwerp van het WildFire Management System met alle gemaakte architectuurbeslissingen en keuzes.

Projectarchitectuur

Projectarchitectuur Diagram

Tech Stack - Finale Keuzes

Frontend Stack

ComponentTechnologieReden
FrameworkVue 3Reactief, performant, kleine bundle size
Meta FrameworkNuxtSSR, file-based routing, module ecosystem
LanguageTypeScriptType safety, IDE support, productiëel
Package ManagerpnpmMonorepo support, sneller, kleiner
State ManagementPiniaModern store, Nuxt integration
Build ToolViteLightning-fast HMR, optimized builds
TestingVitestVue 3 compatible, fast unit tests

Backend Stack

ComponentTechnologieReden
RuntimeNode.jsJavaScript op server, non-blocking I/O
LanguageTypeScriptType safety, better debugging
DatabasePostgreSQLACID compliant, PostGIS extension
Geo-spatialPostGISWildfire perimeter mapping
TestingZodComprehensive test coverage
API DocsSwaggerAPI documentation

Infrastructure & Deployment

ComponentTechnologieReden
ContainerizationDockerConsistent environments
OrchestrationDocker ComposeDevelopment & simple production
Web ServerNginxReverse proxy, SSL termination
SSL/TLSLet's EncryptFree, automatic renewal
CI/CDGitLab CI/CDGitLab integration, built-in

Architectuurale Keuzes

1. Monorepo Structuur

Beslissing: Monorepo met pnpm workspaces

Redenen:

  • Gedeelde componenten tussen Admin Portal en User Dashboard
  • Eén versie van dependencies
  • Atomaire commits voor gerelateerde features
  • Gedeelde configuratie en types

Structuur:

monorepo/
├── projects/
│   ├── adminportal/      # Admin interface
│   └── userdashboard/    # Public viewer
└── shared/               # Shared code
   ├── components/       # Vue components
   ├── composables/      # Vue 3 composables
   ├── types/           # Shared TypeScript types
   ├── utils/           # Utilities
   └── api/             # API integration

2. API Design: REST met JSON

Beslissing: RESTful API met JSON payloads

Redenen:

  • Eenvoudig, goed begrepen patroon
  • Browser native support
  • Gemakkelijk debuggen (dev tools, Postman)
  • Stateless, scalable

API Endpoints Structure:

/api/v1/
├── /fires          # Fire management
└── /users          # User management

3. Authentication & Authorization

Beslissing: JWT tokens + Role-Based Access Control (RBAC)

Implementatie:

  • Login endpoint genereert JWT token
  • Token bevat user ID, role, permissions
  • Frontend slaat token op in secure cookie (httpOnly)
  • Elke request stuurt token in Authorization: Bearer <token>
  • Backend valideert token en controleert permissions

Roles:

  • admin - Volledige toegang
  • member - Read/Write fires

4. Database Schema

Beslissing: Relationele database (PostgreSQL) met PostGIS

Redenen:

  • ACID guarantees voor data integriteit
  • PostGIS extension voor geo-spatial queries
  • Relationele integriteit met foreign keys
  • Powerful voor complexe queries

Kernentiteiten:

sql
users (id, email, password_hash, role)
fires (id, name, location, status)

5. Frontend Rendering Strategy

Beslissing: Hybrid SSR + Client-Side Rendering

Implementatie:

  • Initial Load (SSR): Server genereert HTML voor SEO + performance
  • Navigation (CSR): Client-side routing voor snelle transitions
  • Data Fetching: Async data loading met loading states

Voordelen:

  • Beter SEO
  • Snellere initial paint
  • Smooth navigatie

6. State Management

Beslissing: Pinia (Vue 3 Store)

Redenen:

  • Official Vue state management
  • Reactive, composable
  • Great DevTools integration
  • Automatic TypeScript support

Stores:

  • authStore - User authentication & session
  • fireStore - Active fires & data
  • userStore - User management

7. Security Measures

Implementatie:

LaagMaatregelImplementatie
AuthenticationJWT TokensSecure, httpOnly cookies
AuthorizationRBACRole-based permissions
TransportHTTPS/TLSLet's Encrypt certificates
Input ValidationServer-side validationExpress middleware
SQL InjectionParameterized queriesTypeORM queries
XSS ProtectionContent Security PolicyCSP headers
CSRFCSRF tokensFor state-changing operations
Rate LimitingAPI rate limitingPrevent brute force
LoggingAudit trailsAll actions logged

8. Performance Optimisations

Frontend:

  • Code splitting per route
  • CSS/JS minification
  • Browser caching

Backend:

  • Database indexing op frequently queried fields
  • Caching van geo-spatial queries

Infrastructure:

  • Monitoring dashboard

Deployment Architecture

Development Environment

  • Local Docker Compose setup
  • Hot reloading voor frontend
  • Backend auto-restart

Staging Environment

  • Replica van production
  • Testing van deployments
  • Performance testing

Production Environment

  • Load-balanced frontend
  • Redundant backend instances
  • Database replication

Design Decisions - Why They Matter

  1. Monorepo: Snellere development cycles, shared code
  2. TypeScript: Fewer bugs in production, better maintainability
  3. PostGIS: Accurate wildfire mapping capabilities
  4. Containerization: Works everywhere, easy scaling
  5. JWT Auth: Stateless, scalable authentication
  6. Pinia: Vue 3 native, less boilerplate

Scalability Considerations

  • Horizontal Scaling: Backend servers behind load balancer
  • Database: Read replicas, connection pooling
  • Caching: Redis for frequent queries
  • CDN: Static assets globally distributed

Laatst bijgewerkt: 17 januari 2026
Status: Technisch plan goedgekeurd

Fire Management System Documentation