How raghuvamshi-git/retailsense works
RetailSense AI+ is a retail analytics dashboard with a FastAPI backend. The visible live workflow is a user submitting forecast inputs from the Forecast page: the frontend client sends them to the forecast route, whose service predicts demand and saves the forecast. Inventory decisions follow a similar route-to-service flow and use the decision engine. Other dashboard areas and analytics modules cover pricing, promotions, anomalies, exploration, and modeling; several frontend views use explicitly labeled demo data. The README is empty, and unsampled module connections are omitted where source evidence does not establish them.
Main entry points: App.jsx Dashboard shell · demoData.js Demo datasets · client.js HTTP API client · ForecastPage.jsx Forecast page
Components 34
Dashboard UI
- Dashboard shell
frontend/src/App.jsx - Forecast page
frontend/src/pages/ForecastPage.jsx - Inventory page
frontend/src/pages/InventoryPage.jsx - Overview page
frontend/src/pages/OverviewPage.jsx - Pricing page
frontend/src/pages/PricingPage.jsx - Promotions page
frontend/src/pages/PromotionsPage.jsx - Anomaly page
frontend/src/pages/AnomalyPage.jsx - Data explorer
frontend/src/pages/ExplorerPage.jsx - Navigation sidebar
frontend/src/components/Sidebar.jsx - Top bar
frontend/src/components/Topbar.jsx - KPI cards
frontend/src/components/KpiCard.jsx - Loading and error states
frontend/src/components/States.jsx - Demo datasets
frontend/src/data/demoData.js
API runtime
- HTTP API client
frontend/src/api/client.js - FastAPI application
backend/app/main.py - Forecast route
backend/app/routes/forecast.py - Inventory route
backend/app/routes/inventory.py - Forecast database
backend/app/database/connection.py
Decision services
- Forecast service
backend/app/services/forecast_service.py - Inventory service
backend/app/services/inventory_service.py - Inventory decisions
src/decision_engine/inventory.py - Inventory recommendations
src/decision_engine/recommendations.py
Analytics modules
- Forecast models
src/forecasting/xgboost_model.py - LightGBM model
src/forecasting/lightgbm_model.py - LSTM model
src/forecasting/lstm_model.py - Forecast evaluation
src/forecasting/evaluation.py - Anomaly detection
src/anomaly_detection/detector.py - SHAP explanations
src/explainability/shap_explainer.py - Pricing recommendations
src/pricing/recommendation.py - Promotion recommendations
src/promotion/recommendation.py - Scenario simulation
src/scenario/simulator.py
Data and features
- Data loading
src/preprocessing/data_loader.py - Data validation
src/preprocessing/data_validation.py - Feature engineering
src/features/feature_engineering.py
Connections 31
- Dashboard shell → Navigation sidebar: renders
frontend/src/App.jsx - Dashboard shell → Top bar: renders
frontend/src/App.jsx - Dashboard shell → Overview page: renders
frontend/src/App.jsx - Dashboard shell → Forecast page: renders
frontend/src/App.jsx - Dashboard shell → Inventory page: renders
frontend/src/App.jsx - Dashboard shell → Pricing page: renders
frontend/src/App.jsx - Dashboard shell → Promotions page: renders
frontend/src/App.jsx - Dashboard shell → Anomaly page: renders
frontend/src/App.jsx - Dashboard shell → Data explorer: renders
frontend/src/App.jsx - Overview page → KPI cards: renders
frontend/src/pages/OverviewPage.jsx - Overview page → Demo datasets: reads
frontend/src/pages/OverviewPage.jsx - Forecast page → HTTP API client: submits forecast
frontend/src/pages/ForecastPage.jsx - Forecast page → Loading and error states: renders
frontend/src/pages/ForecastPage.jsx - Forecast page → Demo datasets: reads
frontend/src/pages/ForecastPage.jsx - Inventory page → HTTP API client: submits inventory
frontend/src/pages/InventoryPage.jsx - Inventory page → Loading and error states: renders
frontend/src/pages/InventoryPage.jsx - Inventory page → Demo datasets: reads
frontend/src/pages/InventoryPage.jsx - Pricing page → Demo datasets: reads
frontend/src/pages/PricingPage.jsx - Promotions page → Demo datasets: reads
frontend/src/pages/PromotionsPage.jsx - Anomaly page → Demo datasets: reads
frontend/src/pages/AnomalyPage.jsx - Data explorer → Demo datasets: reads
frontend/src/pages/ExplorerPage.jsx - Top bar → HTTP API client: checks health
frontend/src/components/Topbar.jsx - HTTP API client → Forecast route: POSTs forecast
frontend/src/api/client.js - HTTP API client → Inventory route: POSTs inventory
frontend/src/api/client.js - FastAPI application → Forecast route: registers
backend/app/main.py - FastAPI application → Inventory route: registers
backend/app/main.py - Forecast route → Forecast service: calls
backend/app/routes/forecast.py - Inventory route → Inventory service: calls
backend/app/routes/inventory.py - Forecast service → Forecast database: writes forecast
backend/app/services/forecast_service.py - Inventory service → Inventory decisions: calculates decisions
backend/app/services/inventory_service.py - Inventory service → Inventory recommendations: gets recommendation
backend/app/services/inventory_service.py