# eng6bear2wh5/healthcare-ai-web-project architecture

> Architecture diagram of the GitHub repository eng6bear2wh5/healthcare-ai-web-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eng6bear2wh5/healthcare-ai-web-project
- Repository: https://github.com/eng6bear2wh5/healthcare-ai-web-project

## Overview

##### Project type and purpose
- This is a full-stack HealthCare Web application.
- Frontend: React (JSX) built with Vite, serving both public and admin user interfaces.
- Backend: Node.js/Express (server.js) exposing REST APIs for “disease” and “group” resources.
- Purpose: public site for patients/community (info, forums, events, disease lookup) plus an admin dashboard to create/edit diseases and groups.

##### File structure
- Top level:
– Backend/ (currently stubbed)
– Frontend/ (complete client + embedded backend folder)
- Frontend/src/backend: Node/Express server entrypoint (server.js) + .env for DB connection.
- Frontend/src/api: client-side modules (diseaseApi.js, groupApi.js) that wrap REST calls.
- Frontend/src/pages & components: React UI components for various routes (Home, About, Category, Community, Pharma, Login).
- Frontend/src/contexts: React Context for global state (CategoryContext).
- Configuration: vite.config.js, package.json, ESLint.

##### README
- Minimal; confirms the project’s title “HealthCare Web Project.”

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend (React SPA)" 
        direction TB
        Browser["Client Browser"]:::external
        Browser -->|"Loads index.html via Vite"| Main
        Main["main.jsx"]:::frontend
        Main --> AppComp
        AppComp["App.jsx"]:::frontend
        subgraph "React Application"
            direction TB
            Pages["Pages (Home, About, Category, Community, Pharma, Login)"]:::frontend
            Components["Components (Navbar, Footer, ChatButton)"]:::frontend
            Context["CategoryContext.jsx"]:::frontend
            API["API Modules"]:::frontend
            subgraph "API Modules"
                direction TB
                DiseaseApi["diseaseApi.js"]:::api
                GroupApi["groupApi.js"]:::api
            end
            subgraph "Admin Dashboard"
                direction TB
                AdminDash["AdminDashboard.jsx"]:::frontend
                subgraph "Disease Management"
                    CreateDisease["CreateDisease.jsx"]:::frontend
                    EditDisease["EditDisease.jsx"]:::frontend
                end
                subgraph "Group Management"
                    CreateGroup["CreateGroup.jsx"]:::frontend
                    EditGroup["EditGroup.jsx"]:::frontend
                end
            end
            AppComp --> Pages
            AppComp --> Components
            AppComp --> Context
            AppComp --> API
            API --> DiseaseApi
            API --> GroupApi
            AppComp --> AdminDash
            AdminDash --> CreateDisease
            AdminDash --> EditDisease
            AdminDash --> CreateGroup
            AdminDash --> EditGroup
        end
    end

    %% Backend Layer
    subgraph "Backend (Node.js/Express)" 
        direction TB
        Server["server.js"]:::backend
        Env[".env"]:::backend
        Server -->|"Uses DB_URI"| Env
        Server -->|"Defines routes /api/diseases, /api/groups"| Controllers
        Controllers["Controllers"]:::backend
        Controllers -->|"CRUD operations"| DataLayer
        DataLayer["Data Access Layer"]:::backend
    end

    %% Database
    DB["Database (MongoDB/SQL)"]:::database

    %% External Services
    Auth0["Auth Provider"]:::external
    EmailSvc["Email/Notification Service"]:::external

    %% Connections
    DiseaseApi -->|"GET/POST /api/diseases"| Server
    GroupApi -->|"GET/POST /api/groups"| Server
    Server -->|"Query/Update"| DB
    AdminDash -->|"Auth Calls"| Auth0
    Server -->|"Send Emails"| EmailSvc

    %% Styles
    classDef frontend fill:#BBDEFB,stroke:#1E88E5,color:#0D47A1;
    classDef backend fill:#C8E6C9,stroke:#43A047,color:#1B5E20;
    classDef database fill:#FFE0B2,stroke:#FB8C00,color:#E65100;
    classDef external fill:#E0E0E0,stroke:#9E9E9E,color:#424242;
    classDef api fill:#BBDEFB,stroke:#1E88E5,color:#0D47A1;

    %% Click Events
    click Main "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/main.jsx"
    click AppComp "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/App.jsx"
    click Pages "https://github.com/eng6bear2wh5/healthcare-ai-web-project/tree/develop/Frontend/src/pages"
    click Components "https://github.com/eng6bear2wh5/healthcare-ai-web-project/tree/develop/Frontend/src/components"
    click Context "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/contexts/CategoryContext.jsx"
    click DiseaseApi "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/api/diseaseApi.js"
    click GroupApi "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/api/groupApi.js"
    click AdminDash "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/admin/AdminDashboard.jsx"
    click CreateDisease "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/admin/Disease/CreatDisease.jsx"
    click EditDisease "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/admin/Disease/EditDisease.jsx"
    click CreateGroup "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/admin/Group/CreatGroup.jsx"
    click EditGroup "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/admin/Group/EditGroup.jsx"
    click Server "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/backend/server.js"
    click Env "https://github.com/eng6bear2wh5/healthcare-ai-web-project/blob/develop/Frontend/src/backend/.env"
```
