| name | bi-dashboard-commands |
| description | Provides quick reference for BI Dashboard (Plotly Dash) commands and operations. Activates when user asks how to run, test, or verify the BI Dashboard. Includes startup, shutdown, verification, and troubleshooting procedures. |
BI Dashboard Commands
Purpose
Quick reference for BI Dashboard (Plotly Dash) commands and verification procedures.
When to Activate
This skill activates automatically when:
- User asks how to run the BI Dashboard
- User mentions "bi dashboard", "plotly dash", or "data coverage dashboard"
- User needs to verify BI Dashboard functionality
- User asks about BI Dashboard troubleshooting
Quick Command Reference
Basic Operations
just bi-dashboard
just bi-dashboard-up
just bi-dashboard-down
cd src/interfaces/bi_dashboard && docker-compose logs -f
Alternative Manual Startup
cd src/interfaces/bi_dashboard
docker-compose up --build
docker-compose up -d --build
docker-compose down
Without Docker (Local Development)
cd src/interfaces/bi_dashboard
export DATABASE_URL=postgresql://sagebase:sagebase@localhost:5432/sagebase
python app.py
Verification Procedures
1. Basic Functionality Check
After starting the BI Dashboard, verify the following:
just bi-dashboard-up
just bi-dashboard-down
2. Detailed Verification Checklist
Visual Elements
Interactive Features
Data Accuracy
3. Database Connection Verification
cd src/interfaces/bi_dashboard
docker-compose ps
docker-compose exec bi-dashboard python -c "
from data.data_loader import get_database_url, get_coverage_stats
print('Database URL:', get_database_url())
stats = get_coverage_stats()
print('Coverage Stats:', stats)
"
4. Troubleshooting
Dashboard Won't Start
lsof -i :8050
kill -9 <PID>
docker ps
cd src/interfaces/bi_dashboard
docker-compose down
docker-compose up --build
No Data Displayed
docker compose -f docker/docker-compose.yml exec postgres \
psql -U sagebase_user -d sagebase_db \
-c "SELECT COUNT(*) FROM governing_bodies;"
cd src/interfaces/bi_dashboard
docker-compose logs bi-dashboard | grep -i "database\|error"
Charts Not Rendering
cd src/interfaces/bi_dashboard
docker-compose exec bi-dashboard pip list | grep plotly
Performance Issues
docker compose -f docker/docker-compose.yml exec postgres \
psql -U sagebase_user -d sagebase_db \
-c "EXPLAIN ANALYZE SELECT * FROM governing_bodies LEFT JOIN meetings ON governing_bodies.id = meetings.governing_body_id;"
docker stats
Architecture Notes
Clean Architecture Compliance
The BI Dashboard is designed as an independent application with its own:
- Docker Compose configuration (
src/interfaces/bi_dashboard/docker-compose.yml)
- Python dependencies (
requirements.txt)
- Separation from main Polibase application
Current State (POC):
- Direct database access via SQLAlchemy
- Data loading in
data/data_loader.py
Future Integration:
- Use Repository pattern via domain layer
- Apply Use Cases from application layer
- Use DTOs for data transfer
Port Configuration
- BI Dashboard: Port 8050 (default)
- Main Streamlit: Port 8501 (default)
- Monitoring Dashboard: Port 8502 (deprecated, see Issue #678)
These ports do not conflict, allowing simultaneous operation.
Common Use Cases
Use Case 1: Quick Data Coverage Check
just bi-dashboard-up
just bi-dashboard-down
Use Case 2: Detailed Prefecture Analysis
just bi-dashboard
Use Case 3: Integration Testing After Changes
cd src/interfaces/bi_dashboard
docker-compose down
docker-compose up --build
docker-compose down
File Structure
src/interfaces/bi_dashboard/
├── app.py # Main Dash application
├── layouts/
│ └── main_layout.py # Layout components
├── callbacks/
│ └── data_callbacks.py # Interactive callbacks
├── data/
│ └── data_loader.py # Data retrieval logic
├── Dockerfile # Docker configuration
├── docker-compose.yml # Standalone deployment
├── requirements.txt # Python dependencies
└── README.md # Detailed documentation
Related Documentation
Notes
- BI Dashboard is excluded from pyright type checking (see
pyrightconfig.json)
- Uses independent Python environment (not main Polibase dependencies)
- Designed for future Clean Architecture integration
- POC status: Fully functional, ready for enhancement