How nareudaykiran/cartcompass-bi works
CartCompass-BI is an e-commerce BI dashboard for management review. Users open a dashboard page, whose shared client fetches filtered KPI and breakdown data from Flask; route handlers delegate calculations to analytics queries over SQLite, and results populate charts and tables. Major capabilities also include revenue comparisons, category and regional analysis, fulfillment-status reporting, static report charts, and an offline demo-data fallback. The README documents the wider analysis and reporting features; only the API, shared client, and database setup are sampled in source, so unsampled connections are omitted or marked unverified.
Main entry points: app.py Flask app and page routing · common.js Shared client and demo data · analytics.py SQL analytics service · reports.js Reports and audit
Components 21
Dashboard presentation
- Executive overview
frontend/js/overview.js - Revenue analytics
frontend/js/revenue.js - Category analysis
frontend/js/categories.js - Regional analysis
frontend/js/regions.js - Reports and audit
frontend/js/reports.js - Shared client and demo data
frontend/js/common.js
Flask API
- Flask app and page routing
backend/app.py - KPI routes
backend/routes/kpis.py - Revenue routes
backend/routes/revenue.py - Category routes
backend/routes/categories.py - Region routes
backend/routes/regions.py
Analytics and data
- SQL analytics service
backend/services/analytics.py - SQLite access layer
backend/db.py - SQLite database
database/schema.sql - Database initialization
database/init_db.py
Analysis and reporting
- Data cleaning
analysis/clean_data.py - KPI and summaries
analysis/calculate_kpis.py - Static chart generation
analysis/generate_charts.py - Raw transaction CSVs
data/raw - Processed datasets
data/processed
Other components
- Management user
Connections 32
- Management user → Flask app and page routing: opens dashboard
README.md - Flask app and page routing → Executive overview: serves page
backend/app.py - Flask app and page routing → Revenue analytics: serves page
backend/app.py - Flask app and page routing → Category analysis: serves page
backend/app.py - Flask app and page routing → Regional analysis: serves page
backend/app.py - Flask app and page routing → Reports and audit: serves page
backend/app.py - Executive overview → Shared client and demo data: uses client
- Revenue analytics → Shared client and demo data: uses client
- Category analysis → Shared client and demo data: uses client
- Regional analysis → Shared client and demo data: uses client
- Reports and audit → Shared client and demo data: uses client
- Shared client and demo data → KPI routes: requests KPIs
frontend/js/common.js - Shared client and demo data → Revenue routes: requests revenue
frontend/js/common.js - Shared client and demo data → Category routes: requests categories
frontend/js/common.js - Shared client and demo data → Region routes: requests regions
- KPI routes → SQL analytics service: gets KPI data
backend/routes/kpis.py - Revenue routes → SQL analytics service: gets revenue data
backend/routes/revenue.py - Category routes → SQL analytics service: gets category data
backend/routes/categories.py - Region routes → SQL analytics service: gets regional data
backend/routes/regions.py - Flask app and page routing → Region routes: registers blueprint
backend/app.py - Flask app and page routing → KPI routes: registers blueprint
backend/app.py - Flask app and page routing → Revenue routes: registers blueprint
backend/app.py - Flask app and page routing → Category routes: registers blueprint
backend/app.py - SQL analytics service → SQLite access layer: queries through
backend/services/analytics.py - SQLite access layer → SQLite database: reads and writes
- Database initialization → SQLite database: initializes schema
database/init_db.py - Database initialization → Raw transaction CSVs: loads CSVs
database/init_db.py - Data cleaning → Raw transaction CSVs: cleans inputs
- Data cleaning → Processed datasets: writes datasets
- KPI and summaries → Processed datasets: reads and exports
analysis/calculate_kpis.py - Static chart generation → Processed datasets: builds charts
- Reports and audit → Static chart generation: displays chart gallery