How dgeniust/hcmute-care works
Main Components
• Frontend: Built with React 18; includes various components for administration, booking, and personal user pages. It handles user interactions and communicates with the backend via Axios for RESTful API calls.
• Backend: Built with Spring Boot. Its structure follows typical layered architecture with controllers (handling REST endpoints such as AuthenticationController and HomeController), services (business logic implemented in classes like AuthenticationServiceImpl, JwtServiceImpl, OtpServiceImpl), repositories (data access layer), configuration classes (AppConfig, OpenApiConfig, RedisConfig, etc.), and central exception handling.
• Database: A relational database (MySQL is mentioned as default, although Postgres is also an option).
• Docker & Containerization: Each layer (backend and frontend) is containerized with its own Dockerfile and docker-compose configuration, providing isolated build and deployment environments.
Relationships and Data Flow
• From the Backend, illustrate connections to the Database for CRUD operations managed via Spring Data JPA.
• Interactions with external services if applicable (for example, Redis for caching/security in the backend).
• Docker ecosystem for each major component – indicate that both frontend and backend are encapsulated in Docker containers orchestrated via respective docker-compose files.
• Optionally, mark the build tools / environments: Maven for the backend and Node.js/npm for the frontend.
Architectural Patterns and Components
• For the Backend: Emphasize the layered (MVC-like) design:
a. Controller Layer (REST endpoints)
b. Service Layer (business logic, token handling, OTP operations)
c. Data Access Layer (repositories interfacing with the database)
d. Configuration and Exception Handling components.
• For the Frontend: Note the component-based design using React components that handle different pages (Admin, Booking, Personal, etc.) and specific utilities like routing (React Router) and HTTP communication (Axios).
• Docker containerization as a pattern to ensure that both parts can be built, tested, and deployed independently.
Technologies and Tools
• Docker and Docker Compose as critical for containerization and deployment.
Putting It All Together
• Next to the Backend, add the Database component and, if in use, the Redis cache component.
• On the Frontend side, illustrate a breakdown of major pages or components such as Admin, Booking, and Personal modules.
• Frontend (React components, API calls, routing)
• Backend (Spring Boot layers, business logic, database access)
• Database/Cache (MySQL/Postgres, Redis)
• Containerization (Docker components orchestrated via docker-compose)
This approach ensures a comprehensive, visually clear representation of the project’s components and their interactions.