How ramkalyan10/smartmerchantappplication works
Smart Merchant is a merchant operations and business-intelligence platform: staff manage sales, products, inventory, customers, suppliers, and expenses, then use analytics and forecasts to guide decisions. The documented runtime is a React frontend, Express business API, database, and separate FastAPI ML service. The graph preserves the major operational and prediction stages; several page and controller implementations are unsampled, so their internal calls are not inferred.
Main entry points: App.jsx App and navigation · app.js Express API router · db.js Database adapter · api.js REST client
Components 24
Merchant interface
- App and navigation
frontend/src/App.jsx - Sign-in state
frontend/src/context/AuthContext.jsx - Invoices and POS
frontend/src/pages/InvoicesPage.jsx - Products and inventory
frontend/src/pages/ProductsInventoryPage.jsx - Business operations
frontend/src/pages/CustomersPage.jsx - Analytics and forecasts
frontend/src/pages/ForecastingPage.jsx - REST client
frontend/src/services/api.js
Business API
- Express API router
backend/src/app.js - Authentication routes
backend/src/routes/auth.routes.js - Product routes
backend/src/routes/product.routes.js - Inventory routes
backend/src/routes/inventory.routes.js - Other domain routes
backend/src/routes - Authentication
backend/src/controllers/authController.js - Product catalog
backend/src/controllers/productController.js - Stock and purchasing
backend/src/controllers/inventoryController.js - Sales and business domains
backend/src/controllers - Authentication and roles
backend/src/middleware/authMiddleware.js - ML service client
backend/src/services/mlClient.js
Business data
- Database adapter
backend/src/config/db.js - PostgreSQL client
backend/src/config/pgClient.js
ML intelligence
- Prediction API
ml-service/api/main.py - Prediction models
ml-service/prediction - Model training
ml-service/training
Other components
- Merchant or staff
Connections 30
- Merchant or staff → App and navigation: uses
frontend/src/App.jsx - App and navigation → Invoices and POS: routes to
frontend/src/App.jsx - App and navigation → Products and inventory: routes to
frontend/src/App.jsx - App and navigation → Business operations: routes to
frontend/src/App.jsx - App and navigation → Analytics and forecasts: routes to
frontend/src/App.jsx - App and navigation → Sign-in state: provides context
frontend/src/App.jsx - Sign-in state → REST client: calls
frontend/src/context/AuthContext.jsx - Invoices and POS → REST client: uses
frontend/src/pages/InvoicesPage.jsx - Products and inventory → REST client: uses
frontend/src/pages/ProductsInventoryPage.jsx - REST client → Express API router: REST requests
README.md - Express API router → Authentication routes: mounts
backend/src/app.js - Express API router → Product routes: mounts
backend/src/app.js - Express API router → Inventory routes: mounts
backend/src/app.js - Express API router → Other domain routes: mounts
backend/src/app.js - Authentication routes → Authentication: dispatches
backend/src/routes/auth.routes.js - Product routes → Product catalog: dispatches
backend/src/routes/product.routes.js - Inventory routes → Stock and purchasing: dispatches
backend/src/routes/inventory.routes.js - Other domain routes → Sales and business domains: dispatches
backend/src/routes/analytics.routes.js - Authentication routes → Authentication and roles: applies
backend/src/routes/auth.routes.js - Product routes → Authentication and roles: applies
backend/src/routes/product.routes.js - Inventory routes → Authentication and roles: applies
backend/src/routes/inventory.routes.js - Authentication → Database adapter: reads and writes
backend/src/controllers/authController.js - Product catalog → Database adapter: reads and writes
backend/src/controllers/productController.js - Stock and purchasing → Database adapter: reads and writes
backend/src/controllers/inventoryController.js - Sales and business domains → Database adapter: uses
backend/src/controllers/invoiceController.js - Database adapter → PostgreSQL client: uses when connected
backend/src/config/db.js - Sales and business domains → ML service client: requests forecasts
backend/src/controllers/forecastController.js - ML service client → Prediction API: calls prediction service
README.md - Prediction API → Prediction models: dispatches predictions
ml-service/api/main.py - Model training → Prediction models: trains models
ml-service/prediction/predict_clustering.py