How flagship-io/decision-api works
Main Components
a. Core API Server Components:
• HTTP Server Layer (pkg/server)
• Request Handlers Layer (pkg/handlers)
• API Logic Layer (internal/apilogic)
• Validation Layer (internal/validation)
b. Connector Systems:
• Assignment Managers (Multiple implementations):
• DynamoDB
• Redis
• Local Storage
• In-Memory Storage
• Environment Loaders:
• CDN Loader
• Hits Processors:
• Data Collection Service
c. Supporting Components:
• Configuration Management (pkg/utils/config)
• Logging System (pkg/utils/logger)
• Middleware Stack (pkg/handlers/middlewares)
[External Clients] → [Load Balancer/Ingress]
• ↓
[Middleware Layer (CORS, Metrics, Logging, Recovery)]
• ↓
[HTTP Server Layer (Main Request Handler)]
• ↓
[API Logic Layer] ←→ [Validation Layer]
• ↓
[Connector Interface Layer]
• ↓
[Storage Layer (Multiple Implementations)]
Key Relationships to Highlight
• How requests flow through the middleware stack
• Pluggable nature of the storage backends
• Demonstrate the relationship between the API logic and validation layers
• How the configuration system influences all components
Important Architectural Patterns to Emphasize
• Plugin Architecture: The connectors system allows for different implementations
• Middleware Pattern: Request processing pipeline
• Clean Architecture: Separation of concerns between layers
• Interface-based Design: Especially in the connectors package
Technical Details
• Port 8080 for the HTTP server
• Environment configuration requirements (ENV_ID, API_KEY)
• External service dependencies (Redis, DynamoDB, CDN)
• Metrics and monitoring integration points