How vkarankuma/eco_voice works
EcoVoice is a multilingual, voice-first household waste guidance app. Users speak or type a waste question, receive classification and disposal advice, and can explore collection centres, record activity, view rewards, and manage profile and privacy settings. The frontend handles voice input/output and feature views; its API client calls FastAPI, which delegates classification to the AI engine and curated knowledge base. Centre discovery also uses external mapping data. Backend implementation excerpts are partial; the documented activity, rewards, and profile capabilities are represented without assuming an unshown persistence layer.
Main entry points: App.tsx App shell · VoiceHome.tsx Voice assistant view · client.ts API client · CollectionLocator.tsx Centre locator
Components 17
Frontend experience
- App shell
frontend/src/App.tsx - Voice assistant view
frontend/src/components/VoiceHome.tsx - Speech controls
frontend/src/hooks/useVoiceAssistant.ts - Waste guidance card
frontend/src/components/WasteResultCard.tsx - API client
frontend/src/api/client.ts - Centre locator
frontend/src/components/CollectionLocator.tsx - Demo centres
frontend/src/data/demoCentres.ts
Guidance backend
- FastAPI endpoints
backend/main.py - Waste query engine
backend/ai_engine.py - Verified waste rules
backend/knowledge_base.py
Household engagement
- Activity dashboard
frontend/src/components/ActivityDashboard.tsx - Rewards leaderboard
frontend/src/components/RewardsLeaderboard.tsx - Profile settings
frontend/src/components/ProfileSettings.tsx
External services
- Browser speech APIs
- Google Gemini
- OpenStreetMap services
Other components
- Household user
Connections 19
- Household user → App shell: uses
README.md - App shell → Voice assistant view: shows
frontend/src/App.tsx - Voice assistant view → Speech controls: controls
frontend/src/components/VoiceHome.tsx - Speech controls → Browser speech APIs: uses speech
frontend/src/hooks/useVoiceAssistant.ts - Voice assistant view → API client: submits query
frontend/src/components/VoiceHome.tsx - API client → FastAPI endpoints: HTTP requests
frontend/src/api/client.ts - FastAPI endpoints → Waste query engine: analyzes query
backend/main.py - Waste query engine → Verified waste rules: matches rules
backend/ai_engine.py - Waste query engine → Google Gemini: generates response
backend/ai_engine.py - Voice assistant view → Waste guidance card: renders result
frontend/src/components/VoiceHome.tsx - App shell → Centre locator: shows
frontend/src/App.tsx - Centre locator → API client: searches centres
frontend/src/components/CollectionLocator.tsx - Centre locator → Demo centres: uses fallback
frontend/src/components/CollectionLocator.tsx - FastAPI endpoints → OpenStreetMap services: geocodes and searches
backend/main.py - App shell → Activity dashboard: shows summary
frontend/src/App.tsx - App shell → Rewards leaderboard: shows rewards
frontend/src/App.tsx - App shell → Profile settings: shows settings
frontend/src/App.tsx - App shell → API client: loads and logs
frontend/src/App.tsx - Profile settings → App shell: saves or deletes
frontend/src/components/ProfileSettings.tsx