Skip to content

balaraj74/Aadhaar-Pulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ท Aadhaar Pulse

Government-Grade Decision Support Analytics Platform for UIDAI

Python FastAPI Next.js License

Transform aggregated Aadhaar data into actionable insights for policymakers and administrators.


๐ŸŽฏ Overview

Aadhaar Pulse is a comprehensive analytics dashboard designed for UIDAI decision-makers. It provides real-time insights into Aadhaar enrolment and update patterns across India, powered by official Data.gov.in datasets.

โœจ Key Features

Feature Description
๐Ÿ“Š Real-Time Analytics Dynamically computed KPIs, trends, and growth metrics
๐Ÿ” Anomaly Detection Z-score based detection of unusual patterns
๐Ÿ“ˆ Forecasting 6-month demand prediction with confidence intervals
๐Ÿ’ก AI Insights Rule-based pattern analysis with actionable recommendations
๐Ÿ—บ๏ธ Geographic Analysis State-wise heatmaps and regional breakdowns
๐Ÿ›ก๏ธ Privacy-Safe Only aggregated data - no individual-level information

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                       Frontend (Next.js)                        โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
โ”‚  โ”‚ Dashboardโ”‚ โ”‚ Forecast โ”‚ โ”‚ Insights โ”‚ โ”‚ Geographyโ”‚           โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚ REST API
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                       Backend (FastAPI)                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚
โ”‚  โ”‚                    API Layer (Routers)                      โ”‚โ”‚
โ”‚  โ”‚  /overview  /enrolments  /updates  /anomalies  /forecasts  โ”‚โ”‚
โ”‚  โ”‚  /insights  /recommendations  /geography                   โ”‚โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
โ”‚                              โ”‚                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚
โ”‚  โ”‚                    Services Layer                           โ”‚โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚โ”‚
โ”‚  โ”‚  โ”‚ Data Repo    โ”‚ โ”‚ Analytics    โ”‚ โ”‚ Anomaly Detection   โ”‚ โ”‚โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚โ”‚
โ”‚  โ”‚  โ”‚ Forecasting  โ”‚ โ”‚ Insights     โ”‚ โ”‚ Recommendations     โ”‚ โ”‚โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
โ”‚                              โ”‚                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚
โ”‚  โ”‚                 Data Sources                                 โ”‚โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚โ”‚
โ”‚  โ”‚  โ”‚ Data.gov.in APIs  โ”‚  โ”‚ Simulated Data (UIDAI Patterns) โ”‚ โ”‚โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ฆ Project Structure

Aadhaar Pulse/
โ”œโ”€โ”€ apps/
โ”‚   โ”œโ”€โ”€ api/                          # FastAPI Backend
โ”‚   โ”‚   โ”œโ”€โ”€ main.py                   # Application entry point
โ”‚   โ”‚   โ”œโ”€โ”€ config.py                 # Configuration management
โ”‚   โ”‚   โ”œโ”€โ”€ routers/                  # API endpoints
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ overview.py           # Dashboard KPIs
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ enrolments.py         # Enrolment analytics
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ updates.py            # Update patterns
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ anomalies.py          # Anomaly detection
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ forecasts.py          # Time-series forecasting
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ insights.py           # AI-generated insights
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ recommendations.py    # Policy recommendations
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ geography.py          # Geographic analysis
โ”‚   โ”‚   โ””โ”€โ”€ services/                 # Business logic
โ”‚   โ”‚       โ”œโ”€โ”€ data_repository.py    # Data management
โ”‚   โ”‚       โ”œโ”€โ”€ analytics_service.py  # Computed metrics
โ”‚   โ”‚       โ”œโ”€โ”€ anomaly_engine.py     # Anomaly detection
โ”‚   โ”‚       โ”œโ”€โ”€ forecast_engine.py    # Forecasting
โ”‚   โ”‚       โ”œโ”€โ”€ insight_engine.py     # Insight generation
โ”‚   โ”‚       โ””โ”€โ”€ recommendation_engine.py
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ web/                          # Next.js Frontend
โ”‚       โ”œโ”€โ”€ src/
โ”‚       โ”‚   โ”œโ”€โ”€ app/                  # App Router pages
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx          # Dashboard
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ enrolments/
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ updates/
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ anomalies/
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ forecasts/
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ insights/
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ recommendations/
โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ geography/
โ”‚       โ”‚   โ”œโ”€โ”€ components/           # UI components
โ”‚       โ”‚   โ””โ”€โ”€ lib/                  # API client
โ”‚       โ””โ”€โ”€ package.json
โ”‚
โ””โ”€โ”€ README.md

๐Ÿš€ Quick Start

Prerequisites

1. Clone the Repository

git clone https://github.com/balaraj74/Aadhaar-Pulse.git
cd Aadhaar-Pulse

2. Setup Backend (FastAPI)

# Navigate to API directory
cd apps/api

# Create virtual environment
python3 -m venv venv

# Activate virtual environment
source venv/bin/activate        # Linux/macOS
# OR
venv\Scripts\activate           # Windows

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env and add your API keys:
# - GEMINI_API_KEY (for AI insights)
# - DATA_GOV_API_KEY (for data.gov.in)

# Start the API server
python -m uvicorn main:app --reload --port 8000

The API will be running at http://localhost:8000

3. Setup Frontend (Next.js)

Open a new terminal and run:

# Navigate to web directory
cd apps/web

# Install dependencies
npm install

# Start development server
npm run dev

The frontend will be running at http://localhost:3000

4. Access the Application

Service URL
Dashboard http://localhost:3000
API Documentation http://localhost:8000/docs
API Health Check http://localhost:8000/api/v1/overview

๐Ÿ”‘ Environment Variables

Create a .env file in apps/api/ with the following:

# Environment
ENVIRONMENT=development
DEBUG=true

# Data.gov.in API (optional - uses simulated data if not set)
DATA_GOV_API_KEY=your_data_gov_api_key

# Gemini AI (required for AI insights)
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-2.5-flash

# Cache Settings
CACHE_TTL_SECONDS=300

# Analytics Settings
FORECAST_HORIZON_MONTHS=6
ANOMALY_ZSCORE_THRESHOLD=2.5

๐Ÿ›‘ Stopping the Servers

  • Press Ctrl+C in each terminal to stop the servers

๐Ÿ”„ Running Both Servers Together

For convenience, you can use two terminals:

Terminal 1 (API):

cd apps/api && source venv/bin/activate && python -m uvicorn main:app --reload --port 8000

Terminal 2 (Web):

cd apps/web && npm run dev

๐Ÿ“ก API Endpoints

All endpoints return computed values - never static data.

Endpoint Description
GET /api/v1/overview Dashboard summary with KPIs and alerts
GET /api/v1/enrolments Enrolment analytics and demographics
GET /api/v1/enrolments/timeseries Monthly enrolment time series
GET /api/v1/updates Update type distribution and patterns
GET /api/v1/updates/fatigue Update fatigue index by region
GET /api/v1/anomalies Detected anomalies with explanations
GET /api/v1/forecasts 6-month demand forecasts
GET /api/v1/forecasts/capacity Capacity planning analysis
GET /api/v1/insights AI-generated pattern insights
GET /api/v1/recommendations Policy recommendations
GET /api/v1/geography State-wise heatmap and regions
GET /api/v1/geography/state/{code} State detail data

๐Ÿ”ฎ Analytics Capabilities

๐Ÿ“Š Metrics Computed

  • Total Enrolments: Cumulative Aadhaar registrations (1.45B+)
  • Monthly Growth: YoY and MoM trends
  • Update Patterns: Type distribution (Address, Mobile, Biometric, etc.)
  • Seasonal Indices: Monthly variation patterns
  • Regional Distribution: State and region aggregates

โš ๏ธ Anomaly Detection

Uses statistical methods:

  • Z-Score Analysis: Detects values > 2.5 standard deviations
  • Rule-Based Detection: Specific pattern rules
    • Enrolment surges (>20% above expected)
    • Update fatigue (high repeat rates)
    • Demographic imbalances
    • Geographic disparities

๐Ÿ“ˆ Forecasting

  • Model: Prophet-style decomposition (trend + seasonal)
  • Horizon: 6 months ahead
  • Metrics: Rยฒ, MAPE, MAE, RMSE
  • Output: Point forecast + 95% confidence interval

๐Ÿ’ก Insight Categories

Category Example
Migration "23% increase in address updates in Mumbai metropolitan region"
Demographics "Youth enrolment surge in Bihar aligns with academic calendar"
Operations "Update fatigue index at 0.72 in metro areas"
Seasonal "October-March sees 15% higher enrolment activity"

๐Ÿ›๏ธ Data Sources

Official Government Datasets

Dataset Source Use
Aadhaar Monthly Enrolment Data.gov.in Enrolment trends
Aadhaar by Gender & Age Data.gov.in Demographics
Demographic Updates Data.gov.in Update patterns
Biometric Updates Data.gov.in Biometric analysis

Data Notes

  • Privacy: All data is aggregated at state/district level
  • No PII: No individual-level data is processed or stored
  • Compliance: Adheres to UIDAI data guidelines
  • Fallback: When API unavailable, uses simulated data based on official patterns

๐Ÿ›ก๏ธ Privacy & Compliance

โœ… No Individual Data - Only aggregated statistics
โœ… No PII - No personal identifiable information
โœ… Government Sources Only - Official Data.gov.in datasets
โœ… UIDAI Guidelines - Compliant with data handling policies
โœ… Audit Trail - All data sources documented


๐Ÿงช Development

Running Tests

# Backend
cd apps/api
pytest

# Frontend
cd apps/web
npm test

Adding New Features

  1. New API Endpoint: Add router in apps/api/routers/
  2. New Service: Add logic in apps/api/services/
  3. Frontend Page: Add page in apps/web/src/app/
  4. API Client: Update apps/web/src/lib/api.ts

๐Ÿ”„ Extending the System

Adding New Data Sources

# In services/data_repository.py
async def fetch_new_dataset(self):
    data = await data_gov_client.fetch_resource(
        resource_id="your-resource-id",
        limit=1000
    )
    # Process and store

Adding New Insights

# In services/insight_engine.py
def _detect_new_pattern(self) -> List[Dict]:
    # Analyze data
    if condition_met:
        return [{
            "title": "New Pattern Detected",
            "category": "Custom",
            "priority": "high",
            # ...
        }]

๐Ÿ“‹ Hackathon Evaluation Criteria

Criteria Implementation
Functionality Full-featured dashboard with 8 pages
Real Data Data.gov.in integration + realistic simulation
Analytics Computed metrics, never hard-coded
ML/AI Anomaly detection, forecasting, insights
Privacy Aggregated data only, no PII
Scalability Service-oriented architecture
UX Premium dark theme, responsive design
Documentation Comprehensive README and API docs

๐Ÿ“„ License

MIT License - See LICENSE for details.


๐Ÿ™ Acknowledgments

  • UIDAI - For Aadhaar infrastructure
  • Data.gov.in - For open government data
  • Open Source - FastAPI, Next.js, Recharts, Tailwind CSS

Built for UIDAI Hackathon 2026 ๐Ÿ‡ฎ๐Ÿ‡ณ

API Docs | Dashboard | Data.gov.in

About

Government-Grade Decision Support Analytics Platform for Aadhaar

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors