How dhana123-m/movie-box-revenue-forecast works
This is a full-stack movie box-office revenue forecasting product. A user enters movie characteristics in the forecast UI; the frontend sends requests to the FastAPI backend, which preprocesses inputs, runs the trained model, and returns a revenue estimate and performance category. Separate branches provide batch predictions, explanations, analytics, movie search, model diagnostics, and retraining. Training and preprocessing form an internal model-development layer. Some backend route-to-service details were not sampled, so those links are documented at the product level rather than asserting unverified calls.
Main entry points: main.py FastAPI application · App.tsx Page routing · api.ts API client · model_service.py Model runtime
Components 26
Web experience
- Page routing
frontend/src/App.tsx - Forecast form
frontend/src/pages/ForecastPage.tsx - Prediction result
frontend/src/components/forecast/PredictionResultCard.tsx - Analytics view
frontend/src/pages/AnalyticsPage.tsx - Movie explorer
frontend/src/pages/MovieExplorerPage.tsx - Model hub
frontend/src/pages/ModelPerformancePage.tsx - Settings
frontend/src/pages/SettingsPage.tsx - API client
frontend/src/services/api.ts
API and services
- FastAPI application
backend/app/main.py - Prediction endpoints
backend/app/routes/predict.py - Analytics endpoints
backend/app/routes/analytics.py - Movie endpoints
backend/app/routes/movies.py - Model info endpoints
backend/app/routes/model_info.py - Retraining endpoint
backend/app/routes/training.py - Prediction service
backend/app/services/prediction_service.py - Analytics service
backend/app/services/analytics_service.py - Training service
backend/app/services/training_service.py
Movie data
- SQLite database
backend/app/database.py - Database seeding
backend/app/services/db_service.py
Model runtime
- Model runtime
backend/app/services/model_service.py - Revenue preprocessor
backend/app/ml/preprocessor.py - Sensitivity analysis
backend/app/ml/explain.py
Model development
- Feature engineering
backend/training/feature_engineering.py - Training pipeline
backend/training/train.py - Model evaluation
backend/training/evaluate.py
Other components
- Movie user
Connections 31
- Movie user → Page routing: uses
README.md - Page routing → Forecast form: routes to
frontend/src/App.tsx - Page routing → Analytics view: routes to
frontend/src/App.tsx - Page routing → Movie explorer: routes to
frontend/src/App.tsx - Page routing → Model hub: routes to
frontend/src/App.tsx - Page routing → Settings: routes to
frontend/src/App.tsx - Forecast form → API client: requests
- API client → FastAPI application: sends API requests
README.md - FastAPI application → Prediction endpoints: registers
backend/app/main.py - FastAPI application → Analytics endpoints: registers
backend/app/main.py - FastAPI application → Movie endpoints: registers
backend/app/main.py - FastAPI application → Model info endpoints: registers
backend/app/main.py - FastAPI application → Retraining endpoint: registers
backend/app/main.py - Prediction endpoints → Prediction service: dispatches
- Prediction service → Model runtime: predicts with
- Model runtime → Revenue preprocessor: transforms inputs
backend/app/services/model_service.py - Model runtime → Sensitivity analysis: uses for explanations
backend/app/services/model_service.py - Prediction endpoints → Prediction result: returns estimates
README.md - Analytics endpoints → Analytics service: dispatches
- Analytics view → API client: requests analytics
README.md - Movie explorer → API client: requests movie data
README.md - Model hub → API client: requests model metrics
frontend/src/pages/ModelPerformancePage.tsx - Retraining endpoint → Training service: dispatches
- Settings → API client: triggers retraining
README.md - Movie endpoints → SQLite database: queries
backend/app/routes/movies.py - FastAPI application → Database seeding: seeds database
backend/app/main.py - Database seeding → SQLite database: writes movies
backend/app/services/db_service.py - Feature engineering → Training pipeline: provides processed data
README.md - Training pipeline → Model evaluation: evaluates model
backend/training/train.py - Training pipeline → Revenue preprocessor: uses feature pipeline
backend/training/train.py - FastAPI application → Model runtime: loads model at startup
backend/app/main.py