9ff9ec27e9595a18996802cca6de9fe3fc6e62d6
- migrations/001_initial.sql: full schema with 12 tables, triggers, indexes - migrate.py: idempotent migration runner with version tracking - README.md: deploy instructions, architecture overview - .gitignore: exclude migration tracking data
Jetour BI Dashboard
Dark-themed sales & CRM pipeline dashboard for Jetour Mauritius, powered by CMS BI data.
Quick Deploy
# 1. Clone
git clone https://gitea.iseva.net.za/jjsm01/jetour-bi.git
cd jetour-bi
# 2. Create database
createdb jetour-bi
# 3. Run migrations
pip install psycopg bcrypt
DATABASE_URL="postgresql://postgres:***@localhost:5432/jetour-bi" python migrate.py
# 4. Start dashboard
pip install fastapi uvicorn
uvicorn app:app --host 0.0.0.0 --port 8765
# 5. Open http://localhost:8765
# Default login: admin / admin
Architecture
Browser → FastAPI (:8765) → PostgreSQL (jetour-bi)
↑
n8n workflows (02:00-02:50) ───┘ (populate BI data from CMS)
n8n report triggers (07:00) ───┘ (daily/weekly/monthly emails)
Database
| Table | Purpose |
|---|---|
prospects |
CMS BI prospect records |
prospect_otps |
Vehicle orders (model, color, amount, stock) |
status_logs |
Status change history |
change_log |
Field-level audit trail (auto-triggered) |
appointments |
Delivery/test-drive appointments |
report_recipients |
Email report recipients per type |
app_settings |
SMTP config, app preferences |
dashboard_users |
Auth users |
Migrations
# Apply all pending migrations (idempotent)
DATABASE_URL="postgresql://user:***@host:5432/dbname" python migrate.py
# Or pass URL directly
python migrate.py postgresql://user:***@host:5432/jetour-bi
Migrations are tracked in the _migrations table. Safe to run repeatedly.
Dashboard Pages
| URL | Description |
|---|---|
/ |
Main dashboard (pipeline, velocity, models, vehicle orders) |
/settings.html |
Email report settings (recipients + SMTP config) |
n8n Integration
5 workflows manage the data pipeline. n8n just calls dashboard endpoints:
| Workflow | Schedule | Endpoint |
|---|---|---|
| Daily Report | 07:00 SAST | POST /api/send-report/daily |
| Weekly Report | Mon 07:00 | POST /api/send-report/weekly |
| Monthly Report | 1st 07:00 | POST /api/send-report/monthly |
Dashboard handles all SMTP send + recipient resolution.
Description
Jetour Mauritius BI Dashboard — FastAPI + Chart.js dark-themed sales & CRM pipeline dashboard with n8n automation
Languages
Python
41.4%
HTML
28.2%
TypeScript
22.3%
PLpgSQL
7%
Shell
0.6%
Other
0.5%