How haricrazy1432-bot/salesforecastautomation works
SalesForecastAutomation is a Northwind sales analytics app: users ask questions in chat, receive SQL-backed results or a sales forecast, and view charts and a text summary. The frontend coordinates the workflow; the FastAPI backend exposes schema, query, sales-history, and forecast endpoints over SQLite. Forecasts aggregate monthly sales and fit a linear trend. The README provides no further capability detail, and the Groq and Chat implementations were not excerpted, so their internal behavior is not expanded here.
Main entry points: App.tsx Workflow coordinator · main.py Analytics API · northwind.db Northwind SQLite · Chat.tsx Chat input
Components 14
User interface
- Chat input
src/components/Chat.tsx - Workflow coordinator
src/App.tsx - Charts
src/components/Charts.tsx - Results and summary
src/App.tsx
Natural-language queries
- Groq language services
src/lib/groq.ts
Analytics backend
- Analytics API
backend/main.py - Schema endpoint
backend/main.py - Read-only SQL endpoint
backend/main.py - Sales history endpoint
backend/main.py - Monthly sales aggregation
backend/main.py - Forecast endpoint
backend/main.py - Linear trend model
backend/main.py
Sales data
- Northwind SQLite
backend/northwind.db
Other components
- Analyst
Connections 19
- Analyst → Chat input: asks
- Chat input → Workflow coordinator: submits message
src/App.tsx - Workflow coordinator → Schema endpoint: fetches schema
src/App.tsx - Workflow coordinator → Groq language services: generates SQL
src/App.tsx - Workflow coordinator → Read-only SQL endpoint: submits query
src/App.tsx - Workflow coordinator → Forecast endpoint: requests forecast
src/App.tsx - Workflow coordinator → Groq language services: describes results
src/App.tsx - Workflow coordinator → Charts: renders rows
src/App.tsx - Workflow coordinator → Results and summary: renders results
src/App.tsx - Analytics API → Schema endpoint: serves routes
backend/main.py - Analytics API → Read-only SQL endpoint: serves routes
backend/main.py - Analytics API → Sales history endpoint: serves routes
backend/main.py - Analytics API → Forecast endpoint: serves routes
backend/main.py - Schema endpoint → Northwind SQLite: reads schema
backend/main.py - Read-only SQL endpoint → Northwind SQLite: executes query
backend/main.py - Sales history endpoint → Monthly sales aggregation: builds history
backend/main.py - Forecast endpoint → Monthly sales aggregation: builds history
backend/main.py - Monthly sales aggregation → Northwind SQLite: reads sales data
backend/main.py - Forecast endpoint → Linear trend model: fits and predicts
backend/main.py