# fejoejs/vaxipredict architecture

> Architecture diagram of the GitHub repository fejoejs/vaxipredict, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fejoejs/vaxipredict
- Repository: https://github.com/fejoejs/vaxipredict

## Overview

VaxiPredict is a web platform for assessing regional vaccine-hesitancy risk and supporting immunization campaigns. Users enter through the React application, authenticate or browse permitted views, and use dashboards and feature pages; backend APIs provide analytics, predictions, dataset ingestion, fact-checking, interventions, reminders, and reports. The documented prediction path assembles regional graph and vaccination-history data before hybrid GNN-LSTM inference. The graph includes the main UI, API, model, and supporting service layers. Relationships for unsampled feature routes are shown only where documented; the source excerpts do not expose their detailed call paths.

Main entry points: [`frontend/src/App.tsx`](https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/App.tsx) (Application routing), [`backend/app/api/routes/auth.py`](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/api/routes/auth.py) (Authentication API), [`backend/app/ml/pipeline.py`](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/ml/pipeline.py) (Prediction pipeline), [`backend/app/main.py`](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/main.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Application routing<br/>[App.tsx]"]
  node_layout["Shared layout<br/>[Layout.tsx]"]
  node_auth_ui["Session and profiles<br/>[AuthContext.tsx]"]
  node_dashboard_ui["Dashboard<br/>[Dashboard.tsx]"]
  node_feature_pages["Feature pages"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_backend["API and access"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_api_routes["Product APIs"]
  node_access["Identity and roles<br/>[deps.py]"]
  node_db_session["Database sessions<br/>[session.py]"]
  node_user_store[("User records<br/>[user.py]")]
end

subgraph group_data["Data and prediction"]
  node_dataset_api["Dataset ingestion<br/>[datasets.py]"]
  node_ingestion["Dataset processing<br/>[ingestion.py]"]
  node_regional_data[("Regional records<br/>[region.py]")]
  node_vaccination_data[("Vaccination records<br/>[dataset.py]")]
  node_prediction_api["Prediction API<br/>[predictions.py]"]
  node_prediction_pipeline["Prediction pipeline<br/>[pipeline.py]"]
  node_gnn_lstm["Hybrid GNN-LSTM<br/>[gnn_lstm.py]"]
end

subgraph group_intelligence["Decision support"]
  node_ai_assistant["AI fact-checking<br/>[ai_chat.py]"]
  node_gemini["Gemini integration<br/>[gemini.py]"]
  node_rumor_analysis["Rumor analysis<br/>[rumor_nlp.py]"]
  node_reporting["Reports and analytics<br/>[report_builder.py]"]
end

subgraph group_outreach["Campaign operations"]
  node_interventions["Intervention planning<br/>[interventions.py]"]
  node_reminder_service["Reminder delivery<br/>[whatsapp.py]"]
end

node_user(("Platform user"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_layout
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_feature_pages
node_auth_ui -->|"calls"| node_api_client
node_api_client -.->|"sends requests"| node_api_app
node_api_app -->|"registers"| node_auth_api
node_api_app -->|"registers"| node_api_routes
node_auth_api -->|"checks identity"| node_access
node_auth_api -->|"queries"| node_db_session
node_auth_api -->|"reads and writes"| node_user_store
node_dataset_api -.->|"delegates"| node_ingestion
node_ingestion -->|"uses"| node_regional_data
node_ingestion -->|"uses"| node_vaccination_data
node_prediction_api -->|"runs"| node_prediction_pipeline
node_prediction_pipeline -->|"reads"| node_regional_data
node_prediction_pipeline -->|"reads"| node_vaccination_data
node_prediction_pipeline -->|"runs inference"| node_gnn_lstm
node_ai_assistant -.->|"uses"| node_gemini
node_ai_assistant -.->|"analyzes claims"| node_rumor_analysis

click node_app "https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/App.tsx"
click node_layout "https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/components/layout/Layout.tsx"
click node_auth_ui "https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/context/AuthContext.tsx"
click node_dashboard_ui "https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/pages/Dashboard.tsx"
click node_feature_pages "https://github.com/fejoejs/vaxipredict/tree/main/frontend/src/pages"
click node_api_client "https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/api/client.ts"
click node_api_app "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/main.py"
click node_auth_api "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/api/routes/auth.py"
click node_api_routes "https://github.com/fejoejs/vaxipredict/tree/main/backend/app/api/routes"
click node_access "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/api/deps.py"
click node_db_session "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/db/session.py"
click node_user_store "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/models/user.py"
click node_dataset_api "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/api/routes/datasets.py"
click node_ingestion "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/ingestion.py"
click node_regional_data "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/models/region.py"
click node_vaccination_data "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/models/dataset.py"
click node_prediction_api "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/api/routes/predictions.py"
click node_prediction_pipeline "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/ml/pipeline.py"
click node_gnn_lstm "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/ml/gnn_lstm.py"
click node_ai_assistant "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/ai_chat.py"
click node_gemini "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/gemini.py"
click node_rumor_analysis "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/rumor_nlp.py"
click node_interventions "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/interventions.py"
click node_reminder_service "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/whatsapp.py"
click node_reporting "https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/report_builder.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_layout,node_auth_ui,node_dashboard_ui,node_feature_pages,node_api_client,node_user toneBlue
class node_api_app,node_auth_api,node_api_routes,node_access,node_db_session,node_user_store toneAmber
class node_dataset_api,node_ingestion,node_regional_data,node_vaccination_data,node_prediction_api,node_prediction_pipeline,node_gnn_lstm toneMint
class node_ai_assistant,node_gemini,node_rumor_analysis,node_reporting toneRose
class node_interventions,node_reminder_service toneIndigo
```

## Components

### Web application

- [Application routing](https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Shared layout](https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/components/layout/Layout.tsx): `frontend/src/components/layout/Layout.tsx`
- [Session and profiles](https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Dashboard](https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Feature pages](https://github.com/fejoejs/vaxipredict/tree/main/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/fejoejs/vaxipredict/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### API and access

- [FastAPI application](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication API](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/api/routes/auth.py): `backend/app/api/routes/auth.py`
- [Product APIs](https://github.com/fejoejs/vaxipredict/tree/main/backend/app/api/routes): `backend/app/api/routes`
- [Identity and roles](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/api/deps.py): `backend/app/api/deps.py`
- [Database sessions](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [User records](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/models/user.py): `backend/app/models/user.py`

### Data and prediction

- [Dataset ingestion](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/api/routes/datasets.py): `backend/app/api/routes/datasets.py`
- [Dataset processing](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/ingestion.py): `backend/app/services/ingestion.py`
- [Regional records](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/models/region.py): `backend/app/models/region.py`
- [Vaccination records](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/models/dataset.py): `backend/app/models/dataset.py`
- [Prediction API](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/api/routes/predictions.py): `backend/app/api/routes/predictions.py`
- [Prediction pipeline](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/ml/pipeline.py): `backend/app/ml/pipeline.py`
- [Hybrid GNN-LSTM](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/ml/gnn_lstm.py): `backend/app/ml/gnn_lstm.py`

### Decision support

- [AI fact-checking](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/ai_chat.py): `backend/app/services/ai_chat.py`
- [Gemini integration](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/gemini.py): `backend/app/services/gemini.py`
- [Rumor analysis](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/rumor_nlp.py): `backend/app/services/rumor_nlp.py`
- [Reports and analytics](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/report_builder.py): `backend/app/services/report_builder.py`

### Campaign operations

- [Intervention planning](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/interventions.py): `backend/app/services/interventions.py`
- [Reminder delivery](https://github.com/fejoejs/vaxipredict/blob/main/backend/app/services/whatsapp.py): `backend/app/services/whatsapp.py`

### Other components

- **Platform user**

## Connections

- Platform user → Application routing: uses (evidence: `frontend/src/App.tsx`)
- Application routing → Shared layout: renders (evidence: `frontend/src/App.tsx`)
- Application routing → Dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Application routing → Feature pages: routes to (evidence: `frontend/src/App.tsx`)
- Session and profiles → API client: calls (evidence: `frontend/src/context/AuthContext.tsx`)
- API client → FastAPI application: sends requests
- FastAPI application → Authentication API: registers (evidence: `backend/app/main.py`)
- FastAPI application → Product APIs: registers (evidence: `backend/app/main.py`)
- Authentication API → Identity and roles: checks identity (evidence: `backend/app/api/routes/auth.py`)
- Authentication API → Database sessions: queries (evidence: `backend/app/api/routes/auth.py`)
- Authentication API → User records: reads and writes (evidence: `backend/app/api/routes/auth.py`)
- Dataset ingestion → Dataset processing: delegates
- Dataset processing → Regional records: uses (evidence: `backend/app/services/ingestion.py`)
- Dataset processing → Vaccination records: uses (evidence: `backend/app/services/ingestion.py`)
- Prediction API → Prediction pipeline: runs (evidence: `backend/app/api/routes/predictions.py`)
- Prediction pipeline → Regional records: reads (evidence: `backend/app/ml/pipeline.py`)
- Prediction pipeline → Vaccination records: reads (evidence: `backend/app/ml/pipeline.py`)
- Prediction pipeline → Hybrid GNN-LSTM: runs inference (evidence: `backend/app/ml/pipeline.py`)
- AI fact-checking → Gemini integration: uses
- AI fact-checking → Rumor analysis: analyzes claims
