SahaYata - AI-Powered Farmer Welfare Scheme Eligibility Assistant
A digital platform helping Indian farmers discover and check eligibility for government welfare schemes using AI. Features include multi-language support (EN/HI), secure authentication, AI-powered scheme recommendations via Google Gemini, WhatsApp integration, and results tracking.
Key Features:
- AI-powered eligibility assessment with personalized recommendations
- Secure registration/login with JWT & bcryptjs encryption
- Real-time WhatsApp notifications via Twilio
- AI Chat assistant for instant query resolution
- Dark/Light theme with responsive design
Frontend:
- React 19, TypeScript, Vite, Tailwind CSS, Motion, Lucide React
Backend:
- Express.js, Node.js, TypeScript, JWT, bcryptjs
Database:
- Better SQLite3
AI/ML:
- Google Gemini 3.1 Pro (via GenAI SDK)
APIs & Cloud:
- Twilio API (WhatsApp integration)
- Google Gemini API
- Vite SSR deployment capability
User Interface (React + Vite)
↓
Express.js Backend (Auth, Routes, APIs)
↓
AI Service Layer (Google Gemini Integration)
↓
Data Persistence (SQLite3 Database)
↓
External Services (Twilio WhatsApp, Gemini API)
Flow:
- User registers with Aadhaar credentials
- Submits eligibility form (farm details, income, etc.)
- Backend processes & sends to Google Gemini AI
- AI returns personalized scheme recommendations
- Results stored in SQLite database
- User receives WhatsApp notifications if enabled
- AI Chat available for additional queries
SQLite3 (Better SQLite3) - Lightweight, zero-config, perfect for single-server deployment
Tables:
users table:
- id, aadhaar (UNIQUE), name, phone, age, state, district
- farm_size, annual_income, primary_crop, occupation, category, gender
- password (hashed), whatsapp_enabled
eligibility_results table:
- id, user_id, aadhaar, name, phone, age, state, district
- farm_size, language, created_at
- Google Gemini API - AI-powered scheme recommendations & NLP
- Twilio Communications API - WhatsApp messaging for notifications
- Lucide React Icons - UI icon library
# Install dependencies
npm install
# Set environment variables in .env.local
GEMINI_API_KEY=your_key
TWILIO_ACCOUNT_SID=your_sid
TWILIO_AUTH_TOKEN=your_token
TWILIO_WHATSAPP_NUMBER=your_number
# Run development server
npm run dev # http://localhost:5173
# Build for production
npm run build
# Preview production build
npm run preview✅ Multi-Language Support (EN/HI)
✅ AI-Powered Scheme Recommendations
✅ Secure JWT Authentication
✅ WhatsApp Integration
✅ Responsive Design
✅ Dark/Light Theme
✅ Real-time AI Chat
✅ Results History Tracking
Production: react@19.0.0, express@4.21.2, @google/genai@1.29.0, twilio@5.12.2, better-sqlite3@12.4.1, tailwindcss@4.1.14, bcryptjs@3.0.3, jsonwebtoken@9.0.3
Dev: typescript@5.8.2, vite@6.2.0, tsx@4.21.0
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/schemes/check-eligibility- Get recommendationsGET /api/results/:userId- Fetch assessment historyPOST /api/user/whatsapp/subscribe- Enable notifications
- Password hashing (bcryptjs)
- JWT authentication
- Environment variable protection
- SQL injection prevention
Made with ❤️ for Indian Farmers