How qqv/cpt_edu works
Project Type & Purpose
• This is a full-stack application with a clear separation between the frontend (React using Material UI, Chart.js, and React Query) and the backend (Node.js and Express with MongoDB, along with GitHub API integration).
• The primary goal is to provide dashboards, analytics, and reporting on team progress and individual contributions, based on data fetched from GitHub and stored in MongoDB.
Main Components
a. Frontend Client:
• React application in the client directory.
• Key sub-components to include:
• Pages (for Dashboard, Analytics, Assistant, Login, etc.)
• Reusable UI components (like Sidebar and TeamCard).
• Contexts (like AuthContext.tsx) and services (for API interactions).
• Utility functions (for formatting dates, handling GitHub details, etc.)
b. Backend Server:
• Node.js application in the server directory.
• Modules such as:
• Controllers (even though not explicitly labeled, they are represented by the route handlers in the routes folder).
• API Routes (routes for auth, analytics, GitHub integration, team management, and user management).
• Models (Mongoose models for course, student, team, etc.).
• Middleware (for authentication, validation, error handling).
• Services (e.g., business logic in user.service.ts and GitHub-related services).
• Configuration (configs and environment specific settings like MongoDB URI, GitHub token).
c. External Services & Data Stores:
• MongoDB as your data storage layer.
• GitHub API integration for fetching and processing repository activity, commit data, etc.
• Environment configuration files that set the base URLs for API communication.
Relationships & Interactions
• The client sends requests to the backend APIs.
• In the backend, API routes interface with middleware and subsequently interact with services and database models.
• Calls from backend services to the GitHub API, showing external data integration.
• That authentication is enforced through middleware on the server, with context provided on the client to manage user state.
Architectural Patterns & Technologies
• Model-View-Controller (MVC) like pattern in the backend where models and routes (controllers) manage data and routing respectively.
• Separation of concerns:
• The client is responsible for UI rendering, state management, and API communication.
• The server handles API routing, business logic, middleware for authentication and error handling, and database interactions.
• Recognize external dependencies like GitHub APIs as essential integration points.