How fabienwnklr/race-trackr works
Main Components
• Backend API: Housed in the "app" directory (with subdirectories like controllers, models, policies, middleware, validators, and exceptions). This is where the server-side business logic resides, following the MVC pattern. Note that API endpoints are versioned (see "app/controllers/api/v1") to separate concerns.
• Database: The database is defined by the migration and seeder files in the "database" folder. Include tables for users, tracks, track days, maintenances, vehicles, etc.
• External Services: Redis is integrated (using ioredis as noted in the README) for caching or session management. Represent this as an external service node.
• Utility & Configuration Layers: Configuration files (like "adonisrc.ts", various "config/..." files, and Vite configurations) define global settings and build processes. Also include testing directories (“tests”) that cover browser, functional, and unit tests.
Relationships and Data Flow
• How the backend controllers invoke business logic, interact with models (data layer), and apply middleware, validations, and policies.
• Backend’s interactions with the database for both read and write operations (CRUD) and with Redis for caching.
• Optionally, indicate how migrations and seeders help bootstrap the database schema, ensuring that the data model is in sync with the application logic.
Architectural Patterns and Design Principles
• RESTful API Design: Document the versioning evident from the "api/v1" folder and highlight API routing (see "start/api/v1/api.routes.ts" and "start/routes.ts").
• Middleware and Policies: Note the presence of multiple middleware (authentication, locale detection, etc.) and policies (authorization rules) that encapsulate cross-cutting concerns.
• Extensibility: The segregated directories (e.g., @types for TypeScript types, separate testing suites, validators, and configuration files) guarantee modularity and ease of extensibility.
Relevant Technologies
• Backend: AdonisJS, Node.js, TypeScript.
• Frontend: Inertia.js, React, Vite.
• Database: SQL (schema defined in migrations and represented via "database.dbml" and "schema.sql").
• External Services: Redis via ioredis.
• Build, Linting, and Testing Utilities: ESLint, Husky, commitlint, and various test scripts.