How hloc26/homequest works
Main Components
• Backend API Service: Built with Express.js, organized into controllers, models, services, middleware, and routes. It handles business logic, authentication (JWT), and database interactions (using Sequelize with MySQL).
• Frontend UI: Developed with React (and Vite) that features components, pages, and state management. It communicates with the API to display tasks, manage user sessions, and handle the gamified task interactions.
• Database: A MySQL instance which is coordinated via Docker Compose with the backend. The API’s configuration files and Sequelize models (e.g., Task, User, Achievement) indicate the database’s central role.
• Containerization & Orchestration: Docker is used for containerizing both the API and UI, and docker-compose.yml ties everything together (including the MySQL database service).
Relationships and Interactions
• Users interact with the UI, which makes HTTP calls (via Axios in the UI’s API folder) to the backend endpoints defined in the API’s routes.
• The API controllers process these requests by leveraging business logic from the services and by reading/updating data via Sequelize models.
• Authentication flows (login, registration) follow JWT-based protocols.
• The database is the persistent store for tasks, users, achievements, and other game-task data.
• Docker Compose ties these components together by exposing front-end ports (e.g., 5173) and back-end ports (e.g., 3000), making sure containerized services can communicate.
Architectural Patterns and Design Principles
• Separation of Concerns: Clear segregation between UI and API.
• MVC-like structure on the backend (with controllers, models, and services).
• Use of middleware for common tasks (e.g., authentication).
• Containerization promotes environment consistency across development and deployment.
• RESTful API design: The API endpoints are structured to manage tasks, users, etc.
Relevant Technologies and Their Roles
• Frontend: React, Vite, Bootstrap contribute to a responsive and interactive UI.
• Backend: Express.js facilitates HTTP request handling; Sequelize abstracts database operations; JWT secures authentication.
• Database: MySQL serves as the relational database.
• Docker and Docker Compose: Containerize and orchestrate the services making the development and deployment pipelines consistent.
Important Details to Capture
• Separate areas for the backend’s structure (showing controllers, models, services, and middleware).
• The API layer’s reliance on the configuration files (like db.js, multer.js, etc.) that set up database connections and request handling.
• The front-end structure, showing components (like DescriptionBoard, TaskList, ProfileButton) and pages (Dashboard, Login, Profile).
• Container boundaries with ports as defined in the docker-compose file.
• Special utilities (e.g., JWT utilities in API/src/utils) to reinforce security flows.