How mansi084/trendcast-ai works
TrendCast AI turns seller sales history and contextual signals into SKU-level demand forecasts. Sellers upload sales or calendar data through the dashboard; the API stores it, and the upload watcher or scheduled batch pipeline prepares features, trains/selects models, generates forecasts, and publishes them for dashboard display. Signal producers collect weather, holidays, trends, macroeconomic, local-event, and opt-in marketplace data. The README documents the broad pipeline; sampled source confirms producer dispatch, Kafka ingestion, Supabase sales ingestion, API authentication, calendar parsing, and inference behavior, but not every subsystem’s wiring.
Main entry points: routers REST endpoints · app Next.js dashboard · api.ts API client · gold_features.py Gold features
Components 25
Seller experience
- Next.js dashboard
frontend/src/app - Forecast UI
frontend/src/components - API client
frontend/src/lib/api.ts
API and data access
- FastAPI app
backend/app/main.py - JWT authentication
backend/app/auth.py - REST endpoints
backend/app/routers - Calendar parser
backend/app/services/calendar_parser.py - Supabase Postgres
Signal collection
- Producer runner
producers/runner.py - Signal producers
producers - Kafka topics
Data pipeline
- Upload watcher
pipeline/watch_uploads.py - Bronze ingestion
pipeline/jobs/bronze_ingest.py - Sales ingestion
pipeline/jobs/bronze_ingest_supabase.py - Silver transforms
pipeline/jobs/silver_transform.py - Gold features
pipeline/jobs/gold_features.py - Feature transforms
pipeline/transforms/features.py - Forecast publishing
pipeline/jobs/publish_to_supabase.py
Forecasting
- Model training
ml/train.py - Backtesting
ml/backtest.py - Batch inference
ml/infer.py - Forecast models
ml/forecaster.py
Other components
- Seller
- Supabase Auth
- External signal feeds
Connections 30
- Seller → Next.js dashboard: uses
- Next.js dashboard → API client: requests data
- Next.js dashboard → Forecast UI: renders
- Next.js dashboard → Supabase Auth: authenticates
- API client → FastAPI app: calls API
- FastAPI app → REST endpoints: dispatches
- REST endpoints → JWT authentication: verifies tokens
- JWT authentication → Supabase Auth: checks signing keys
- REST endpoints → Supabase Postgres: reads and writes
- REST endpoints → Calendar parser: parses calendars
- Seller → REST endpoints: uploads sales
- Upload watcher → Supabase Postgres: polls uploads
- Upload watcher → Sales ingestion: triggers pipeline
- Supabase Postgres → Sales ingestion: reads sales
- External signal feeds → Signal producers: provide signals
- Producer runner → Signal producers: dispatches
- Signal producers → Kafka topics: publishes records
- Producer runner → Kafka topics: publishes health
- Kafka topics → Bronze ingestion: streams records
- Bronze ingestion → Silver transforms: writes bronze data
- Sales ingestion → Silver transforms: writes bronze data
- Silver transforms → Gold features: transforms data
- Gold features → Feature transforms: builds features
- Gold features → Model training: supplies features
- Model training → Backtesting: evaluates models
- Model training → Batch inference: provides trained models
- Batch inference → Forecast models: generates forecasts
- Batch inference → Forecast publishing: writes forecast rows
- Forecast publishing → Supabase Postgres: publishes forecasts
- API client → Supabase Postgres: loads dashboard data