# phuongthao0515/quarantine-camp architecture

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

- Interactive diagram: https://gitdiagram.com/phuongthao0515/quarantine-camp
- Repository: https://github.com/phuongthao0515/quarantine-camp

## Overview

##### Project Type and Purpose
- The README indicates that the system is designed to enhance efficiency and reliability in handling COVID-19 related management tasks.
- The system is a full-stack application using React (Frontend) and FastAPI in Python (Backend) with a MySQL database.

##### Analyzing the File Structure
- Top-level directories include:
- “frontend” – Contains a React-based application with core files in the “src” directory (components, pages like LoginContainer.js, home.js, report.js, etc.), configuration files (package.json, package-lock.json) and public assets.
- “backend” – Contains Python scripts and modules including main application files (main.py, model.py, database.py) and API routes organized under the “routers” folder (employee.py, patient.py). There is also an “addUser.py” at the project root that might be used for initial setups.
- “Database” – Contains SQL related scripts (e.g., TableTrigger_script.txt, role_privileges.txt) which likely set up database schema or configure database privileges.
- Notable architectural patterns include separation of concerns with distinct directories for frontend and backend that interact as client-server components, while the backend itself may follow an MVC or REST API pattern facilitated by FastAPI.

##### Instructing the Principal Software Engineer
- Core components like the “Routers” (with endpoints for employees and patients), “Model”, and “Database Handler”.
- That the backend is built with FastAPI.
- Connect:
- Schematic markers for local development tools or scripts like addUser.py.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"]:::user

    subgraph "Frontend (React Application)"
        FE["React Application"]:::frontend
        FE_Login["Login Page (LoginContainer.js)"]:::frontend
        FE_Home["Home Page (home.js)"]:::frontend
        FE_Report["Report Page (Report.js)"]:::frontend
    end

    subgraph "Backend (FastAPI Application)"
        BE["Main Server (main.py)"]:::backend
        BE_Model["Business Logic (model.py)"]:::backend
        BE_DB["Database Handler (database.py)"]:::backend
        subgraph "Routers"
            BE_Employee["Employee API (employee.py)"]:::backend
            BE_Patient["Patient API (patient.py)"]:::backend
        end
        BE_Utility["Setup Script (addUser.py)"]:::utility
    end

    DB["MySQL Database"]:::database

    %% Data flow connections
    User -->|"interacts"| FE
    FE -->|"APICalls"| BE
    BE -->|"CRUD"| DB

    %% Click Events for Frontend
    click FE "https://github.com/phuongthao0515/quarantine-camp/tree/main/frontend/"
    click FE_Login "https://github.com/phuongthao0515/quarantine-camp/blob/main/frontend/src/LoginContainer.js"
    click FE_Home "https://github.com/phuongthao0515/quarantine-camp/blob/main/frontend/src/home.js"
    click FE_Report "https://github.com/phuongthao0515/quarantine-camp/blob/main/frontend/src/Report.js"

    %% Click Events for Backend
    click BE "https://github.com/phuongthao0515/quarantine-camp/blob/main/backend/main.py"
    click BE_Model "https://github.com/phuongthao0515/quarantine-camp/blob/main/backend/model.py"
    click BE_DB "https://github.com/phuongthao0515/quarantine-camp/blob/main/backend/database.py"
    click BE_Employee "https://github.com/phuongthao0515/quarantine-camp/blob/main/backend/routers/employee.py"
    click BE_Patient "https://github.com/phuongthao0515/quarantine-camp/blob/main/backend/routers/patient.py"
    click BE_Utility "https://github.com/phuongthao0515/quarantine-camp/blob/main/addUser.py"

    %% Click Event for Database
    click DB "https://github.com/phuongthao0515/quarantine-camp/tree/main/Database/"

    %% Styles
    classDef user fill:#ffeb3b,stroke:#333,stroke-width:2px;
    classDef frontend fill:#81d4fa,stroke:#333,stroke-width:2px;
    classDef backend fill:#ffb74d,stroke:#333,stroke-width:2px;
    classDef utility fill:#e57373,stroke:#333,stroke-width:2px;
    classDef database fill:#a5d6a7,stroke:#333,stroke-width:2px;
```
