How aiwithfahad/smart-retail-ml works
Smart Retail ML is a FastAPI dashboard for retail anomaly detection, demand forecasting, model experimentation, edge inference, and invoice OCR. Users authenticate, then operate these features through the browser dashboard and receive predictions, job results, or stored history. The map separates API orchestration, ML capabilities, persistence, and the browser client. Some route implementations and ML internals were not sampled, so those capability links are grounded in README documentation rather than inferred call chains.
Main entry points: app.py FastAPI API · models Model Artifacts · script.js Dashboard UI · ml.py Anomaly Scoring
Components 16
Dashboard
- Dashboard UI
frontend/script.js
API and Identity
- FastAPI API
app.py - JWT Auth
auth.py
ML Capabilities
- Anomaly Scoring
ml.py - Demand Forecasting
ml.py - Model Versions and A/B
ml.py - Edge Inference
ml.py - Invoice OCR
ml.py - AutoML Search
ml.py - OCR Dataset
data/raw/vision_ocr - Model Artifacts
models
Persistence
- Retail Database
database.py - Anomaly History
database.py - Vision Jobs
database.py - Experiment Leaderboard
database.py
Other components
- User
Connections 18
- User → Dashboard UI: uses
README.md - Dashboard UI → FastAPI API: calls endpoints
frontend/script.js - FastAPI API → JWT Auth: registers auth
app.py - FastAPI API → Anomaly Scoring: scores ticks
app.py - FastAPI API → Demand Forecasting: serves forecasts
README.md - FastAPI API → Model Versions and A/B: serves model routes
app.py - FastAPI API → Edge Inference: serves edge routes
README.md - FastAPI API → Invoice OCR: queues OCR jobs
README.md - FastAPI API → AutoML Search: serves AutoML routes
README.md - FastAPI API → Retail Database: queries and writes
app.py - FastAPI API → Anomaly History: stores scores
app.py - FastAPI API → Vision Jobs: tracks jobs
app.py - FastAPI API → Experiment Leaderboard: persists leaderboard
README.md - Invoice OCR → OCR Dataset: reads samples
README.md - Anomaly Scoring → Model Artifacts: loads detector
README.md - Demand Forecasting → Model Artifacts: loads versions
README.md - Model Versions and A/B → Model Artifacts: reads metadata
- Edge Inference → Model Artifacts: loads inference model
README.md