How betagouv/signalement-api works
Main Components
a. Client Layer:
• Consumer Web Interface
• Professional Dashboard
• DGCCRF (Administrative) Dashboard
• Mobile App Interface
b. API Layer (Core Application):
• Authentication Service (with Cookie-based auth)
• Controllers Layer (RESTful endpoints)
• Orchestrators Layer (Business logic)
• Repository Layer (Data access)
• Task Scheduler (Background jobs)
c. External Services:
• Email Service
• S3 Storage
• Antivirus Service
• Company Data API (ETABLISSEMENT_API)
• GS1 Barcode Service
• New Relic (Logging)
d. Data Storage:
• PostgreSQL Database
• File Storage (S3)
Key Relationships to Highlight
a. Authentication Flow:
• Cookie-based authentication flow
• Different auth paths (API Key, Cookie)
• Demonstrate user role separation (Consumer, Professional, Admin)
b. Data Flow:
• Report submission path
• File upload and virus scanning process
• Email notification system
• Company data synchronization
• Background task execution
Specific Implementation Details
• Blue rectangles for core services
• Green diamonds for external APIs
• Red hexagons for security components
• Purple rectangles for scheduled tasks
Important Architectural Patterns to Highlight
• MVC pattern in the core application
• Repository pattern for data access
• Actor system for async operations
• Task scheduling system
• Event-driven architecture for notifications
The background task architecture
This system design should reflect the application's focus on security, scalability, and maintainability, as evidenced by the extensive configuration options and modular architecture shown in the codebase.