Skip to content

Specificaties

Het VEMAP Backend is een serverless applicatie die draait op AWS en maakt gebruik van verschillende AWS services voor authenticatie, data opslag, messaging en monitoring. De applicatie is gebouwd met het Chalice framework en volgt een hybride architectuur met in de kern een modulair monoliet met kenmerken van een N-tier (layered) architectuur, serverless services voor de API en database, en een microservices architectuur voor de email service. In dit document vind je een overzicht van de AWS services die worden gebruikt in het VEMAP Backend systeem.

  • Gebruik: Serverless compute voor de backend applicatie
  • Framework: Chalice (Python serverless framework)
  • Implementatie: Automatisch beheerd door Chalice deployment
  • Regio: eu-central-1 (standaard)
  • Gebruik: HTTP endpoints en request routing
  • Features: CORS configuratie, rate limiting, request/response transformation
  • Implementatie: Automatisch geconfigureerd door Chalice
  • Security: API key validation en user authentication
  • Gebruik: User authentication en management
  • Features:
    • User Pool voor gebruikersregistratie en login
    • JWT token generatie voor stateless authentication
    • Custom attributes (company, fullname, email, sub, phone)
    • User groups voor client environment bundling
  • Implementatie:
    • CognitoRepository voor user operations
    • AuthenticationService voor login/logout flows
    • Role-based access control (ROLE_ADMIN, ROLE_ORGANISATION, ROLE_MANAGER, ROLE_STAKEHOLDER)
  • Gebruik: Role-based permissions en access control
  • Features:
    • Lambda execution roles
    • S3 bucket access policies
    • Cognito user pool permissions
    • Cross-service access control
  • Gebruik: Relational database voor applicatie data
  • Features:
    • Multi-tenant data isolation per client environment
    • Connection pooling via psycopg2
    • JSONB support voor flexibele data structuren
  • Implementatie:
    • BaseRepository pattern voor database operaties
    • Connection management via SingletonRegistry
    • Prepared statements voor SQL injection preventie
  • Gebruik: File storage en static website hosting
  • Buckets:
    • Client Files Bucket: File uploads (VKM plans, support files, logos)
    • Message Storage Bucket: HTML email content
    • Frontend Bucket: Static website hosting voor React frontend
  • Features:
    • Presigned URLs voor secure file upload/download
    • Folder structure: {client_env_id}/{project_id}/{closure_id}/files/
    • Content type validation en file metadata
  • Implementatie: S3Manager class voor alle S3 operaties
  • Gebruik: Message queuing voor asynchrone email processing
  • Queues:
    • Mail Queue: Email processing queue
    • Result Queue: Email delivery results
  • Features:
    • Batch processing (max 10 messages per batch)
    • FIFO queue support
    • Message deduplication
  • Implementatie:
    • SQSRepository voor queue operaties
    • SQSService voor email batch processing
    • Unified email flow (single en bulk emails)
  • Gebruik: Email sending service
  • Features:
    • SMTP interface voor email verzending
    • Delivery status tracking
    • Bounce en complaint handling
  • Implementatie: Via externe SES microservice
  • Gebruik: Application monitoring en logging
  • Features:
    • Lambda function logs
    • Custom application metrics
    • Performance monitoring via timer decorators
    • Error tracking en alerting
  • Implementatie:
    • Custom logging via Logger class
    • Performance metrics via @timer decorator
    • Business event logging
  • Gebruik: Secure credential storage
  • Features:
    • Database connection strings
    • API keys en tokens
    • Environment-specific configuration
  • Implementatie: Via SingletonRegistry voor lazy loading
  • Frontend: React applicatie gehost op S3
  • Features:
    • Static website hosting
    • CloudFront CDN voor globale distributie
    • HTTPS via SSL certificates
  • Implementatie:
    • S3 bucket configured voor website hosting
    • Index document routing voor SPA
    • Error document handling
  • Lambda Functions: Event-driven compute
  • API Gateway: Request routing en transformation
  • SQS: Asynchrone message processing
  • S3: Stateless file storage
  • Service-oriented: Elke service heeft eigen verantwoordelijkheid
  • Loose coupling: Services communiceren via APIs en queues
  • Independent scaling: Elke service kan onafhankelijk schalen
  • Client Environment Isolation: Data gescheiden per client
  • Role-based Access: Gebruikers hebben verschillende permissions
  • Resource Sharing: Efficiënt gebruik van AWS resources
  • Local Development: chalice local voor lokale ontwikkeling
  • Dev Stage: chalice deploy --stage dev voor development
  • Production Stage: chalice deploy --stage prod voor productie
  • Automatic Infrastructure: Chalice beheert Lambda en API Gateway
  • RDS Database: Handmatig geconfigureerd
  • S3 Buckets: Handmatig aangemaakt en geconfigureerd
  • Cognito User Pool: Handmatig geconfigureerd
  • SQS Queues: Handmatig aangemaakt
  • Secrets Manager: Handmatig geconfigureerd
  • Encryption in Transit: HTTPS voor alle communicatie
  • Encryption at Rest: S3 en RDS encryptie
  • Access Control: IAM roles en policies
  • Authentication: Cognito JWT tokens
  • VPC: Lambda functions in VPC (indien nodig)
  • Security Groups: Network access control
  • Private Endpoints: Database en service endpoints
  • Pay-per-use: Alleen betalen voor gebruikte resources
  • Auto-scaling: Automatische schaling op basis van load
  • No Infrastructure Management: Geen server management
  • Connection Pooling: Database connection hergebruik
  • S3 Lifecycle: Automatische data archival
  • Lambda Optimization: Cold start minimalisatie
  • Performance Tracking: Timer decorators voor function timing
  • Business Events: Custom logging voor business logic
  • Error Tracking: Comprehensive error logging
  • CloudWatch Logs: Centralized logging
  • CloudWatch Metrics: Performance en health monitoring
  • Custom Dashboards: Business-specific monitoring
  • RDS Automated Backups: Point-in-time recovery
  • S3 Cross-Region Replication: Data redundancy
  • Secrets Manager: Secure credential backup
  • Multi-AZ Deployment: Database high availability
  • S3 Durability: 99.999999999% durability
  • Lambda Redundancy: Automatic failover
  • Multi-tenant Isolation: Client data separation
  • Audit Logging: Comprehensive activity tracking
  • Data Retention: Configurable retention policies
  • IAM Best Practices: Least privilege access
  • Encryption Standards: Industry-standard encryption
  • Access Logging: Comprehensive access tracking

De VEMAP Backend infrastructuur is ontworpen voor:

  • Scalability: Serverless architecture voor automatische schaling
  • Security: Multi-layer security met AWS best practices
  • Reliability: High availability en disaster recovery
  • Cost Efficiency: Pay-per-use model met optimale resource gebruik
  • Maintainability: Chalice framework voor eenvoudige deployment en management

De infrastructuur ondersteunt zowel de backend API als de frontend hosting, met een focus op security, performance en cost optimization.