# pranav-git27/uidai-project architecture

> Architecture diagram of the GitHub repository pranav-git27/uidai-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pranav-git27/uidai-project
- Repository: https://github.com/pranav-git27/uidai-project

## Overview

UIDAI Analytics is a prototype decision-support dashboard for exploring anonymized enrolment and update activity. Stakeholders select state and date filters, then view KPIs, trends, anomaly findings, forecasts, or filtered raw records. The two training scripts build anomaly-detection and demand-forecasting models from the synthetic dataset; the dashboard loads persisted artifacts for inference. Forecast training uses the shared data loader, while anomaly training reads the CSV directly. Dashboard capabilities are documented in the README, but omitted source lines limit confirmation of their internal wiring.

Main entry points: [`app/dashboard.py`](https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py) (Dashboard App), [`ml/train_forecast.py`](https://github.com/pranav-git27/uidai-project/blob/main/ml/train_forecast.py) (Forecast Training), [`data/uidai_analytics_synthetic_data.csv`](https://github.com/pranav-git27/uidai-project/blob/main/data/uidai_analytics_synthetic_data.csv) (Synthetic Dataset), [`ml/train_anomaly.py`](https://github.com/pranav-git27/uidai-project/blob/main/ml/train_anomaly.py) (Anomaly Training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_app["Dashboard App<br/>[dashboard.py]"]
  node_kpis["KPIs<br/>[dashboard.py]"]
  node_trend_analysis["Trend Analysis<br/>[dashboard.py]"]
  node_anomaly_analysis["Anomaly Analysis<br/>[dashboard.py]"]
  node_forecast_view["Forecast View<br/>[dashboard.py]"]
  node_raw_data_view["Raw Data View<br/>[dashboard.py]"]
end

subgraph group_data["Data"]
  node_synthetic_generator["Synthetic Generator"]
  node_dataset[("Synthetic Dataset")]
  node_data_loader["Data Loader<br/>[data_loader.py]"]
end

subgraph group_training["Model Training"]
  node_anomaly_training["Anomaly Training<br/>[train_anomaly.py]"]
  node_forecast_training["Forecast Training<br/>[train_forecast.py]"]
  node_model_utils["Model Utilities<br/>[model_utils.py]"]
end

subgraph group_artifacts["Model Artifacts"]
  node_anomaly_artifact["Anomaly Model<br/>[anomaly_model.pkl]"]
  node_encoder_artifact["Label Encoders<br/>[Label_Encoders.pkl]"]
  node_forecast_artifact["Forecast Ensemble"]
  node_forecast_samples["Sample Forecasts"]
  node_scaler_artifact["Feature Scaler<br/>[feature_scaler.pkl]"]
  node_feature_artifact["Feature List<br/>[feature_list.pkl]"]
end

node_stakeholder(("Government Stakeholder"))

node_stakeholder -->|"uses"| node_dashboard_app
node_synthetic_generator -->|"writes"| node_dataset
node_dashboard_app -->|"loads data"| node_dataset
node_forecast_training -->|"loads data"| node_data_loader
node_data_loader -->|"reads"| node_dataset
node_anomaly_training -->|"reads"| node_dataset
node_anomaly_training -->|"saves model"| node_anomaly_artifact
node_anomaly_training -->|"saves encoders"| node_encoder_artifact
node_forecast_training -->|"uses utilities"| node_model_utils
node_forecast_training -->|"saves ensemble"| node_forecast_artifact
node_forecast_training -->|"saves forecasts"| node_forecast_samples
node_forecast_training -->|"saves scaler"| node_scaler_artifact
node_forecast_training -->|"saves features"| node_feature_artifact
node_dashboard_app -->|"loads model"| node_anomaly_artifact
node_dashboard_app -->|"loads encoders"| node_encoder_artifact
node_dashboard_app -->|"loads model"| node_forecast_artifact
node_dashboard_app -->|"loads scaler"| node_scaler_artifact
node_dashboard_app -->|"loads features"| node_feature_artifact
node_dashboard_app -->|"calculates"| node_kpis
node_dashboard_app -->|"renders"| node_trend_analysis
node_dashboard_app -->|"detects and presents"| node_anomaly_analysis
node_dashboard_app -->|"presents forecasts"| node_forecast_view
node_dashboard_app -->|"presents records"| node_raw_data_view

click node_dashboard_app "https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py"
click node_kpis "https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py"
click node_trend_analysis "https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py"
click node_anomaly_analysis "https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py"
click node_forecast_view "https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py"
click node_raw_data_view "https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py"
click node_synthetic_generator "https://github.com/pranav-git27/uidai-project/blob/main/data/generate_synthetic_data.py"
click node_dataset "https://github.com/pranav-git27/uidai-project/blob/main/data/uidai_analytics_synthetic_data.csv"
click node_data_loader "https://github.com/pranav-git27/uidai-project/blob/main/utils/data_loader.py"
click node_anomaly_training "https://github.com/pranav-git27/uidai-project/blob/main/ml/train_anomaly.py"
click node_forecast_training "https://github.com/pranav-git27/uidai-project/blob/main/ml/train_forecast.py"
click node_model_utils "https://github.com/pranav-git27/uidai-project/blob/main/utils/model_utils.py"
click node_anomaly_artifact "https://github.com/pranav-git27/uidai-project/blob/main/models/anomaly_model.pkl"
click node_encoder_artifact "https://github.com/pranav-git27/uidai-project/blob/main/models/Label_Encoders.pkl"
click node_forecast_artifact "https://github.com/pranav-git27/uidai-project/blob/main/models/forecasting_ensemble.pkl"
click node_forecast_samples "https://github.com/pranav-git27/uidai-project/blob/main/models/sample_forecasts.pkl"
click node_scaler_artifact "https://github.com/pranav-git27/uidai-project/blob/main/models/feature_scaler.pkl"
click node_feature_artifact "https://github.com/pranav-git27/uidai-project/blob/main/models/feature_list.pkl"

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_dashboard_app,node_kpis,node_trend_analysis,node_anomaly_analysis,node_forecast_view,node_raw_data_view toneBlue
class node_synthetic_generator,node_dataset,node_data_loader toneAmber
class node_anomaly_training,node_forecast_training,node_model_utils toneMint
class node_anomaly_artifact,node_encoder_artifact,node_forecast_artifact,node_forecast_samples,node_scaler_artifact,node_feature_artifact toneRose
class node_stakeholder toneIndigo
```

## Components

### Dashboard

- [Dashboard App](https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py): `app/dashboard.py`
- [KPIs](https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py): `app/dashboard.py`
- [Trend Analysis](https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py): `app/dashboard.py`
- [Anomaly Analysis](https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py): `app/dashboard.py`
- [Forecast View](https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py): `app/dashboard.py`
- [Raw Data View](https://github.com/pranav-git27/uidai-project/blob/main/app/dashboard.py): `app/dashboard.py`

### Data

- [Synthetic Generator](https://github.com/pranav-git27/uidai-project/blob/main/data/generate_synthetic_data.py): `data/generate_synthetic_data.py`
- [Synthetic Dataset](https://github.com/pranav-git27/uidai-project/blob/main/data/uidai_analytics_synthetic_data.csv): `data/uidai_analytics_synthetic_data.csv`
- [Data Loader](https://github.com/pranav-git27/uidai-project/blob/main/utils/data_loader.py): `utils/data_loader.py`

### Model Training

- [Anomaly Training](https://github.com/pranav-git27/uidai-project/blob/main/ml/train_anomaly.py): `ml/train_anomaly.py`
- [Forecast Training](https://github.com/pranav-git27/uidai-project/blob/main/ml/train_forecast.py): `ml/train_forecast.py`
- [Model Utilities](https://github.com/pranav-git27/uidai-project/blob/main/utils/model_utils.py): `utils/model_utils.py`

### Model Artifacts

- [Anomaly Model](https://github.com/pranav-git27/uidai-project/blob/main/models/anomaly_model.pkl): `models/anomaly_model.pkl`
- [Label Encoders](https://github.com/pranav-git27/uidai-project/blob/main/models/Label_Encoders.pkl): `models/Label_Encoders.pkl`
- [Forecast Ensemble](https://github.com/pranav-git27/uidai-project/blob/main/models/forecasting_ensemble.pkl): `models/forecasting_ensemble.pkl`
- [Sample Forecasts](https://github.com/pranav-git27/uidai-project/blob/main/models/sample_forecasts.pkl): `models/sample_forecasts.pkl`
- [Feature Scaler](https://github.com/pranav-git27/uidai-project/blob/main/models/feature_scaler.pkl): `models/feature_scaler.pkl`
- [Feature List](https://github.com/pranav-git27/uidai-project/blob/main/models/feature_list.pkl): `models/feature_list.pkl`

### Other components

- **Government Stakeholder**

## Connections

- Government Stakeholder → Dashboard App: uses
- Synthetic Generator → Synthetic Dataset: writes
- Dashboard App → Synthetic Dataset: loads data
- Forecast Training → Data Loader: loads data
- Data Loader → Synthetic Dataset: reads
- Anomaly Training → Synthetic Dataset: reads
- Anomaly Training → Anomaly Model: saves model
- Anomaly Training → Label Encoders: saves encoders
- Forecast Training → Model Utilities: uses utilities
- Forecast Training → Forecast Ensemble: saves ensemble
- Forecast Training → Sample Forecasts: saves forecasts
- Forecast Training → Feature Scaler: saves scaler
- Forecast Training → Feature List: saves features
- Dashboard App → Anomaly Model: loads model
- Dashboard App → Label Encoders: loads encoders
- Dashboard App → Forecast Ensemble: loads model
- Dashboard App → Feature Scaler: loads scaler
- Dashboard App → Feature List: loads features
- Dashboard App → KPIs: calculates
- Dashboard App → Trend Analysis: renders
- Dashboard App → Anomaly Analysis: detects and presents
- Dashboard App → Forecast View: presents forecasts
- Dashboard App → Raw Data View: presents records
