"Bridging Citizens to Government Services" Developed by Rahul Jha | Made in India ๐ฎ๐ณ
| Feature | Technology |
|---|---|
| ๐ค AI Chat (RAG) | Gemini API + ChromaDB + Sentence-BERT |
| ๐ณ๏ธ 10+ Government Services | Voter ID, PAN, Passport, Certificates |
| ๐๏ธ 100+ Government Schemes | Central + State, Eligibility Scoring |
| ๐ Document OCR | Tesseract (EN+HI+MR), Field Extraction |
| ๐ Multilingual | English, Hindi, Marathi |
| ๐ค Voice Input/Output | Web Speech API |
| ๐ Auth | JWT + bcrypt + RBAC |
| ๐ Admin Panel | Analytics, User & Scheme Management |
| ๐ฅ PDF Reports | ReportLab โ Professional PDFs |
| ๐ณ Deployment | Docker Compose + Nginx |
sevasetu-ai/
โโโ frontend/ # React.js Frontend
โ โโโ src/
โ โ โโโ App.jsx # Root app + auth context + routing
โ โ โโโ App.css # Global design system CSS
โ โ โโโ pages/
โ โ โ โโโ SplashScreen.jsx # 3D animated intro screen
โ โ โ โโโ LoginPage.jsx # JWT login
โ โ โ โโโ RegisterPage.jsx # User registration
โ โ โ โโโ Dashboard.jsx # User dashboard with stats
โ โ โ โโโ ChatPage.jsx # AI chatbot interface โญ
โ โ โ โโโ SchemesPage.jsx # Scheme browser + eligibility
โ โ โ โโโ DocumentsPage.jsx# Document upload + OCR + checklist
โ โ โ โโโ HistoryPage.jsx # Query history
โ โ โ โโโ ReportsPage.jsx # PDF report generation
โ โ โ โโโ AdminPage.jsx # Admin panel
โ โ โ โโโ ProfilePage.jsx # User profile settings
โ โ โโโ components/
โ โ โ โโโ MainLayout.jsx # Sidebar + topnav layout
โ โ โ โโโ LoadingSpinner.jsx
โ โ โ โโโ ...
โ โ โโโ services/
โ โ โโโ api.js # Axios API client (all endpoints)
โ โโโ public/
โ โโโ package.json
โ โโโ Dockerfile
โ
โโโ backend/ # Python FastAPI Backend
โ โโโ app/
โ โ โโโ main.py # FastAPI app entry point โญ
โ โ โโโ core/
โ โ โ โโโ config.py # Pydantic settings
โ โ โ โโโ auth.py # JWT + bcrypt + RBAC
โ โ โ โโโ database.py # Async SQLAlchemy + MySQL
โ โ โ โโโ logging_config.py
โ โ โโโ api/
โ โ โ โโโ auth.py # /auth/* endpoints
โ โ โ โโโ queries.py # /queries/* (RAG pipeline) โญ
โ โ โ โโโ schemes.py # /schemes/* CRUD + eligibility
โ โ โ โโโ documents.py # /documents/* upload + OCR
โ โ โ โโโ reports.py # /reports/* PDF generation
โ โ โ โโโ admin.py # /admin/* analytics
โ โ โ โโโ users.py # /users/* profile
โ โ โ โโโ __init__.py
โ โ โโโ models/
โ โ โโโ user.py # All SQLAlchemy models
โ โโโ requirements.txt
โ โโโ Dockerfile
โ
โโโ ai/ # AI/ML Modules
โ โโโ rag/
โ โ โโโ rag_engine.py # RAG pipeline (ChromaDB + Gemini) โญ
โ โโโ ocr/
โ โ โโโ ocr_engine.py # Tesseract OCR + field extraction โญ
โ โโโ embeddings/
โ โโโ embedding_service.py
โ
โโโ database/
โ โโโ schema.sql # MySQL schema + seed data โญ
โ
โโโ docs/
โ โโโ PROJECT_DOCUMENTATION.md # Complete SRS, Literature Survey, Viva QA โญ
โ
โโโ docker/
โ โโโ docker-compose.yml # Full stack deployment โญ
โ โโโ nginx/
โ โโโ nginx.conf
โ
โโโ README.md # This file
- Python 3.11+
- Node.js 18+
- MySQL 8.0
- Tesseract OCR (with Hindi+Marathi packs)
- Docker & Docker Compose (for containerized deployment)
git clone https://github.com/rahul-jha/sevasetu-ai.git
cd sevasetu-ai# Backend .env
cp backend/.env.example backend/.env
# Edit backend/.env:
SECRET_KEY=your-super-secret-key-here
DATABASE_URL=mysql+asyncmy://sevasetu:password@localhost:3306/sevasetu_db
GEMINI_API_KEY=your-gemini-api-key-here # Set this only in your backend host environment; never commit the real key # Get from aistudio.google.com
REDIS_URL=redis://localhost:6379
# Frontend .env
echo "REACT_APP_API_URL=http://localhost:8000" > frontend/.envmysql -u root -p < database/schema.sqlcd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Install Tesseract OCR (Ubuntu/Debian)
sudo apt-get install -y tesseract-ocr tesseract-ocr-hin tesseract-ocr-mar
# Start backend
uvicorn app.main:app --reload --port 8000cd frontend
npm install
npm start
# Opens at http://localhost:3000| Service | URL |
|---|---|
| ๐ Frontend | http://localhost:3000 |
| ๐ Backend API | http://localhost:8000 |
| ๐ Swagger Docs | http://localhost:8000/docs |
| ๐ ReDoc | http://localhost:8000/redoc |
Default Admin Login:
- Email:
admin@sevasetu.ai - Password:
Admin@SevaSetu1
# Full stack with Docker Compose
cd docker
cp .env.example .env # Configure your API keys
docker-compose up --build # Development
docker-compose up -d # Production (detached)
# Check logs
docker-compose logs -f backend
docker-compose logs -f frontend
# Stop
docker-compose down# Install EB CLI
pip install awsebcli
# Initialize
eb init sevasetu-ai --region ap-south-1 --platform docker
# Create environment
eb create production --instance_type t3.medium
# Deploy
eb deploy# Build and push images
gcloud builds submit --tag gcr.io/PROJECT_ID/sevasetu-backend ./backend
gcloud builds submit --tag gcr.io/PROJECT_ID/sevasetu-frontend ./frontend
# Deploy backend
gcloud run deploy sevasetu-backend \
--image gcr.io/PROJECT_ID/sevasetu-backend \
--region asia-south1 \
--allow-unauthenticated \
--set-env-vars GEMINI_API_KEY=xxx
# Deploy frontend
gcloud run deploy sevasetu-frontend \
--image gcr.io/PROJECT_ID/sevasetu-frontend \
--region asia-south1 \
--allow-unauthenticated# Register
curl -X POST http://localhost:8000/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"name":"Test","email":"test@example.com","mobile":"9876543210","password":"Test@1234","state":"Maharashtra"}'
# Login
curl -X POST http://localhost:8000/api/v1/auth/login \
-d "username=test@example.com&password=Test@1234"
# Ask AI (RAG)
curl -X POST http://localhost:8000/api/v1/queries/ask \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"question":"How to apply for PAN card?","language":"en"}'
# Check scheme eligibility
curl -X POST http://localhost:8000/api/v1/schemes/eligibility \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"annual_income":200000,"age":35,"gender":"male","is_farmer":true}'
# Upload document for OCR
curl -X POST http://localhost:8000/api/v1/documents/upload \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@aadhaar.jpg" \
-F "service_type=voter_id"cd backend
pytest tests/ -v --asyncio-mode=auto
# With coverage report
pytest tests/ --cov=app --cov-report=html
open htmlcov/index.html- Go to Google AI Studio
- Sign in with your Google account
- Click "Get API Key" โ "Create API Key"
- Copy key into
backend/.envasGEMINI_API_KEY=xxx
Free tier: 15 requests/minute, 1 million tokens/month โ sufficient for development and testing.
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React.js 18, React Router 6 | Single Page Application |
| Styling | CSS Modules, Custom Properties | Design system |
| API Client | Axios + interceptors | HTTP + auth |
| Backend | FastAPI + Uvicorn | REST API |
| Auth | JWT + bcrypt | Authentication + RBAC |
| Database | MySQL 8 + SQLAlchemy async | Relational data |
| Cache | Redis 7 | Sessions + rate limit |
| AI/LLM | Google Gemini 1.5 Flash | Language generation |
| Vector DB | ChromaDB | Semantic search |
| Embeddings | Sentence-BERT (MiniLM) | Query embedding |
| OCR | Tesseract 5 + OpenCV | Document processing |
| ReportLab | Report generation | |
| Container | Docker + Docker Compose | Deployment |
| Web Server | Nginx | Reverse proxy + SSL |
Rahul Jha
- Final Year AIML Student
- Project: SevaSetu AI โ Government Services Assistant
- Made with โค๏ธ in India ๐ฎ๐ณ
- Contact: rahul@sevasetu.ai
MIT License โ Free to use for educational purposes.
Copyright (c) 2026 Rahul Jha
- Google Gemini team for the powerful LLM API
- ChromaDB team for the vector database
- Hugging Face for Sentence-Transformers
- FastAPI team for the excellent Python web framework
- Government of India for the open scheme data
Jai Hind! ๐ฎ๐ณ โ SevaSetu AI: Bridging 1.4 Billion Citizens to Government Services
This project is configured for Render with render.yaml. Deploy the repository as a Blueprint. It creates a FastAPI Docker Web Service and a React Static Site.
Set these backend secrets in Render: GEMINI_API_KEY, DATABASE_URL, REDIS_URL, SMTP_USER, and SMTP_PASSWORD. The backend also generates a production SECRET_KEY.
The frontend uses REACT_APP_API_URL and must point to the Render FastAPI service root URL (do not append /api/v1).
For Forgot Password, configure Gmail SMTP with a Gmail App Password so the backend can send reset links.
For the complete Render deployment process, see RENDER_DEPLOYMENT.md.