# mwantech/health-tracking-system- architecture

> Architecture diagram of the GitHub repository mwantech/health-tracking-system-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mwantech/health-tracking-system-
- Repository: https://github.com/mwantech/health-tracking-system-

## Overview

##### Main Components

A. Frontend Layer (React.js)
- Test Kit Ordering System
- Telemedicine Module
- AI Symptom Checker
- An Authentication Component (based on Login/Signup components)
- Admin Dashboard separately

B. Backend Layer (Node.js)
- API Gateway/Routes
- Authentication Service
- Business Logic Layer
- External Service Integrations

C. Database Layer (MySQL)
- User Management
- Test Kit Orders
- Telemedicine Sessions
- Admin Data

D. External Services
- OpenAI API (for Symptom Checker)
- Email Service (Nodemailer)
- Video Conferencing Service (for Telemedicine)

##### Component Relationships

- Backend → Database: Data persistence operations
- Backend → External Services: API integrations
- Authentication flow across all layers

##### Specific Implementation Details

A. Frontend Structure (based on file tree):
- Component hierarchy:
- Pages (Homepage, SymptomChecker, Telemedicine, etc.)
- Shared Components (Header, Footer)
- Admin Components
- Authentication Components

B. Backend Services (mentioned in README):
- Authentication Service (JWT)
- Email Service
- AI Integration Service
- Video Conference Service
- Database Service

##### Additional Elements

Include:
- Data flow directions
- Security boundaries
- API endpoints
- Environment configurations

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI["User Interface Layer"]
        direction TB
        FE["Frontend Application"]
        TC["Test Kit Component"]:::frontend
        TM["Telemedicine Module"]:::frontend
        SC["Symptom Checker"]:::frontend
        AC["Authentication Components"]:::frontend
        AD["Admin Dashboard"]:::frontend
        SH["Shared Components"]:::frontend
    end

    subgraph BL["Backend Layer"]
        direction TB
        API["API Gateway"]:::backend
        AS["Authentication Service"]:::security
        BLS["Business Logic Service"]:::backend
        ES["Email Service"]:::backend
        VS["Video Service"]:::backend
        AIS["AI Integration Service"]:::backend
    end

    subgraph DB["Database Layer"]
        direction TB
        UM["User Management"]:::database
        TKO["Test Kit Orders"]:::database
        TS["Telemedicine Sessions"]:::database
        AD_DB["Admin Data"]:::database
    end

    subgraph EXT["External Services"]
        direction TB
        OAI["OpenAI API"]:::external
        EMS["Email Service"]:::external
        VCS["Video Conferencing Service"]:::external
    end

    %% Frontend Component Relationships
    FE --> TC
    FE --> TM
    FE --> SC
    FE --> AC
    FE --> AD
    FE --> SH

    %% Backend Integration
    TC --> API
    TM --> API
    SC --> API
    AC --> API
    AD --> API

    %% Backend Service Flow
    API --> AS
    API --> BLS
    BLS --> ES
    BLS --> VS
    BLS --> AIS

    %% Database Interactions
    BLS --> UM
    BLS --> TKO
    BLS --> TS
    BLS --> AD_DB

    %% External Service Integration
    AIS --> OAI
    ES --> EMS
    VS --> VCS

    %% Click Events
    click TC "https://github.com/Mwantech/Health-Tracking-System-/blob/main/src/pages/ordertestkits.jsx"
    click TM "https://github.com/Mwantech/Health-Tracking-System-/blob/main/src/pages/Telemedicine.jsx"
    click SC "https://github.com/Mwantech/Health-Tracking-System-/blob/main/src/pages/SymptomChecker.jsx"
    click AC "https://github.com/Mwantech/Health-Tracking-System-/blob/main/src/components/LoginPage.jsx"
    click AD "https://github.com/Mwantech/Health-Tracking-System-/tree/main/src/pages/Admin page"
    click SH "https://github.com/Mwantech/Health-Tracking-System-/tree/main/src/components"

    %% Styling
    classDef frontend fill:#2196F3,stroke:#fff,stroke-width:2px,color:#fff
    classDef backend fill:#4CAF50,stroke:#fff,stroke-width:2px,color:#fff
    classDef security fill:#f44336,stroke:#fff,stroke-width:2px,color:#fff
    classDef database fill:#9C27B0,stroke:#fff,stroke-width:2px,color:#fff
    classDef external fill:#FFC107,stroke:#fff,stroke-width:2px,color:#fff

    %% Legend
    subgraph Legend
        direction TB
        F[Frontend]:::frontend
        B[Backend]:::backend
        S[Security]:::security
        D[Database]:::database
        E[External]:::external
    end
```
