Six analytical dashboards. Zero cloud dependencies. Fully interactive.
A fully self-contained BI platform that demonstrates end-to-end dashboard engineering:
| Dashboard | Purpose |
|---|---|
| 🏠 Overview | KPI cards, monthly trend + MoM growth, region donut, category bars |
| 📈 Revenue | Monthly/quarterly trends, region area chart, tabbed drill-in |
| 📦 Products | Category bars, return-rate scatter, cohort category heatmap |
| 👤 Sales Team | Leaderboard (colour-coded by quota status), deal-size scatter |
| 🔍 Drill-Down | Region/category/month filters → raw order table + CSV export |
| 🔄 Returns | Return-rate heatmap by category × region |
git clone https://github.com/YOUR_USERNAME/bi-platform.git
cd bi-platform
python -m venv venv && venv\Scripts\activate # Windows
pip install -r requirements.txt
# Run tests (no API key / no cloud credentials needed)
pytest tests/ -v
# Seed the database and launch
python -m src.database # seeds data/bi_platform.db
streamlit run src/app.py
# Open http://localhost:8501flowchart LR
A["SQLite DB\n2,000 synthetic rows\n(auto-seeded)"] --> B["analytics.py\nQuery layer\n(pure pandas)"]
B --> C["charts.py\nPlotly builders\n(pure figures)"]
C --> D["app.py\nStreamlit multi-page\n(6 pages / tabs)"]
D --> E["Browser\nInteractive dashboard"]
Three-layer design:
| Layer | File | Role |
|---|---|---|
| Data | src/database.py |
SQLite schema + deterministic seed (2 k rows, seed=42) |
| Analytics | src/analytics.py |
SQL → pandas, KPIs, cohorts, returns |
| Presentation | src/charts.py + src/app.py |
Plotly figures + Streamlit pages |
products (product_id PK, name, category, unit_price)
salespeople (salesperson_id PK, name, region)
sales (sale_id PK, sale_date, product_id FK, salesperson_id FK,
region, quantity, unit_price, revenue, is_returned)- 2,000 rows generated deterministically (seed=42) — identical data on every machine
- Q4 seasonal uplift baked in (40 % higher quantity multiplier)
- 4 % return rate injected randomly
- Watermark-free SQLite — no ORM, raw
sqlite3+ pandasread_sql_queryfor fast iteration - Three-layer separation — DB → analytics → charts layers are independently testable
- Streamlit
@st.cache_data— query results cached 5 min so navigation doesn't re-query - Plotly dual-axis — revenue bars + MoM growth % line share one figure (secondary y-axis)
- Pivot cohort heatmap —
df.pivot+ row-wise normalisation → percentage share per month
- Multi-page Streamlit — sidebar
st.radioas a router, each page function is independently callable - Plotly dual y-axis —
yaxis2withoverlaying="y"andside="right"inupdate_layout - SQLite for BI prototyping — CASE expressions, sub-selects, and window-like patterns without a heavyweight DB
- Test isolation —
tmp_path_factorysession-scoped fixture gives one seeded DB for all tests, no I/O per test - Dependency inversion —
db_pathparameter on every analytics function enables test DBs without monkeypatching
MIT
Part of a 10-project Data Analyst portfolio