How alihaidar2/fantasyplstats works
• Frontend Client:
• Next.js Pages and Layouts (e.g., app/page.tsx, app/differential/page.tsx, app/fixtures/page.tsx, app/layout.tsx)
• UI Components (all components/ subdirectories: header, footer, differential_table, gameweek_table, manager_panel, manager_team_table, etc.)
• Global Styles & Assets (styles/ and public/ directories)
• Backend / API:
• API Routes under app/api/ (such as fixtures, manager endpoints for dynamic route parameters like [managerId], and search functionalities)
• Server-side logic managed by Next.js for handling requests and rendering responses
• Libraries & Utilities:
• Helper functions and clients (lib/cosmosClient.ts, lib/tableUtils.ts)
• Type definitions (types/ directory)
• Scripts & Deployment Infrastructure:
• Database population and update scripts (scripts/populateDatabase.js, scripts/updateManagers.js)
• CI/CD configuration (GitHub workflows in .github/workflows/)
• Docker configuration (DockerFile) suggesting containerization
• External Services:
• Although not explicitly detailed, the existence of a Cosmos client indicates an external database service.
• Deployment platforms such as Vercel (as referenced in the README) or Azure (from the workflow file) may act as the hosting environment.
Relationships and Interactions
• Flow from API routes to the libraries that interact with external resources like Cosmos DB.
• How scripts (manual or scheduled jobs) interact – for example, populating or updating the data in the database.
Architectural Patterns and Design Principles
• Separation of concerns: UI components are clearly separated from business logic in the API routes.
• That the project leverages Next.js conventions (file-system based routing for pages and API endpoints) which help drive the architectural choices.
• That the project includes component reusability (UI components are modular) and utility abstraction (library functions and type definitions).
• Point out containerization (DockerFile) which indicates deployment as a container alongside CI/CD with GitHub Actions.