How abhin-c/sales-intelligence-assistant works
This is a sales intelligence web application: a user uploads sales CSV data, the backend validates and stores it, and the dashboard presents sales metrics, trends, product/customer rankings, forecasts, and written insights. The React app calls FastAPI through a small API client; backend routers delegate to CSV, analytics, forecasting, and insight services. The README documents additional analytics capabilities not visible in sampled service code. The graph uses those documented links where needed; unsampled implementation details are not inferred.
Main entry points: App.jsx Dashboard app · analytics.py Analytics routes · upload.py Upload and clear routes · ai_service.py Insight generation
Components 23
Dashboard
- Dashboard app
frontend/src/App.jsx - API client
frontend/src/api.js - Upload controls
frontend/src/components/UploadCard.jsx - KPI cards
frontend/src/components/KpiCards.jsx - Revenue chart
frontend/src/components/RevenueChart.jsx - Customer and product tables
frontend/src/components/DataTable.jsx - Forecast card
frontend/src/components/ForecastCard.jsx - Insights panel
frontend/src/components/InsightsPanel.jsx
HTTP API
- Upload and clear routes
backend/app/routers/upload.py - Analytics routes
backend/app/routers/analytics.py - API startup
backend/app/main.py - API response schemas
backend/app/schemas.py
Sales Services
- CSV validation and import
backend/app/services/csv_service.py - Sales analytics
backend/app/services/analytics_service.py - Revenue forecast
backend/app/services/forecast_service.py - Insight generation
backend/app/services/ai_service.py - Backend configuration
backend/app/config.py
Sales Data
- Sales entities
backend/app/models.py - Database sessions
backend/app/database.py - Sales database
database/schema.sql
AI Providers
- Gemini API
- OpenAI API
Other components
- Sales user
Connections 31
- Sales user → Dashboard app: uses
README.md - Dashboard app → API client: loads data
frontend/src/App.jsx - Dashboard app → Upload controls: renders
frontend/src/App.jsx - Dashboard app → KPI cards: renders
frontend/src/App.jsx - Dashboard app → Revenue chart: renders
frontend/src/App.jsx - Dashboard app → Customer and product tables: renders
frontend/src/App.jsx - Dashboard app → Forecast card: renders
frontend/src/App.jsx - Dashboard app → Insights panel: renders
frontend/src/App.jsx - Upload controls → API client: uploads or clears
frontend/src/components/UploadCard.jsx - API client → Upload and clear routes: HTTP requests
frontend/src/api.js - API client → Analytics routes: HTTP requests
frontend/src/api.js - API startup → Upload and clear routes: registers
backend/app/main.py - API startup → Analytics routes: registers
backend/app/main.py - Upload and clear routes → CSV validation and import: processes CSV
backend/app/routers/upload.py - Upload and clear routes → Database sessions: gets session
backend/app/routers/upload.py - Upload and clear routes → Sales entities: deletes records
backend/app/routers/upload.py - Upload and clear routes → API response schemas: validates response
backend/app/routers/upload.py - CSV validation and import → Sales entities: creates records
backend/app/services/csv_service.py - CSV validation and import → Sales database: reads and writes
backend/app/services/csv_service.py - Analytics routes → Sales analytics: requests metrics
backend/app/routers/analytics.py - Analytics routes → Revenue forecast: requests forecast
backend/app/routers/analytics.py - Analytics routes → Insight generation: requests insights
backend/app/routers/analytics.py - Analytics routes → Database sessions: gets session
backend/app/routers/analytics.py - Analytics routes → API response schemas: uses responses
backend/app/routers/analytics.py - Sales analytics → Sales entities: queries sales
backend/app/services/analytics_service.py - Sales analytics → Sales database: aggregates sales
- Revenue forecast → Sales database: uses monthly revenue
README.md - Insight generation → Backend configuration: reads provider settings
backend/app/services/ai_service.py - Insight generation → Gemini API: calls when selected
backend/app/services/ai_service.py - Insight generation → OpenAI API: calls when selected
backend/app/services/ai_service.py - Sales database → Sales entities: stores entities
README.md