How gochalamvinod/marketmind-ai works
MarketMind AI is a merchant-facing mandi price intelligence and inventory ERP. A trader authenticates, then uses the protected dashboard and workspaces to manage products, record inward purchases, review market benchmarks, and respond to alerts; a persistent assistant also accepts natural-language commands. The backend exposes REST routes to controllers, which coordinate MongoDB models, external price feeds, and monitoring. The README documents sales/profit insights and settings as further capabilities. Unsampled page and controller internals are represented at their exact paths; edges are limited to source-index references or explicit README relationships.
Main entry points: server.js REST routes · chatbotController.js Command assistant · Layout.jsx App shell · priceMonitor.js Price monitor
Components 34
Merchant workspace
- Protected app
client/src/App.jsx - Session state
client/src/context/AuthContext.jsx - App shell
client/src/components/layout/Layout.jsx - Floating assistant
client/src/components/chat/FloatingChatbot.jsx - Dashboard
client/src/pages/Dashboard.jsx - Products
client/src/pages/Products.jsx - Purchases
client/src/pages/Purchases.jsx - Market prices
client/src/pages/MarketPrices.jsx - Alerts
client/src/pages/Notifications.jsx - Store settings
client/src/pages/Settings.jsx - API client
client/src/services/api.js
API and domain actions
- REST routes
server/server.js - JWT verification
server/middleware/auth.js - Command assistant
server/controllers/chatbotController.js - Catalog operations
server/controllers/productController.js - Purchase ledger
server/controllers/purchaseController.js - Sales and profit
server/controllers/salesController.js - Dashboard metrics
server/controllers/dashboardController.js - Alert management
server/controllers/alertController.js - Settings management
server/controllers/settingsController.js
Market intelligence
- Price endpoints
server/controllers/marketPriceController.js - Price monitor
server/services/priceMonitor.js - Scheduled polling
server/jobs/priceChecker.js - AGMARKNET feed
server/services/govApiService.js - Gemini service
server/config/gemini.js
ERP records
Other components
- Merchant
Connections 48
- Merchant → Protected app: uses
README.md - Protected app → Session state: provides session
client/src/App.jsx - Protected app → App shell: mounts
client/src/App.jsx - App shell → Floating assistant: renders
client/src/components/layout/Layout.jsx - App shell → Dashboard: hosts
client/src/App.jsx - App shell → Products: hosts
client/src/App.jsx - App shell → Purchases: hosts
client/src/App.jsx - App shell → Market prices: hosts
client/src/App.jsx - App shell → Alerts: hosts
client/src/App.jsx - App shell → Store settings: hosts
client/src/App.jsx - Session state → API client: uses
client/src/context/AuthContext.jsx - Products → API client: requests data
client/src/pages/Products.jsx - Floating assistant → API client: sends commands
- API client → REST routes: calls API
- REST routes → JWT verification: protects endpoints
- REST routes → Catalog operations: dispatches
- REST routes → Command assistant: dispatches
- REST routes → Alert management: dispatches
- REST routes → Price endpoints: dispatches
server/server.js - REST routes → Dashboard metrics: dispatches
server/server.js - REST routes → Purchase ledger: dispatches
- REST routes → Sales and profit: dispatches
- REST routes → Settings management: dispatches
- Catalog operations → Products: reads/writes
server/controllers/productController.js - Catalog operations → Market history: records prices
server/controllers/productController.js - Catalog operations → AGMARKNET feed: fetches benchmarks
server/controllers/productController.js - Command assistant → Products: reads/writes
server/controllers/chatbotController.js - Command assistant → Purchases: creates receipts
server/controllers/chatbotController.js - Command assistant → Sales: reads sales
server/controllers/chatbotController.js - Command assistant → Market history: reads prices
server/controllers/chatbotController.js - Command assistant → Alerts: creates alerts
server/controllers/chatbotController.js - Command assistant → Suppliers: reads suppliers
server/controllers/chatbotController.js - Command assistant → Price monitor: checks prices
server/controllers/chatbotController.js - Command assistant → Gemini service: generates replies
- Purchase ledger → Purchases: records purchases
- Purchase ledger → Products: updates stock
- Sales and profit → Sales: records sales
- Dashboard metrics → Products: summarizes
- Dashboard metrics → Purchases: summarizes
- Dashboard metrics → Sales: summarizes
- Alert management → Alerts: reads/writes
server/controllers/alertController.js - Price endpoints → Market history: reads prices
server/controllers/marketPriceController.js - Price endpoints → Price monitor: triggers checks
server/controllers/marketPriceController.js - Price monitor → Settings: reads preferences
server/services/priceMonitor.js - Price monitor → Products: updates benchmarks
server/services/priceMonitor.js - Price monitor → Market history: stores observations
server/services/priceMonitor.js - Price monitor → Alerts: creates alerts
server/services/priceMonitor.js - Price monitor → AGMARKNET feed: fetches prices
server/services/priceMonitor.js