How 24heuresinsa/overrun-backend works
Main System Components
a) API Layer
• REST API endpoints (organized by domain as seen in /src/routes)
• Authentication & Authorization middleware
• Request/Response handling
b) Business Logic Layer
• Controllers (from /src/controllers)
• Middleware components (from /src/middlewares)
• Utility services (from /src/utils)
c) Data Layer
• Prisma ORM
• Database (likely PostgreSQL based on Prisma usage)
d) External Services Integration
• HelloAsso payment integration
• Email service (based on email templates)
Component Relationships
a) External Clients Layer (Top)
• Incoming HTTP requests
• Authentication flow
b) API Gateway Layer (Upper Middle)
• Routes by domain (athletes, races, teams, etc.)
• Middleware chain:
• Authentication
• Access Control
• Pagination
• Search
• Filter
• OrderBy
c) Business Logic Layer (Middle)
• Controllers for each domain
• Utility services
• Email handling system
d) Data Access Layer (Bottom)
• Prisma ORM
• Database with main entities
• Migrations handling
Specific Elements
a) Authentication Flow
• Login routes
• Admin invitations
• Token handling
b) Core Business Flows
• Race management
• Athlete registration
• Team handling
• Certificate processing
c) Integration Points
• HelloAsso payment processing
• Email notification system
• VA (Virtual Assistant?) integration
Key Architectural Patterns to Highlight
• RESTful API structure
• Middleware pipeline pattern
• Repository pattern (via Prisma)
• Service-based architecture for utilities
• Event-driven architecture for notifications
Technical Stack Indicators
Technologies:
• Node.js/Express.js
• Prisma ORM
• PostgreSQL
• Docker containerization
• TypeScript
Remember to highlight the scalability aspects enabled by the Docker configuration and the security measures implemented through the middleware layer.