How kuadtrai/child-growth-tracking-system_be works
Project Type and Purpose
• This is a backend REST API for a Child Growth Tracking system.
• Its primary function is to manage and track child-related data, user authentication, feedback, metrics, and related information.
• Being the “_BE” (backend) part, it is designed to work as the API server supporting a likely frontend (web or mobile) by handling data processing, database interactions, and application logic.
File Structure and Key Components
• Top-Level Build & Configuration:
• Files like pom.xml, mvnw, and .mvn/ indicate that Maven is used for project management and build automation.
• Project Source Organization (src/main/java/G5_SWP391/ChildGrownTracking):
• configurations: Contains Spring configuration classes such as Database setup, GlobalExceptionHandler, and SwaggerConfig for API documentation.
• controllers: Houses REST controllers (e.g., AuthenticateController, ChildController, FeedbackController, MetricController, PostController, UserController) that expose endpoints to client applications.
• dtos: Contains Data Transfer Objects for incoming request data and outgoing responses, ensuring that data sent over the network adheres to a specific format.
• models: Represents the domain entities (Child, Doctor, Feedback, Metric, Post, and User models) corresponding to the business domain.
• repositories: Interfaces for persistence using Spring Data (e.g., ChildRepository, UserRepository) that enable CRUD operations on underlying data storage.
• responses: Contains custom response classes which might provide a consistent API response structure.
• services: Implements the business logic for each domain area (child tracking, authentication, doctor management, feedback, metrics, posts, and user operations).
a. Main Components to Include:
• External Clients (Frontend/Mobile Apps) that interact with the REST API.
• API Layer: REST Controllers that serve as the interface between clients and business logic.
• Service Layer: Business logic implementing application workflows.
• Data Access Layer: Repositories managing database operations.
• Domain Layer: Models, DTOs, and Response objects that define and transfer data.
• Configuration & Cross-Cutting Concerns: Global configuration components such as database configuration, exception handling, and API documentation via Swagger.
• External Dependencies: The Database (configured in Database.java) and any potential external services.
b. Relationships and Interactions:
• The Repositories interact with the Database (showing persistence).
• Cross-cutting components like GlobalExceptionHandler intercept failures in any layer.
• SwaggerConfig indicates that a separate pathway exists for API documentation access.
c. Architectural Patterns and Technologies:
• Layered Architecture: Separation into Controllers, Services, Repositories, and Domain Models.
• API Documentation: Integration with Swagger for documenting REST endpoints.
• Exception Management: A Global Exception Handler to manage errors centrally.
• Technology Stack: Spring Boot framework, Maven for build management, and likely a relational database (e.g., MySQL, PostgreSQL) based on the configuration class.
Comprehensive Coverage
• Every essential architectural element highlighted by the project’s file tree—especially each layer and component.