How josshua-dsa/neo-horcrox-project works
Neo Horcrox is a web-based supply-chain decision-support application. Stakeholders use the dashboard to inspect filtered operational metrics, choose a ranked product candidate, and view its profile and trend; the profile supplies context for demand forecasting and optional late-shipment risk prediction. The FastAPI backend serves these domain capabilities, with PostgreSQL for order data and risk-prediction logs, and CSV/JSON/model artifacts for fallback analytics, supplier rankings, and model serving. The README documents these major capabilities; links for unsampled frontend and model-loading internals are limited to documented behavior.
Main entry points: main.py FastAPI app · risk_predict_routes.py Risk routes · api.js API client · supplier_selection_routes.py Supplier routes
Components 22
Web experience
- API client
app/frontend/src/js/api.js - Dashboard UI
app/frontend/src/js/pages/dashboardPage.js - Supplier selection UI
app/frontend/src/js/pages/suplier_selectionPage.js - Product profile UI
app/frontend/src/js/pages/product_profilingPage.js - Profile logic
app/frontend/src/js/product-profiling.js
API layer
- FastAPI app
app/backend/main.py - Dashboard routes
app/backend/routes/dashboard_routes.py - Supplier routes
app/backend/routes/supplier_selection_routes.py - Forecast routes
app/backend/routes/forecast_routes.py - Risk routes
app/backend/routes/risk_predict_routes.py - Order and risk logs
app/backend/services/order_service.py - Database manager
app/backend/core/database.py
Decision analytics
- Dashboard aggregation
app/backend/services/dashboard_service.py - Supplier ranking
app/backend/services/supplier_selection_service.py - Dashboard dataset
app/backend/services/dashboard_dataset.py
Model serving
- Demand forecast
app/backend/services/forecast_service.py - Risk prediction
app/backend/services/risk_predict_service.py - Model registry
app/backend/core/model_registry.py
Other components
- Stakeholder
- Browser
- PostgreSQL
- Data and model artifacts
Connections 28
- Stakeholder → Browser: uses
- Browser → Dashboard UI: opens dashboard
- Browser → Supplier selection UI: selects product
- Supplier selection UI → API client: requests candidates
- Dashboard UI → API client: requests metrics
- Product profile UI → Profile logic: renders profile
- Profile logic → API client: requests forecast
- API client → FastAPI app: REST requests
- FastAPI app → Dashboard routes: dispatches
- FastAPI app → Supplier routes: dispatches
- FastAPI app → Forecast routes: dispatches
- FastAPI app → Risk routes: dispatches
- Dashboard routes → Dashboard aggregation: queries
- Dashboard aggregation → Database manager: queries
- Dashboard aggregation → Dashboard dataset: CSV fallback
- Database manager → PostgreSQL: reads and writes
- Supplier routes → Supplier ranking: queries
- Supplier ranking → Data and model artifacts: reads rankings
- Supplier ranking → Dashboard dataset: reads product data
- Supplier routes → Product profile UI: returns product detail
- Forecast routes → Demand forecast: predicts
- Demand forecast → Model registry: uses loaded model
- Model registry → Data and model artifacts: loads models
- Risk routes → Risk prediction: predicts
- Risk prediction → Model registry: uses loaded model
- Risk routes → Order and risk logs: logs predictions
- Risk routes → Order and risk logs: reads prediction logs
- Order and risk logs → Database manager: stores and queries