How jdr-codes/ai-demand-forecasting works
This is a demand-forecasting and inventory-optimization application: users configure data sources, synchronize and process data, train or run forecasts, then use recommendations, scenarios, inventory views, alerts, and reports. The FastAPI application is the runtime entry point; the sampled admin frontend exposes authentication screens, while the tree indicates the broader product surface is primarily in backend routes and services. Edges reflect explicit imports, calls, or route registration in the excerpts and SOURCE INDEX; unsampled route implementations are represented by their directories, with uncertain links omitted.
Main entry points: data_source_service.py Data-source integration · session.py Application database · processing_job_service.py Data processing · simulation_engine.py Scenario simulation
Components 23
Application entry
- Admin interface
Frontend/admin/src/App.jsx - FastAPI application
Backend/fastapi_app/main.py
Access and identity
- Login and OTP
Frontend/admin/src/pages/Authentication/Login.jsx - Authentication routes
Backend/fastapi_app/routes/auth_router.py - Authentication service
Backend/fastapi_app/services/auth/auth_service.py - Application database
Backend/fastapi_app/db/session.py
Data operations
- Data-source integration
Backend/fastapi_app/services/data_integration/data_source_service.py - Source connectors
Backend/fastapi_app/services/connectors - Scheduler
Backend/fastapi_app/services/scheduler/scheduler_service.py - Data processing
Backend/fastapi_app/services/data_processing/processing_job_service.py - Data validation
Backend/fastapi_app/services/validation/validation_service.py - Background task dispatch
Backend/fastapi_app/services/background/task_manager.py
Forecast and planning
- Forecast execution
Backend/fastapi_app/services/forecast/forecast_execution_service.py - Forecast routes
Backend/fastapi_app/routes/forecast_engine.py - Model training
Backend/fastapi_app/services/forecast/training_service.py - Recommendations
Backend/fastapi_app/services/recommendation/recommendation_generator_service.py - Scenario simulation
Backend/fastapi_app/services/scenario/simulation_engine.py
Operations and insight
- Inventory optimization
Backend/fastapi_app/services/inventory - Dashboard services
Backend/fastapi_app/services/dashboard/dashboard_service.py - Alerts and notifications
Backend/fastapi_app/services/notifications/notification_service.py - Reports
Backend/fastapi_app/services/report/report_service.py - Live updates
Backend/fastapi_app/services/websocket/websocket_manager.py
Other components
- User or operator
Connections 28
- User or operator → Admin interface: uses
Frontend/admin/src/App.jsx - Admin interface → Login and OTP: routes to
Frontend/admin/src/App.jsx - User or operator → FastAPI application: requests
- FastAPI application → Authentication routes: registers
Backend/fastapi_app/main.py - FastAPI application → Forecast routes: registers
Backend/fastapi_app/main.py - Login and OTP → Authentication routes: authenticates
- Authentication routes → Authentication service: calls
Backend/fastapi_app/routes/auth_router.py - Authentication service → Application database: reads and writes
Backend/fastapi_app/services/auth/auth_service.py - Data-source integration → Source connectors: uses
Backend/fastapi_app/services/data_integration/data_source_service.py - Data-source integration → Data validation: validates through
Backend/fastapi_app/services/data_integration/data_source_service.py - Data-source integration → Scheduler: configures
Backend/fastapi_app/services/data_integration/data_source_service.py - Scheduler → Data-source integration: starts sync
Backend/fastapi_app/services/scheduler/scheduler_service.py - Scheduler → Background task dispatch: dispatches jobs
Backend/fastapi_app/services/scheduler/scheduler_service.py - Data processing → Data validation: validates data
Backend/fastapi_app/services/data_processing/processing_job_service.py - Data processing → Live updates: sends progress
Backend/fastapi_app/services/data_processing/processing_job_service.py - Forecast routes → Background task dispatch: dispatches forecast
Backend/fastapi_app/routes/forecast_engine.py - Forecast routes → Application database: queries model
Backend/fastapi_app/routes/forecast_engine.py - Background task dispatch → Forecast execution: runs job
- Model training → Application database: persists training
- Scenario simulation → Forecast execution: runs forecast
Backend/fastapi_app/services/scenario/simulation_engine.py - Scenario simulation → Recommendations: generates recommendations
Backend/fastapi_app/services/scenario/simulation_engine.py - Scenario simulation → Live updates: broadcasts progress
Backend/fastapi_app/services/scenario/simulation_engine.py - Recommendations → Application database: stores results
- Dashboard services → Live updates: publishes updates
- Data processing → Alerts and notifications: notifies
Backend/fastapi_app/services/data_processing/processing_job_service.py - User or operator → Inventory optimization: reviews
- User or operator → Reports: requests reports
- User or operator → Dashboard services: views metrics