How askwhynot1309/formula-one-insight-dashboard works
Project type and purpose
• This is a full-stack web application (“FormulaOneInsight”) that provides RESTful endpoints for Formula 1 data (circuits, drivers, teams, races, results) and a React-based SPA frontend.
• Backend stack: ASP.NET Core (.NET 8), Entity Framework Core with SQL Server, layered architecture (DAO, Repository, Services).
• Frontend stack: React, TypeScript, Vite.
File structure to extract main components
• Frontend:
• “Formula One FE/” → React SPA (components, pages, API client, context, hooks).
• Backend API:
• “F1API/” → ASP.NET Core Web API project (Controllers, Program.cs, appsettings, Dockerfile).
• Data Access:
• “DAO/” → EF Core DbContext, Migrations.
• Shared Types:
• “Models/” → domain entities & DTOs.
• Business Logic:
• “Services/” → service layer interfaces + implementations.
• Data Abstraction:
• “Repository/” → repository interfaces + implementations + CSV helper.
• Solution files (.sln) & docker-compose.yml for orchestration.
README for additional insights
• Backend runs on HTTPS port 5001, FE runs on port 5173.
• Database migrations via EF in DAO.
• Patterns used: Repository, Service layers, DTO mapping.
• Development prerequisites and run steps.
Main components & interactions (to represent
a. Frontend SPA (“React / Vite”)
• Calls REST APIs on F1API.
• AuthContext for JWT login flows.
b. API Layer (“ASP.NET Core Controllers”)
• Exposes endpoints under /api/[resource].
• Delegates to Services.
c. Service Layer (“Services/…Service.cs”)
• Business logic, data validation, transaction management.
• Interfaces in Services/Interface and implementations.
d. Repository Layer (“Repository/…Repository.cs”)
• CRUD operations, CSV import helper.
• Interfaces and concrete classes.
e. Data Access Layer (“DAO/F1DbContext”)
• Entity Framework Core DbContext, migrations.
• Communicates with SQL Server database.
f. Shared Models (“Models/”)
• Domain entities and DTOs used across layers.
g. Database (“SQL Server”)
• Stores persistable data (Circuits, Drivers, Teams, Races, Results, Users).
h. Docker Compose (optional)
• Orchestrates containers: F1API, perhaps SQL Server, FE.
Architectural patterns & design principles
• Layered (Onion) Architecture: API → Services → Repositories → DAO → DB.
• Separation of Concerns: Controllers only route, Services only business logic, Repositories only data I/O.
• Shared DTOs to decouple domain models from API surface.
• EF Core Migrations for schema versioning.
• React Context (AuthContext) for global state.