How jerimiahbitancor/demand-forecasting-system works
This is a sales-demand forecasting and supply-planning application for micro food-service businesses. Users upload historical sales and recipe mappings, then review forecasts, product performance, ingredient requirements, inventory information, and alerts in the React interface. The Express API handles uploads and business operations; it delegates machine-learning work to a Flask service whose training and forecasting use XGBoost and persist models in Supabase Storage. The README documents broader analytics, reporting, settings, and notification capabilities. Some backend routes and services are unsampled, so their unverified links are omitted.
Main entry points: server.js HTTP API · App.jsx Application routes · app.py ML HTTP entry · uploadService.js Sales upload processing
Components 28
Web application
- Application routes
frontend/src/App.jsx - Authentication screens
frontend/src/features/auth/pages/login/Login.jsx - Sales data management
frontend/src/features/datamanagement/pages/DataManagement.jsx - Forecast analytics
frontend/src/features/analytics/pages/Analytics.jsx - Inventory management
frontend/src/features/inventory/pages/InventoryManagement.jsx - Business settings
frontend/src/features/settings/pages/Settings.jsx - Notifications
frontend/src/features/components/Notification/NotificationsPage.jsx
Business API
- HTTP API
backend/server.js - Sales upload processing
backend/services/uploadService.js - Recipe mapping
backend/services/mappingService.js - Inventory operations
backend/controllers/inventoryController.js - Alerts and reminders
backend/services/notificationService.js - Product lifecycle
backend/services/productStatusConstants.js
Forecast service
- ML HTTP entry
ml-service/app.py - Sales data loading
ml-service/services/data_loader.py - Open-day zero fill
ml-service/services/zero_fill.py - Feature engineering
ml-service/services/feature_engineering.py - Forecast business logic
ml-service/services/business_logic.py - XGBoost modeling
ml-service/services/model_service.py - Model persistence
ml-service/services/model_storage.py - ML configuration
ml-service/config.py
Persistence and operations
- Supabase data access
backend/config/supabase.js - Audit records
backend/services/auditService.js - Paged row reads
backend/utils/fetchAllRows.js - Recipe unit conversion
backend/utils/recipeUnits.js - Sales adjustments
backend/utils/salesModifiers.js - Structured logging
backend/utils/logger.js
Other components
- Business user
Connections 33
- Business user → Application routes: uses
- Application routes → Authentication screens: routes to
frontend/src/App.jsx - Application routes → Sales data management: routes to
frontend/src/App.jsx - Application routes → Forecast analytics: routes to
frontend/src/App.jsx - Application routes → Inventory management: routes to
frontend/src/App.jsx - Application routes → Business settings: routes to
frontend/src/App.jsx - Application routes → Notifications: routes to
frontend/src/App.jsx - Sales data management → HTTP API: uploads data
- Forecast analytics → HTTP API: requests analytics
- Inventory management → HTTP API: requests operations
- Business settings → HTTP API: updates settings
- Notifications → HTTP API: requests alerts
- HTTP API → Sales upload processing: routes requests
backend/server.js - Sales upload processing → Recipe mapping: uses mappings
backend/services/uploadService.js - Sales upload processing → ML HTTP entry: requests ML
backend/services/uploadService.js - HTTP API → Inventory operations: routes requests
backend/server.js - HTTP API → Alerts and reminders: routes requests
backend/server.js - Sales upload processing → Product lifecycle: updates lifecycle
backend/services/uploadService.js - ML HTTP entry → Sales data loading: loads sales
ml-service/app.py - ML HTTP entry → Feature engineering: builds forecasts
ml-service/app.py - ML HTTP entry → Forecast business logic: runs pipeline
ml-service/app.py - ML HTTP entry → XGBoost modeling: trains or predicts
ml-service/app.py - XGBoost modeling → Feature engineering: engineers features
ml-service/services/model_service.py - XGBoost modeling → Model persistence: loads models
ml-service/services/model_service.py - Feature engineering → Open-day zero fill: builds open days
ml-service/services/feature_engineering.py - ML HTTP entry → Model persistence: loads model
ml-service/app.py - Inventory operations → Supabase data access: reads and writes
backend/controllers/inventoryController.js - Inventory operations → Audit records: records actions
backend/controllers/inventoryController.js - Inventory operations → Recipe unit conversion: converts quantities
backend/controllers/inventoryController.js - Recipe mapping → Recipe unit conversion: converts recipe units
backend/services/mappingService.js - Sales upload processing → Sales adjustments: adjusts sales
backend/services/uploadService.js - Alerts and reminders → Supabase data access: reads and writes
backend/services/notificationService.js - ML HTTP entry → ML configuration: uses settings
ml-service/app.py