How dhruv-ns/mandi-khata works
Mandi Khata is a voice-first mandi inventory and accounting application. Traders dictate through Wispr Flow or type a command, review a parsed draft, then confirm it; confirmed operations update inventory, party balances, and auditable transaction records. The UI also exposes dashboard, inventory, parties, transactions, reports, and settings. The README describes these capabilities, but unsampled routes and storage schema limit which internal relationships can be verified; omitted links are not assumed.
Main entry points: App.jsx App Shell · api.js REST Client · transactionService.js Transaction Engine · app.js Express API
Components 31
Trader Interface
- App Shell
client/src/App.jsx - Navigation
client/src/layouts/AppLayout.jsx - Voice Assistant
client/src/pages/VoiceAssistantPage.jsx - Voice Workflow
client/src/hooks/useVoiceAssistant.js - Browser Mic
client/src/hooks/useBrowserMic.js - Speech Readback
client/src/hooks/useSpeechReadback.js - Offline Queue
client/src/services/offlineQueue.js - REST Client
client/src/services/api.js - Inventory UI
client/src/pages/InventoryPage.jsx - Party Ledger UI
client/src/pages/PartiesPage.jsx - Transactions UI
client/src/pages/TransactionsPage.jsx - Dashboard UI
client/src/pages/DashboardPage.jsx - Reports UI
client/src/pages/ReportsPage.jsx - Settings UI
client/src/pages/SettingsPage.jsx - Receipt Modal
client/src/components/ReceiptModal.jsx
Command Processing
- Assistant API
server/src/routes/assistantRoutes.js - Command Parser
server/src/parser/commandParser.js - Number Parser
server/src/parser/numberParser.js - Unit Parser
server/src/parser/unitParser.js - Regional Mappings
server/src/parser/regionalMappings.js
Business Operations
- Transaction Engine
server/src/services/transactionService.js - Inventory API
server/src/routes/inventoryRoutes.js - Party API
server/src/routes/partyRoutes.js - Transaction API
server/src/routes/transactionRoutes.js - Dashboard and Reports API
server/src/routes/dashboardRoutes.js - Express API
server/src/app.js
Persistence and Insights
- SQLite Store
server/src/database/db.js - Database Schema
server/src/database/schema.js - Demo Data Seed
server/src/database/seed.js
Other components
- Trader
- Wispr Flow
Connections 43
- Trader → Voice Assistant: enters command
README.md - Wispr Flow → Voice Assistant: dictates text
README.md - App Shell → Navigation: renders
client/src/App.jsx - App Shell → Voice Assistant: renders
client/src/App.jsx - App Shell → Inventory UI: renders
client/src/App.jsx - App Shell → Party Ledger UI: renders
client/src/App.jsx - App Shell → Transactions UI: renders
client/src/App.jsx - App Shell → Dashboard UI: renders
client/src/App.jsx - App Shell → Reports UI: renders
client/src/App.jsx - App Shell → Settings UI: renders
client/src/App.jsx - App Shell → Voice Workflow: creates workflow
client/src/App.jsx - Voice Assistant → Voice Workflow: uses workflow
client/src/App.jsx - Voice Workflow → Browser Mic: uses microphone
client/src/hooks/useVoiceAssistant.js - Voice Workflow → Speech Readback: reads summaries
client/src/hooks/useVoiceAssistant.js - Voice Workflow → Offline Queue: queues offline
client/src/hooks/useVoiceAssistant.js - Voice Workflow → REST Client: submits commands
client/src/hooks/useVoiceAssistant.js - Inventory UI → REST Client: requests inventory
client/src/pages/InventoryPage.jsx - Party Ledger UI → REST Client: requests ledgers
client/src/pages/PartiesPage.jsx - Transactions UI → REST Client: requests transactions
client/src/pages/TransactionsPage.jsx - Dashboard UI → REST Client: requests dashboard
client/src/pages/DashboardPage.jsx - Reports UI → REST Client: requests reports
client/src/pages/ReportsPage.jsx - Settings UI → REST Client: requests settings
client/src/pages/SettingsPage.jsx - REST Client → Express API: sends REST requests
client/src/services/api.js - Express API → Assistant API: routes requests
server/src/app.js - Express API → Dashboard and Reports API: routes requests
server/src/app.js - Express API → Inventory API: routes requests
server/src/app.js - Express API → Party API: routes requests
server/src/app.js - Express API → Transaction API: routes requests
server/src/app.js - Assistant API → Command Parser: parses command
server/src/routes/assistantRoutes.js - Command Parser → Number Parser: normalizes numbers
server/src/parser/commandParser.js - Command Parser → Unit Parser: interprets units
server/src/parser/commandParser.js - Command Parser → Regional Mappings: uses language mappings
server/src/parser/commandParser.js - Assistant API → Transaction Engine: executes business actions
server/src/routes/assistantRoutes.js - Inventory API → Transaction Engine: records wastage
server/src/routes/inventoryRoutes.js - Party API → Transaction Engine: records containers
server/src/routes/partyRoutes.js - Transaction API → Transaction Engine: handles transactions
server/src/routes/transactionRoutes.js - Dashboard and Reports API → Transaction Engine: computes ageing
server/src/routes/dashboardRoutes.js - Transaction Engine → Unit Parser: calculates totals
server/src/services/transactionService.js - Transaction Engine → SQLite Store: reads and writes
server/src/services/transactionService.js - Dashboard and Reports API → SQLite Store: queries reports
server/src/routes/dashboardRoutes.js - SQLite Store → Database Schema: initializes schema
server/src/database/db.js - SQLite Store → Demo Data Seed: loads demo data
server/src/database/db.js - App Shell → Receipt Modal: opens receipt
client/src/App.jsx