An open API service indexing awesome lists of open source software.

https://github.com/huzefaaa2/mb


https://github.com/huzefaaa2/mb

Last synced: 5 months ago
JSON representation

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.**

![Platform Status](https://img.shields.io/badge/Status-Active-brightgreen) ![Python](https://img.shields.io/badge/Python-3.11-blue) ![Streamlit](https://img.shields.io/badge/Streamlit-1.28-red) ![Azure](https://img.shields.io/badge/Azure-Blob_Storage-blue)

## ๐Ÿ“‹ 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