# vuhien9x/bookingdoctor2024 architecture

> Architecture diagram of the GitHub repository vuhien9x/bookingdoctor2024, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vuhien9x/bookingdoctor2024
- Repository: https://github.com/vuhien9x/bookingdoctor2024

## Overview

This project is a full-stack appointment clinic system that comprises three major components: a back-end API (built in Java using Spring Boot), a web front end (built in JavaScript/React with a modern npm-based setup), and a mobile application (developed with Flutter). The overall purpose is to manage and schedule doctor appointments along with associated functionalities like user authentication, payment processing, feedback, and administrative features.

##### Interactions between the components
- Optionally, include external dependencies (e.g., payment gateways or email services) as separate nodes connected to the backend.

##### Architectural patterns and design principles
- The backend follows an MVC (or layered) design pattern, where Controllers (handling HTTP requests) delegate to Services (business logic) which interact with Repositories (data access) and Domain Entities/DTOs.
- The Front End and Mobile apps follow client-side patterns with components for UI and route management.
- Use clear labels to indicate middleware layers for authentication, authorization, and security.
- Separation of concerns: presentation layer (web/mobile) and business/data layer (backend).

##### Incorporate the relevant technologies
- For the backend, label components like Java, Spring Boot, Maven (pom.xml), and Docker (Dockerfile indicates containerization possibilities).
- For the web front end, note that it uses technologies like React (JSX files), npm for dependency management and build (npm run dev), along with tool configurations (ESLint, Vite, etc.).
- For the mobile app, note Flutter/Dart, with supporting files/configurations for Android, iOS, and other platforms.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Clients"
        W["Web Client (React)"]:::client
        subgraph "Mobile Application"
            M["Mobile Client (Flutter)"]:::mobile
            MU["Device Utility (ip_app.dart)"]:::mobile
            M -->|"uses"| MU
        end
    end

    B["Backend API (Spring Boot)"]:::backend

    subgraph "Backend API Components"
        direction TB
        C["Controllers"]:::backendLayer
        S["Services"]:::backendLayer
        R["Repositories"]:::backendLayer
        D["DTOs/Entities"]:::backendLayer
        CM["Configs/Middlewares"]:::backendLayer
    end

    DB["Database: medicare_plus"]:::db

    PG["Payment Gateway"]:::external
    ES["Email Service"]:::external

    %% Client to Backend connections
    W -->|"REST-calls"| B
    M -->|"REST-calls"| B

    %% Internal Backend Architecture
    C -->|"delegatesTo"| S
    S -->|"invokes"| R
    S -->|"uses"| D
    CM -->|"applies"| C
    CM -->|"applies"| S

    %% Backend to Database
    R -->|"dataAccess"| DB

    %% External integrations from Backend
    CM -->|"integratesPayment"| PG
    CM -->|"integratesEmail"| ES

    %% Click Events
    click W "https://github.com/vuhien9x/bookingdoctor2024/tree/main/bookingdoctor_web"
    click B "https://github.com/vuhien9x/bookingdoctor2024/tree/main/backend-api/src/main/java/vn/aptech/backendapi"
    click M "https://github.com/vuhien9x/bookingdoctor2024/blob/main/mobile/lib/main.dart"
    click MU "https://github.com/vuhien9x/bookingdoctor2024/blob/main/mobile/lib/utils/ip_app.dart"

    %% Styles
    classDef client fill:#a3d5d3,stroke:#333,stroke-width:2px;
    classDef mobile fill:#ffd59e,stroke:#333,stroke-width:2px;
    classDef backend fill:#c3dafa,stroke:#333,stroke-width:2px;
    classDef backendLayer fill:#e0e4ff,stroke:#333,stroke-width:2px;
    classDef db fill:#f9e79f,stroke:#333,stroke-width:2px,font-weight:bold;
    classDef external fill:#f5c6cb,stroke:#333,stroke-width:2px;
```
