How avani-maurya/janmitra works
JanMitra is a citizen-assistance platform for government-scheme discovery, civic reporting, chat, and voice assistance. A citizen enters through the routed frontend pages; the documented capabilities are represented there, while the sampled backend shows concrete recommendation and chat API flows. Recommendation requests are validated and evaluated against stored schemes and eligibility rules; chat requests are handled by a service that manages conversation context and scheme matching. The frontend-to-backend links and voice/chat integration are not shown in the excerpts, so those relationships are dashed. The civic-report backend implementation is not evident in the sampled tree.
Main entry points: App.jsx Page router · recommendation_service.py Scheme recommender · chatbot_routes.py Chat and NLP API · chatbot_service.py Chat orchestration
Components 24
Citizen interface
- Page router
frontend/src/App.jsx - Home
frontend/src/pages/Home.jsx - Login
frontend/src/pages/Login.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - Scheme browser
frontend/src/pages/Schemes.jsx - Scheme details
frontend/src/pages/SchemeDetails.jsx - Chat assistant
frontend/src/pages/Assistant.jsx - Voice assistant
frontend/src/pages/VoiceAssistant.jsx - Civic reporting
frontend/src/pages/CivicReport.jsx - Navigation
frontend/src/components/Navbar.jsx
Backend API
- FastAPI app
backend/app/main.py - Recommendation API
backend/app/routes/recommendation_routes.py - Chat and NLP API
backend/app/routes/chatbot_routes.py
Domain services
- Scheme recommender
backend/app/services/recommendation_service.py - Eligibility evaluator
backend/app/services/eligibility_service.py - Citizen profile
backend/app/models/user.py - Eligibility rule
backend/app/models/eligibility_rule.py - Chat orchestration
backend/app/services/chatbot_service.py
Persistence
- Scheme repository
backend/app/database/scheme_repository.py - Rule repository
backend/app/database/rule_repository.py - Mongo connection
backend/app/database/connection.py
Other components
- Citizen
- MongoDB
- Gemini service
Connections 29
- Citizen → Page router: opens
frontend/src/App.jsx - Page router → Home: routes to
frontend/src/App.jsx - Page router → Login: routes to
frontend/src/App.jsx - Page router → Dashboard: routes to
frontend/src/App.jsx - Page router → Scheme browser: routes to
frontend/src/App.jsx - Page router → Scheme details: routes to
frontend/src/App.jsx - Page router → Chat assistant: routes to
frontend/src/App.jsx - Page router → Voice assistant: routes to
frontend/src/App.jsx - Page router → Civic reporting: routes to
frontend/src/App.jsx - Chat assistant → Chat and NLP API: sends chat
- Voice assistant → Chat and NLP API: submits transcript
- Scheme browser → Recommendation API: requests matches
- Civic reporting → Chat and NLP API: may analyze text
- FastAPI app → Recommendation API: mounts
backend/app/main.py - FastAPI app → Chat and NLP API: mounts
backend/app/main.py - FastAPI app → Scheme repository: configures scheme loader
backend/app/main.py - Recommendation API → Scheme recommender: calls
backend/app/routes/recommendation_routes.py - Recommendation API → Citizen profile: validates input
backend/app/routes/recommendation_routes.py - Scheme recommender → Scheme repository: loads schemes
backend/app/services/recommendation_service.py - Scheme recommender → Rule repository: loads rules
backend/app/services/recommendation_service.py - Scheme recommender → Eligibility evaluator: evaluates rules
backend/app/services/recommendation_service.py - Scheme recommender → Eligibility rule: parses rule
backend/app/services/recommendation_service.py - Eligibility evaluator → Citizen profile: reads profile
backend/app/services/eligibility_service.py - Chat and NLP API → Chat orchestration: dispatches
backend/app/routes/chatbot_routes.py - Chat orchestration → Scheme repository: loads scheme context
backend/app/main.py - Scheme repository → Mongo connection: uses connection
backend/app/database/scheme_repository.py - Mongo connection → MongoDB: connects
backend/app/database/connection.py - Chat orchestration → MongoDB: stores conversations
- Chat orchestration → Gemini service: optionally generates replies