How pratiksubedar/schemeprojectgroq works
Yojana Saathi is a multilingual assistant for discovering Indian government schemes. A citizen chooses a language, provides profile details or asks a voice/text question, then browses scheme matches, eligibility outcomes, details, and document checklists. The React frontend maintains session state and calls a FastAPI backend; the backend includes scheme, eligibility, document, and chat APIs, with SQLite-backed scheme and retrieval data. Voice input/output and offline awareness support the user journey. Backend endpoint implementations were not sampled, so connections from API routes into domain services are left unasserted.
Main entry points: App.tsx App routing · router.py Versioned API routes · schemeApi.ts Scheme API client · AssistantChat.tsx Assistant chat
Components 27
Citizen experience
- App routing
src/App.tsx - Discover schemes
src/pages/Home.tsx - Assistant chat
src/pages/AssistantChat.tsx - Profile and eligibility
src/pages/ProfileConfirmation.tsx - Scheme journeys
src/pages - Session state
src/context/AppContext.tsx
Language and voice
- Speech recognition
src/hooks/useSpeechRecognition.ts - Speech synthesis
src/hooks/useSpeechSynthesis.ts - Translations
src/data/translations.ts
Backend API
- Chat API client
src/services/chatApi.ts - Scheme API client
src/services/schemeApi.ts - FastAPI application
backend/app/main.py - Versioned API routes
backend/app/api/router.py - Chat endpoint
backend/app/api/v1/chat.py - Eligibility endpoint
backend/app/api/v1/eligibility.py - Scheme endpoint
backend/app/api/v1/schemes.py - Document endpoint
backend/app/api/v1/documents.py
Scheme intelligence
- Conversation orchestration
backend/app/services/orchestration/orchestrator.py - Eligibility rules
backend/app/services/rule_engine.py - Scheme retrieval
backend/app/services/rag_retriever_service.py - Document checklists
backend/app/services/document_service.py
Persistence and retrieval
- Database initialization
backend/app/db/init_db.py - Scheme data model
backend/app/db/models.py - SQLite sessions
backend/app/db/session.py
Other components
- Citizen
- Browser speech APIs
- SQLite database
Connections 32
- Citizen → App routing: opens
src/App.tsx - App routing → Discover schemes: routes to
src/App.tsx - App routing → Assistant chat: routes to
src/App.tsx - App routing → Profile and eligibility: routes to
src/App.tsx - App routing → Scheme journeys: routes to
src/App.tsx - App routing → Session state: provides state
src/App.tsx - Assistant chat → Chat API client: sends messages
src/pages/AssistantChat.tsx - Assistant chat → Speech recognition: captures speech
src/pages/AssistantChat.tsx - Assistant chat → Speech synthesis: speaks replies
src/pages/AssistantChat.tsx - Discover schemes → Scheme API client: fetches schemes
src/pages/Home.tsx - Scheme journeys → Scheme API client: loads scheme data
src/pages/AssistantChat.tsx - Browser speech APIs → Speech recognition: recognizes speech
- Speech synthesis → Browser speech APIs: uses synthesis
- Chat API client → Chat endpoint: requests chat
- Scheme API client → Scheme endpoint: requests catalog
- Scheme API client → Eligibility endpoint: requests eligibility
- Scheme API client → Document endpoint: requests checklists
- FastAPI application → Versioned API routes: registers routes
backend/app/main.py - Versioned API routes → Chat endpoint: routes to
backend/app/api/router.py - Versioned API routes → Eligibility endpoint: routes to
backend/app/api/router.py - Versioned API routes → Scheme endpoint: routes to
backend/app/api/router.py - Versioned API routes → Document endpoint: routes to
backend/app/api/router.py - Chat endpoint → Conversation orchestration: delegates to
- Eligibility endpoint → Eligibility rules: evaluates rules
- Scheme endpoint → Scheme retrieval: retrieves matches
- Document endpoint → Document checklists: loads checklist
- FastAPI application → Database initialization: initializes database
backend/app/main.py - FastAPI application → Document checklists: cleans sessions
backend/app/main.py - Scheme retrieval → SQLite sessions: queries chunks
backend/app/services/rag_retriever_service.py - Document checklists → Scheme data model: uses records
backend/app/services/document_service.py - Database initialization → Scheme data model: initializes tables
backend/app/db/init_db.py - SQLite sessions → SQLite database: opens sessions
backend/app/db/session.py