https://github.com/huzefaaa2/mb
https://github.com/huzefaaa2/mb
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/huzefaaa2/mb
- Owner: Huzefaaa2
- License: mpl-2.0
- Created: 2026-01-28T07:59:07.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-01-29T02:38:21.000Z (5 months ago)
- Last Synced: 2026-01-29T02:53:07.333Z (5 months ago)
- Language: Python
- Size: 72.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Magic Bus Compass 360 - Youth Development Platform
**Transform raw engagement data into strategic insights for youth development in the APAC region.**
   
## ๐ Table of Contents
- [Overview](#overview)
- [Key Features](#key-features)
- [Recent Updates - Phase 3B](#-recent-updates---phase-3b-jan-29-2026)
- [Architecture](#architecture)
- [System Flows](#system-flows)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Documentation](#documentation)
- [Tech Stack](#tech-stack)
- [Contributing](#contributing)
---
## ๐ฏ Overview
Magic Bus Compass 360 is an integrated youth development platform that combines:
- **Real-time engagement tracking** from APAC region datasets
- **Decision Intelligence dashboards** powered by Azure Blob Storage
- **Youth learning journey** management and feedback collection
- **Admin oversight** and strategic decision support
- **Data-driven proposals** for funding and interventions
The platform processes 50+ youth profiles across multiple learning domains, providing actionable insights for stakeholder decision-making.
---
## โจ Key Features
### ๐ฅ Youth Management
- Registration and onboarding workflows (5-phase Intelligent Orchestrator)
- Profile management with education background
- Learning module assignment and tracking
- Progress monitoring and engagement metrics
- **[NEW] Youth Potential Scoreโข** - AI-powered composite scoring (Engagement, Retention, Skills, Placement)
- **[NEW] Learning Pathway & Milestones** - 5-stage development tracker
### ๐ Decision Intelligence Dashboard (11 Interactive Tabs)
- **Executive Overview**: Real-time KPIs (enrollment, completion, dropout risk)
- **Mobilisation Funnel**: Track progression through learning stages
- **Sector Heatmap**: Youth interests ร readiness alignment
- **At-Risk Youth**: Priority identification and intervention
- **Module Effectiveness**: Learning content performance analysis
- **Gamification Impact**: Badge/points ROI comparison
- **Screening Analytics**: Voice assessment results and soft skills extraction
- **[NEW] Youth Potential Scoreโข**: 4-tier distribution, top 20 leaderboard, trend analysis
- **[NEW] Retention Analytics**: Progress toward 85% target, intervention effectiveness tracking
- **[NEW] Skill Development**: Role-based gap analysis, personalized learning paths (5 roles)
- **Proposal Generator**: AI-powered funding proposals
### ๐ผ Admin Controls
- User role management (Youth, Admin, Instructor)
- Learning module creation and configuration
- Feedback survey distribution and collection
- System health monitoring
- **[NEW] Churn Prevention Dashboard** - At-risk student identification, intervention controls, effectiveness tracking
- **[NEW] Retention Management** - 5 intervention types (Mentorship, Badge Challenge, 1-on-1 Support, Career Coaching, Peer Pairing)
### ๐ Analytics & AI Engine
- 50+ youth profiles with engagement data
- 6 enriched feature tables for decision-making
- SQLite + Azure Blob Storage hybrid data sources
- Real-time feature computation pipeline
- **[NEW] 5 Advanced AI Features**:
- โญ **Youth Potential Scoreโข** - Composite metric (4 components, 4-tier system)
- ๐ **Skill Gap Bridger** - Role-based analysis for 5 career paths
- ๐จ **Churn Risk Prediction** - Binary classifier with intervention tracking
- ๐ฎ **Gamified Retention** - 6 badge types, streak tracking, engagement incentives
- ๐ค **Peer Matching Network** - Similarity-based mentor/buddy pairing (k=0.65)
---
## ๐๏ธ Architecture
### High-Level System Architecture
```mermaid
graph TB
subgraph "Data Sources"
SQLite["SQLite Database
50 Youth Records
9 Tables"]
Azure["Azure Blob Storage
APAC Region
Read-Only Access"]
end
subgraph "Backend Services"
Connector["Azure Blob Connector
- Data retrieval
- Error handling
- Caching"]
Engineer["Feature Engineer
- 6 feature tables
- Dropout risk
- Sector fit"]
Dashboard["Decision Dashboard
- KPI generation
- Heatmap building
- Insights"]
end
subgraph "Streamlit Frontend"
Auth["Login & Register
Pages"]
Youth["Youth Dashboard
- Profile
- Progress
- Feedback"]
Admin["Admin Portal
- Module Mgmt
- Surveys
- Reports"]
DI["Decision Intelligence
- 7 Tabs
- Interactive Charts
- Exports"]
end
SQLite -->|Load| Connector
Azure -->|Load| Connector
Connector -->|Features| Engineer
Engineer -->|KPIs & Data| Dashboard
Dashboard -->|Insights| DI
Auth -->|Auth| Youth
Auth -->|Auth| Admin
Youth -->|Engagement| SQLite
Admin -->|Config| SQLite
DI -->|Display| Dashboard
```
### Component Architecture
```mermaid
graph LR
subgraph "Presentation Layer"
UI["Streamlit UI
6 Pages
Multi-role"]
end
subgraph "Application Layer"
AppSvcs["Application Services
- Auth Service
- Module Service
- Feedback Service"]
end
subgraph "Data Service Layer"
Connectors["Data Connectors
- SQLite Driver
- Azure Connector
- Cache Layer"]
end
subgraph "Data Layer"
DB["SQLite
mb_compass.db
9 Tables"]
Blob["Azure Blob
APAC Datasets
25+ CSVs"]
end
UI -->|API Calls| AppSvcs
AppSvcs -->|Queries| Connectors
Connectors -->|Read/Write| DB
Connectors -->|Read| Blob
```
### Data Flow Architecture
```mermaid
graph TD
A["Youth Registration"] -->|Store| B["mb_users Table
50 students"]
C["Learning Modules"] -->|Assign| D["learning_modules Table
Module Assignments"]
E["Youth Progress"] -->|Track| F["Feature Engineer"]
D -->|Input| F
B -->|Input| F
F -->|Compute| G["student_daily_features
50 rows"]
F -->|Compute| H["dropout_risk
50 rows"]
F -->|Compute| I["sector_fit
50 rows"]
F -->|Compute| J["module_effectiveness
16 rows"]
G -->|Display| K["Decision Dashboard"]
H -->|Display| K
I -->|Display| K
J -->|Display| K
K -->|Visualize| L["7-Tab Dashboard"]
L -->|KPIs| M["Executive Overview
50 enrolled, 70.9% completion"]
```
---
## ๐ System Flows
### 1. Youth Registration Flow
```mermaid
sequenceDiagram
participant Youth as Youth User
participant App as Streamlit App
participant Auth as Auth Service
participant DB as SQLite DB
Youth->>App: Visit Platform
App->>Youth: Show Login/Register
Youth->>App: Fill Registration Form
Note over App: Validate Email & Password
App->>Auth: Authenticate
Auth->>DB: Check User Exists
DB-->>Auth: Not Found
Auth->>DB: Create New User
DB-->>Auth: User Created
Auth-->>App: Success
App->>DB: Store Profile Data
DB-->>App: Stored
App->>Youth: Redirect to Dashboard
```
### 2. Youth Dashboard Flow
```mermaid
sequenceDiagram
participant Youth as Youth
participant App as Youth Dashboard
participant Service as Data Service
participant DB as Database
Youth->>App: Login
App->>Service: Get User Profile
Service->>DB: Query mb_users
DB-->>Service: User Data
Service->>DB: Query learning_modules
DB-->>Service: Module List
Service->>App: Profile & Modules
App->>App: Render Dashboard
App->>Youth: Display Profile, Progress, Feedback Form
Youth->>App: Submit Feedback
App->>Service: Save Feedback
Service->>DB: Insert youth_feedback_surveys
DB-->>Service: Saved
Service-->>App: Confirmation
App->>Youth: Success Message
```
### 3. Admin Control Flow
```mermaid
sequenceDiagram
participant Admin as Admin User
participant App as Admin Portal
participant Service as Admin Service
participant DB as Database
Admin->>App: Login as Admin
App->>Service: Load Admin Dashboard
Service->>DB: Query All Users
DB-->>Service: 50 Users
Service->>DB: Query learning_modules
DB-->>Service: 16 Modules
Service->>App: Dashboard Data
App->>Admin: Display Overview
Admin->>App: Create New Module
App->>Service: Add Module
Service->>DB: Insert learning_modules
DB-->>Service: Inserted
Service->>App: Success
App->>Admin: Module Added
Admin->>App: Distribute Survey
App->>Service: Send Survey Emails
Service->>DB: Create survey_distribution_logs
DB-->>Service: Sent
Service-->>App: Delivery Report
```
### 4. Decision Intelligence Flow
```mermaid
sequenceDiagram
participant User as Stakeholder
participant UI as DI Dashboard
participant Engineer as Feature Engineer
participant Connector as Data Connector
participant Data as Database/Blob
User->>UI: Navigate to DI Dashboard
UI->>Engineer: Request Features
Engineer->>Connector: Load Data
Connector->>Data: Query SQLite
Data-->>Connector: 50 Records
Connector->>Connector: Check Azure
Connector-->>Engineer: Data Ready
Engineer->>Engineer: Compute 6 Features
Engineer->>Engineer: Aggregate Metrics
Engineer-->>UI: Features & Insights
UI->>UI: Build Charts
UI->>UI: Format KPIs
UI->>User: Display 7 Tabs
User->>UI: View Sector Heatmap
UI->>User: Interactive Visualization
User->>UI: Download Proposal
UI->>User: PDF Export
```
---
## ๐ Data Model
### Entity-Relationship Overview
```mermaid
erDiagram
MB_USERS ||--o{ LEARNING_MODULES : "assigns"
MB_USERS ||--o{ CAREER_SURVEYS : "completes"
MB_USERS ||--o{ YOUTH_FEEDBACK_SURVEYS : "submits"
LEARNING_MODULES ||--o{ CAREER_SURVEYS : "covers"
SURVEY_TEMPLATES ||--o{ SURVEY_DISTRIBUTION_LOGS : "used-in"
MB_USERS {
int user_id
string student_id
string email
string full_name
string education_level
timestamp created_at
}
LEARNING_MODULES {
int module_assignment_id
int user_id
string title
string status
int progress
timestamp completed_date
}
CAREER_SURVEYS {
int survey_id
int user_id
string survey_data
timestamp completed_at
}
YOUTH_FEEDBACK_SURVEYS {
int survey_id
int user_id
string job_title
int overall_satisfaction
timestamp completed_at
}
SURVEY_TEMPLATES {
int template_id
string template_type
string template_name
json questions_json
boolean is_active
}
SURVEY_DISTRIBUTION_LOGS {
int log_id
string survey_type
string recipient_email
timestamp sent_date
boolean completed
}
```
---
## ๐ Installation
### Prerequisites
- Python 3.11+
- pip/conda
- SQLite3
- Git
### Setup Steps
1. **Clone Repository**
```bash
git clone https://github.com/Huzefaaa2/mb.git
cd mb
```
2. **Create Virtual Environment**
```bash
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # macOS/Linux
```
3. **Install Dependencies**
```bash
pip install -r requirements.txt
```
4. **Configure Environment**
```bash
cp .env.example .env
# Edit .env with your settings
```
5. **Initialize Database**
```bash
python scripts/init_db.py
```
6. **Run Platform**
```bash
streamlit run mb/app.py
```
Visit: `http://localhost:8501`
---
## โก Quick Start
### Access the Platform
1. **Login Page** (`http://localhost:8501`)
- Register new account or login
- Email-based authentication
2. **Youth Dashboard**
- View profile and learning progress
- Submit feedback surveys
- Track module completion
3. **Decision Intelligence** (Admin)
- Navigate to: Admin & Intelligence โ Decision Intelligence Dashboard
- View 7-tab analytics dashboard
- Download proposals
### Demo Data
- **50 Youth Profiles** pre-loaded
- **16 Learning Modules** configured
- **70.9% Completion Rate** current baseline
- **40% Dropout Risk** identification active
---
## ๐ Documentation
### Wiki Pages
Comprehensive documentation available in the [Wiki](https://github.com/Huzefaaa2/mb/wiki):
- **[Architecture](docs/wiki/01-Architecture.md)** - System design and C4 diagrams
- **[Data Model](docs/wiki/02-Data-Model.md)** - Database schema and relationships
- **[API Reference](docs/wiki/03-API-Reference.md)** - Backend services
- **[Feature Engineering](docs/wiki/04-Feature-Engineering.md)** - Analytics pipeline
- **[Deployment](docs/wiki/05-Deployment.md)** - Production setup
- **[Troubleshooting](docs/wiki/06-Troubleshooting.md)** - Common issues
### Key Documentation Files
- [Azure Integration Guide](docs/AZURE_INTEGRATION_GUIDE.md)
- [Feature Engineering Reference](docs/FEATURES_DOCUMENTATION.md)
- [API Specifications](docs/API_SPECIFICATION.md)
---
## ๐๏ธ Tech Stack
| Component | Technology | Version |
|-----------|-----------|---------|
| **Frontend** | Streamlit | 1.28.1 |
| **Backend** | Python | 3.11 |
| **Database** | SQLite3 | Latest |
| **Cloud Storage** | Azure Blob Storage | Latest |
| **Analytics** | Pandas, NumPy | Latest |
| **Visualization** | Plotly | 5.18 |
| **Testing** | Pytest | Latest |
---
## ๐ Project Structure
```
mb/
โโโ README.md # This file
โโโ requirements.txt # Python dependencies
โโโ QUICK_START.py # Demo script
โ
โโโ mb/ # Main application
โ โโโ app.py # Streamlit entry point
โ โโโ pages/ # Page modules
โ โ โโโ 0_login.py # Authentication
โ โ โโโ 1_register.py # Registration
โ โ โโโ 2_youth_dashboard.py # Youth profile
โ โ โโโ 2_confirmation.py # Confirmation page
โ โ โโโ 3_magicbus_admin.py # Admin portal
โ โ โโโ 4_decision_intelligence_azure.py # DI Dashboard
โ โ โโโ 5_feedback_survey.py # Feedback collection
โ โ
โ โโโ data_sources/ # Data integration
โ โ โโโ azure_blob_connector.py # Azure connectivity
โ โ โโโ azure_feature_engineer.py # Feature computation
โ โ โโโ azure_decision_dashboard.py # Analytics engine
โ โ
โ โโโ components/ # UI components
โ โโโ services/ # Business logic
โ
โโโ config/ # Configuration
โ โโโ settings.py # Environment settings
โ โโโ secrets.py # Secrets management
โ
โโโ data/ # Data directory
โ โโโ mb_compass.db # SQLite database
โ โโโ synthetic/ # Generated datasets
โ
โโโ scripts/ # Utilities
โ โโโ init_db.py # Database initialization
โ โโโ generate_synthetic_data.py # Data generation
โ โโโ verify_setup.py # Setup verification
โ
โโโ docs/ # Documentation
โ โโโ wiki/ # Wiki pages (C4 diagrams)
โ โโโ AZURE_INTEGRATION_GUIDE.md # Azure setup
โ โโโ FEATURES_DOCUMENTATION.md # Features guide
โ
โโโ tests/ # Unit tests
โโโ test_integrations.py # Integration tests
```
---
## ๐ Security & Privacy
- โ
Role-based access control (Youth, Admin, Instructor)
- โ
Email-based authentication
- โ
Data encryption at rest (SQLite)
- โ
Secure connection strings (environment variables)
- โ
PII protection (no plaintext passwords)
- โ
Survey data anonymization
---
## ๐ Key Metrics
| Metric | Value | Status |
|--------|-------|--------|
| Youth Enrolled | 50 | โ
Active |
| Learning Modules | 16 | โ
Configured |
| Completion Rate | 70.9% | โ
Above Target |
| Dropout Risk (High) | 40% | โ ๏ธ Monitor |
| Engagement Score | 57% | โ
Healthy |
| Retention Goal | 85% | โ
Targeting |
| Dashboard Tabs | 11 | โ
Live |
| AI Features | 5 | โ
Deployed |
| Dashboard Response Time | <1s | โ
Optimal |
| Feature Computation | 15-30s | โ
Acceptable |
---
## ๐ค Contributing
We welcome contributions! Please follow these steps:
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit changes (`git commit -m 'Add amazing feature'`)
4. Push to branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
### Development Guidelines
- Follow PEP 8 style guide
- Write tests for new features
- Document API changes
- Update relevant Wiki pages
---
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## ๐ Support & Contact
- **Issues**: [GitHub Issues](https://github.com/Huzefaaa2/mb/issues)
- **Discussions**: [GitHub Discussions](https://github.com/Huzefaaa2/mb/discussions)
- **Email**: support@magicbus.local
- **Documentation**: [Wiki](https://github.com/Huzefaaa2/mb/wiki)
---
## ๐ Acknowledgments
- Magic Bus Foundation for youth development mission
- APAC region partners for data collaboration
- Azure for cloud infrastructure
- Streamlit team for amazing dashboard framework
---
**Last Updated**: January 29, 2026 | **Version**: 1.0.0 (Phase 3B Complete)
---
## ๐ Recent Updates - Phase 3B (Jan 29, 2026)
### New Dashboard Tabs (Decision Intelligence)
- **Tab 7: โญ Youth Potential Scoreโข** - KPI metrics, tier distribution, top 20 leaderboard
- **Tab 8: ๐ Retention Analytics** - Retention gauge (65%โ85%), intervention effectiveness
- **Tab 9: ๐ Skill Development** - Role analyzer, learning paths, skill requirements
### Youth Dashboard Enhancements
- **โญ Your Youth Potential Score** - Composite scoring with tier assignment
- **๐ฏ Your Learning Pathway** - 5-stage milestone tracker with progress visualization
### Admin Dashboard Improvements
- **๐จ Churn Prevention Tab** - At-risk students, intervention controls, effectiveness log
### Configuration Exposed
- All Phase 3 features toggleable via `config/settings.py`
- 50+ configuration options for feature tuning
- Complete settings for all 5 AI features
### Documentation
- `PHASE_3B_COMPLETION.md` - Complete feature guide (451 lines)
- `PROJECT_STATUS.md` - Overall project overview (437 lines)
- Git history with 5 well-documented commits
### Status
โ
**Phase 3B Complete** - Dashboard integration finished
๐ **Ready for UAT** - All features tested and deployed
๐ **Project 80% Complete** - 4 phases delivered, Phase 4 (Testing) recommended next