How shettyprasad-git/smart-sales-forecasting-system works
Smart Sales Forecasting is a full-stack sales analytics and demand-forecasting platform. Users authenticate, manage datasets and sales, then view forecasts, anomaly investigations, recommendations, and what-if simulations through a React workspace backed by FastAPI and ML artifacts. Anomaly handling has distinct detection, investigation, deterministic explanation, and AI-reasoning stages; dataset runtime and model storage support the analytical features. The graph preserves README-documented capabilities, but many API and service implementations were not excerpted, so uncertain links are dashed and marked without evidence.
Main entry points: api Product API routes · investigation_service.py Root-cause investigation · simulation_service.py What-if simulation · dataset_runtime_service.py Dataset runtime
Components 22
User workspace
- React workspace
frontend/src/App.jsx - Analytics pages
frontend/src/pages - API client
frontend/src/api
Application API
- FastAPI application
backend/app/main.py - Product API routes
backend/app/api - Authentication
backend/app/api/auth.py
Sales intelligence
- Anomaly detection
backend/app/services/anomaly_service.py - Root-cause investigation
backend/app/services/investigation_service.py - Executive explanation
backend/app/services/explanation_service.py - AI reasoning
backend/app/services/ai_reasoning_service.py - Recommendations
backend/app/services/recommendation_service.py - What-if simulation
backend/app/services/simulation_service.py - Gemini provider
backend/app/llm/gemini_provider.py
Forecasting ML
- Forecast service
ml/inference/forecast_service.py - Feature engineering
ml/features/feature_pipeline.py - Model training
ml/training/company_trainer.py - Model evaluation
ml/evaluation/evaluate_production_models.py
Data and infrastructure
- Dataset runtime
backend/app/services/dataset_runtime_service.py - Sales and products
backend/app/database/models.py - Model artifact storage
backend/app/services/storage_service.py
Other components
- Business user
- Google Gemini
Connections 28
- Business user → React workspace: uses
frontend/src/App.jsx - React workspace → Analytics pages: routes to
frontend/src/App.jsx - Analytics pages → API client: requests data
frontend/src/pages/Datasets.jsx - API client → FastAPI application: calls REST API
README.md - FastAPI application → Product API routes: registers routes
backend/app/main.py - Product API routes → Authentication: routes auth
backend/app/main.py - Authentication → Sales and products: reads and writes users
backend/app/api/auth.py - Product API routes → Dataset runtime: dispatches dataset operations
backend/app/api/ai_reasoning.py - Dataset runtime → Sales and products: persists dataset records
backend/app/services/dataset_runtime_service.py - Dataset runtime → Model artifact storage: uses model storage
backend/app/services/dataset_runtime_service.py - Dataset runtime → Forecast service: requests forecasts
- Model training → Feature engineering: builds features
ml/training/company_trainer.py - Model training → Model evaluation: evaluates models
- Forecast service → Feature engineering: builds features
ml/inference/forecast_service.py - Product API routes → Anomaly detection: dispatches detection
- Root-cause investigation → Anomaly detection: uses detections
backend/app/services/investigation_service.py - Product API routes → Root-cause investigation: dispatches investigations
- Product API routes → Executive explanation: dispatches explanations
- AI reasoning → Root-cause investigation: uses evidence
backend/app/services/ai_reasoning_service.py - AI reasoning → Executive explanation: uses narrative
backend/app/services/ai_reasoning_service.py - AI reasoning → Gemini provider: requests reasoning
backend/app/services/ai_reasoning_service.py - Gemini provider → Google Gemini: generates analysis
README.md - Product API routes → Recommendations: dispatches recommendations
- Recommendations → Root-cause investigation: uses evidence
backend/app/services/recommendation_service.py - Product API routes → What-if simulation: dispatches simulations
- What-if simulation → Forecast service: uses forecasts
backend/app/services/simulation_service.py - What-if simulation → Root-cause investigation: uses evidence
backend/app/services/simulation_service.py - What-if simulation → Gemini provider: requests explanation
backend/app/services/simulation_service.py