A comprehensive digital platform for the Pradhan Mantri Anusuchit Jaati Abhyudaya Yojana (PM-AJAY) scheme, built for Smart India Hackathon 2025. This platform modernizes welfare fund disbursement, beneficiary management, and evidence tracking using blockchain technology, AI/ML models, and multi-channel communication.
- Architecture Overview
- Tech Stack
- Features
- Project Structure
- Data Files
- Getting Started
- Step-by-Step Run Instructions
- Environment Variables
- API Documentation
- Troubleshooting
- License
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PM-AJAY Digital Platform โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโค
โ Frontend โ Backend โ Blockchain โ AI Models โ Communication โ
โ (Next.js) โ (Node/Fast) โ (Fabric) โ (Python) โ (WhatsApp/Chatbot) โ
โ Port:3000 โ Port:1604 โ Port:3002 โ Port:5000+ โ Port:3000 โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ โ โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
โ
โโโโโโโโดโโโโโโโ
โ MongoDB โ
โ Port:27017 โ
โโโโโโโโโโโโโโโ
| Component | Technologies |
|---|---|
| Frontend | Next.js 14, React 18, TailwindCSS, TypeScript, Shepherd.js (guided tours) |
| Backend (Main API) | Node.js 18+, Express.js, MongoDB, Mongoose, JWT Auth |
| Backend (Translation) | FastAPI, Python 3.9+, Google Translate API (deep-translator) |
| Blockchain | Hyperledger Fabric 2.x, Spring Boot (Java 17), Docker |
| AI/ML Models | Python, XGBoost, Scikit-learn, LangChain, ChromaDB, RAG |
| Chatbot | Node.js, Twilio WhatsApp API, MongoDB, Tesseract OCR |
| Video Conferencing | Zego Cloud SDK |
| Feature | Description |
|---|---|
| User Authentication | Secure login/signup with role-based access (Ministry, PACC, State, SNA, IA, SAU) |
| Dashboard Analytics | Real-time KPIs with donut charts, time-series graphs, and India heatmap |
| Proposal Management | Create, track, and approve welfare proposals with multi-stage workflow |
| Project Tracking | Monitor milestones with visual tracker and evidence uploads |
| Funds Management | Track FTOs, PFMS confirmations, bank acknowledgments, and reconciliation |
| Beneficiary Management | View/filter beneficiaries with ranking scores and demographic data |
| Evidence Repository | Upload photos/documents with blockchain hash verification |
| Reports Generation | Generate PDF/Excel reports for audits and compliance |
| SNA Dashboard | State Nodal Agency view with account management |
| PACC View | Project Appraisal & Central Committee approval interface |
| Multi-language Support | 14+ Indian languages (Hindi, Bengali, Tamil, Telugu, etc.) |
| Video Conferencing | Built-in Zego meeting rooms for virtual discussions |
| AI Chatbot | Scheme FAQ assistant with context-aware responses |
| Guided Tour | Interactive onboarding with Shepherd.js |
- User Management (Register, Login, Profile, OAuth)
- Proposal CRUD with approval workflow
- Project lifecycle with milestone tracking
- Utilization Certificate (UC) upload/verification
- Central ministry data aggregation
- Document hash verification
- Real-time translation for 14+ Indian regional languages
- Auto-detect source language
- Google Translate integration via deep-translator
| Channel | Purpose | Organizations |
|---|---|---|
| Approval | Proposal & blueprint hashes | Ministry, PACC, State |
| Funds | FTO, PFMS, bank records | Ministry, State, SNA |
| Implementation | Beneficiary & evidence hashes | State, IA, SNA |
| Audit | Audit reports & UC hashes | SAU, State, Ministry |
20 blockchain API endpoints for hash storage and verification across 4 channels.
| Model | Purpose | Data Files |
|---|---|---|
| Beneficiary Ranking | XGBoost priority scoring | synthetic_beneficiaries.csv (1.7MB), trained_model.json |
| Question Clustering | Grievance pattern analysis | pm_ajay_final_simulated_data.csv, processed_issues_uuid.csv |
| State Plan RAG | Document Q&A with LangChain | input.json, input2.json |
- User registration with demographic collection
- Digital ledger for credits/debits
- Transaction categories: Income, Expense, Loans, Repayments, Savings
- OCR support for document scanning (Tesseract)
- Twilio WhatsApp integration
SIHPS25152_FINAL/
โ
โโโ frontend/ # Next.js 14 Frontend (Port 3000)
โ โโโ app/ # App Router pages
โ โ โโโ dashboard/ # Main dashboard with charts
โ โ โโโ beneficiary/ # Beneficiary management
โ โ โโโ funds/ # FTO and fund tracking
โ โ โโโ projects/ # Project milestone tracking
โ โ โโโ proposals/ # Proposal workflow
โ โ โโโ reports/ # Report generation
โ โ โโโ sna/ # State Nodal Agency view
โ โ โโโ pacc/ # PACC approval interface
โ โ โโโ login/ # Authentication
โ โ โโโ signup/ # User registration
โ โโโ components/ # 36 reusable UI components
โ โ โโโ chatbot.tsx # AI assistant (28KB)
โ โ โโโ sidebar.tsx # Navigation (23KB)
โ โ โโโ india-map-heatmap.tsx # State visualization
โ โ โโโ ...
โ โโโ lib/ # Utilities and helpers
โ โโโ public/ # Static assets
โ
โโโ backend/ # Main Backend (Port 1604)
โ โโโ src/
โ โ โโโ controllers/ # 7 request handlers
โ โ โโโ models/ # 10 MongoDB schemas
โ โ โ โโโ beneficiary.model.js
โ โ โ โโโ proposal.model.js
โ โ โ โโโ project.model.js
โ โ โ โโโ ngo.model.js
โ โ โ โโโ ...
โ โ โโโ routes/ # 6 API route files
โ โ โโโ middlewares/ # Auth & validation
โ โโโ main.py # FastAPI Translation Server (Port 8000)
โ โโโ requirements.txt # Python dependencies
โ
โโโ app-backend/ # Secondary MERN Backend
โ โโโ src/ # Controllers, models, routes
โ
โโโ blockchain/ # Hyperledger Fabric (Port 3002)
โ โโโ backend/ # Node.js blockchain gateway
โ โโโ backend-spring/ # Spring Boot API (Java 17)
โ โโโ blockchain/ # Chaincode & network config
โ โ โโโ organizations/ # Org certificates
โ โ โโโ docker/ # Docker compose files
โ โโโ API_REFERENCE.md # Complete API docs (20 endpoints)
โ โโโ commands.sh # Setup scripts
โ
โโโ AI_Model/ # Machine Learning Models
โ โโโ Individual Beneficiary Ranking Model/
โ โ โโโ 1_synthesize_data.py # Generate training data
โ โ โโโ 2_train_model.py # Train XGBoost model
โ โ โโโ 3_test_model.py # Model testing
โ โ โโโ 6_app.py # Flask API (Port 5000)
โ โ โโโ synthetic_beneficiaries.csv # 1.7MB training data
โ โ โโโ trained_model.json # Trained XGBoost model
โ โ
โ โโโ Question Clustering/
โ โ โโโ app.py # Clustering API
โ โ โโโ clusters.py # K-means implementation
โ โ โโโ pm_ajay_final_simulated_data.csv
โ โ
โ โโโ State Plan Analysis RAG/
โ โโโ main.py # RAG entry point
โ โโโ rag_system.py # LangChain RAG implementation
โ โโโ analysis agent.py # Document analysis
โ โโโ tools.py # Utility functions
โ
โโโ WHATSAPP/ # WhatsApp Khata Bot (Port 3000)
โ โโโ src/
โ โ โโโ controllers/ # Message handlers
โ โ โโโ models/ # User & Khata schemas
โ โ โโโ services/ # Business logic
โ โโโ config/ # Twilio configuration
โ โโโ eng.traineddata # English OCR (5.2MB)
โ โโโ hin.traineddata # Hindi OCR (1.6MB)
โ
โโโ pmajay-chatbot/ # Additional Chatbot Service
โ โโโ chatbot_backend/
โ โโโ chroma_db/ # Vector database for RAG
โ
โโโ .gitignore # Excludes venv, node_modules, large files
โโโ README.md # This file
| File | Location | Size | Description |
|---|---|---|---|
synthetic_beneficiaries.csv |
AI_Model/Individual Beneficiary Ranking Model/ |
1.7 MB | 10,000+ synthetic beneficiary records for training |
location dataset.csv |
AI_Model/Individual Beneficiary Ranking Model/ |
4 KB | State/district location mappings |
trained_model.json |
AI_Model/Individual Beneficiary Ranking Model/ |
620 KB | Trained XGBoost model weights |
preprocessor.joblib |
AI_Model/Individual Beneficiary Ranking Model/ |
4 KB | Sklearn preprocessing pipeline |
pm_ajay_final_simulated_data.csv |
AI_Model/Question Clustering/ |
100 KB | Simulated grievance/issue data |
processed_issues_uuid.csv |
AI_Model/Question Clustering/ |
45 KB | Processed issues with UUIDs |
input.json |
AI_Model/State Plan Analysis RAG/ |
3.6 KB | Sample state plan input |
input2.json |
AI_Model/State Plan Analysis RAG/ |
5 KB | Additional plan data |
| File | Size | Description |
|---|---|---|
eng.traineddata |
5.2 MB | Tesseract English OCR model |
hin.traineddata |
1.6 MB | Tesseract Hindi OCR model |
| Tool | Version | Purpose |
|---|---|---|
| Node.js | v18+ | Backend & Frontend |
| Python | 3.9+ | AI Models & Translation API |
| MongoDB | 6.0+ | Database |
| Docker | 24.0+ | Blockchain network |
| Java | 17+ | Spring Boot blockchain API |
| pnpm or npm | Latest | Package management |
node --version # Should be v18+
python --version # Should be 3.9+
mongod --version # Should be 6.0+
docker --version # Should be 24.0+
java --version # Should be 17+Open 4 terminal windows and run each command in sequence:
# Windows
mongod
# macOS/Linux
sudo mongod --dbpath /data/dbcd backend
npm install
npm run devโ Expected output:
Server is running on http://localhost:1604
cd backend
pip install -r requirements.txt
python main.pyโ Expected output:
Uvicorn running on http://0.0.0.0:8000
cd frontend
npm install # or pnpm install
npm run dev # or pnpm devโ Expected output:
Ready on http://localhost:3000
Open your browser and go to: http://localhost:3000
mongodcd backend
npm install
npm run dev
# Runs on http://localhost:1604cd backend
pip install -r requirements.txt
python main.py
# Runs on http://localhost:8000cd frontend
npm install
npm run dev
# Runs on http://localhost:3000Option A: Spring Boot (Recommended)
cd blockchain/backend-spring
./mvnw spring-boot:run # Linux/macOS
mvnw.cmd spring-boot:run # Windows
# Runs on http://localhost:3002Option B: Node.js
cd blockchain/backend
npm install
npm start
# Runs on http://localhost:3002cd WHATSAPP
npm install
npm run dev
# Runs on http://localhost:3000 (use different port if frontend is running)
โ ๏ธ Note: For WhatsApp bot to work, you need ngrok and Twilio credentials configured.
Beneficiary Ranking API (Port 5000):
cd "AI_Model/Individual Beneficiary Ranking Model"
pip install flask pandas xgboost scikit-learn joblib
python 6_app.pyQuestion Clustering:
cd "AI_Model/Question Clustering"
pip install flask pandas scikit-learn
python app.pyState Plan RAG:
cd "AI_Model/State Plan Analysis RAG"
pip install langchain chromadb openai
python main.py# docker-compose.yml will be added for one-command startup
docker-compose up -dCreate .env files in each directory:
NEXT_PUBLIC_API_URL=http://localhost:1604
NEXT_PUBLIC_TRANSLATION_API=http://localhost:8000
NEXT_PUBLIC_BLOCKCHAIN_API=http://localhost:3002PORT=1604
MONGODB_URI=mongodb://localhost:27017/pmajay
CORS_ORIGIN=http://localhost:3000
JWT_SECRET=your_super_secret_jwt_key_hereTWILIO_ACCOUNT_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_token
TWILIO_WHATSAPP_NUMBER=whatsapp:+14155238886
MONGODB_URI=mongodb://localhost:27017/whatsapp_khata
PORT=3001server.port=3002| Service | Port | Base URL | Health Check |
|---|---|---|---|
| Frontend | 3000 | http://localhost:3000 | Browser |
| Main Backend | 1604 | http://localhost:1604/api | /api/health |
| Translation API | 8000 | http://localhost:8000 | /health |
| Blockchain API | 3002 | http://localhost:3002 | /health |
POST /api/users/register - Register new user
POST /api/users/login - User authentication
GET /api/proposals - Get all proposals
POST /api/proposals - Create new proposal
GET /api/projects - Get all projects
POST /api/projects - Create new project
GET /api/central - Get central dashboard data
POST /api/uc/upload - Upload utilization certificate
GET /api/health - Health check
POST /translate - Translate text between languages
GET /languages - Get supported languages list
GET /health - Health check
See blockchain/API_REFERENCE.md for complete documentation of 20 endpoints.
After starting all services, run these commands to verify:
# Check main backend
curl http://localhost:1604/api/health
# Expected: {"status":"ok","message":"Backend is running","port":"1604"}
# Check translation API
curl http://localhost:8000/health
# Expected: {"status":"healthy","provider":"Google Translate"}
# Check blockchain API
curl http://localhost:3002/health
# Expected: {"status":"UP"}
# Test translation
curl -X POST http://localhost:8000/translate \
-H "Content-Type: application/json" \
-d '{"text":"Hello, how are you?","source_lang":"en","target_lang":"hi"}'| Issue | Solution |
|---|---|
EADDRINUSE: address already in use |
Kill process on that port: npx kill-port 3000 |
MongoDB connection failed |
Ensure MongoDB is running: mongod |
Module not found |
Run npm install or pip install -r requirements.txt |
CORS error |
Check CORS_ORIGIN in backend .env matches frontend URL |
Port 3000 conflict (WhatsApp vs Frontend) |
Change WhatsApp port to 3001 in its .env |
# Kill process on port
netstat -ano | findstr :3000
taskkill /PID <PID> /F
# Run Python scripts
python main.py # Not python3# Kill process on port
lsof -ti:3000 | xargs kill -9
# Run Python scripts
python3 main.py| Role | Permissions |
|---|---|
| Ministry | Full access, fund release approval, audit oversight |
| PACC | Proposal approval, blueprint review |
| State | State-level project implementation, UC submission |
| SNA | Fund tracking, bank account management |
| IA (Implementing Agency) | Evidence upload, milestone updates |
| SAU (State Audit Unit) | Audit reports, corrective actions |
| Beneficiary | View benefits, raise issues via WhatsApp |
ISC License
Built for Smart India Hackathon 2025 to digitize and streamline the PM-AJAY scheme for efficient welfare fund distribution to Scheduled Caste beneficiaries.
Problem Statement ID: SIH PS 25152
- GitHub: https://github.com/codewithabhay10/SIH-Project-Sahay
- Smart India Hackathon: https://www.sih.gov.in/
Made with โค๏ธ for Digital India ๐ฎ๐ณ