🚐 Matatu Booking System — Modern Public Transport Platform
🎯 Project Overview
The Matatu Booking System is a comprehensive transportation management platform that streamlines public transport booking, vehicle management, and payment processing across Kenya. The system enables commuters to search for available matatus, book seats in real-time, make secure M‑Pesa payments, and receive instant booking confirmations — transforming the traditionally informal matatu industry into a modern, data‑driven transport ecosystem.
Impact: 200+ active routes · 10,000+ M‑Pesa transactions · 99.8% payment verification rate · 40% reduction in passenger wait times
Core Features
🔍 Trip Search & Booking
- Advanced search with origin, destination, date, departure/arrival time, and vehicle type filters
- Amenity‑based filtering: Air Conditioning, WIFI, USB charging ports
- Real‑time seat selection and reservation with conflict prevention
- QR code generation for digital ticket verification at boarding
- Instant booking confirmation via email and SMS notifications
💳 M‑Pesa Payment Integration
- Seamless Safaricom Daraja API integration for M‑Pesa STK Push payments
- Automated payment verification through M‑Pesa callback endpoints
- Complete transaction history tracking and receipt generation
- Support for both M‑Pesa and card payment methods
📱 Passenger Dashboard
- Overview of total bookings, upcoming trips, completed trips, and total spend
- Quick actions: Find Trip, My Bookings, Profile, Notifications
- Upcoming trip management with cancellation and rescheduling capabilities
- Recent activity feed and popular routes discovery
⚡ Real‑time Features
- WebSocket‑powered live tracking of vehicle locations on map
- Instant booking status updates and driver‑passenger communication channels
- Firebase Cloud Messaging for push notifications and SMS reminders
- Real‑time seat availability updates across concurrent users
⚙️ Settings & Notifications
- Granular notification preferences: Email, Push, SMS, and Marketing emails
- Security settings, privacy controls, and account danger zone
- Profile management with verification workflows
🗺️ Route Coverage
| City | Routes | Major Termini Covered |
|---|---|---|
| Nairobi | 80+ | CBD, Westlands, Thika Road |
| Kisumu | 35+ | Bus Park, Kondele, Kibos |
| Mombasa | 40+ | Likoni, Nyali, Mtwapa |
| Nakuru | 25+ | Clock Tower, Lanet |
| Eldoret | 20+ | Town Centre, Annex |
Plus: Dynamic route suggestions based on popularity and availability, with real‑time stage point updates.
🏆 Key Achievement
🎯 Successfully processed 10,000+ M‑Pesa transactions with 99.8% payment verification rate
Result: Reduced passenger wait times by 40% at major termini across Nairobi, Kisumu, Mombasa, Nakuru, and Eldoret.
🛠️ Tech Stack at a Glance
| Layer | Technology |
|---|---|
| Backend | Django 4.2.7 |
| API | Django REST Framework 3.14.0 |
| Frontend | React Native (Mobile) |
| Database | PostgreSQL |
| Caching | Redis 5.0.1 |
| Task Queue | Celery 5.3.4 |
| Real‑time | Django Channels + WebSockets |
| Auth | JWT + django‑allauth |
| Payments | M‑Pesa Daraja API |
| Notifications | Firebase Cloud Messaging |
| Storage | AWS S3 (django‑storages) |
| Monitoring | Sentry SDK |
| Deployment | Gunicorn + Whitenoise + Docker |
🔗 How It All Works Together
| Component | Role |
|---|---|
| Django Backend | Handles business logic, user authentication, and API endpoints |
| Django REST API | Exposes endpoints for mobile app communication |
| WebSockets | Enables live seat updates and driver location streaming |
| Celery + Redis | Processes payment callbacks, email/SMS jobs, and QR generation |
| M‑Pesa Daraja | Executes STK Push and verifies payments asynchronously |
| Firebase FCM | Delivers push notifications for trip reminders and updates |
| PostgreSQL | Stores user data, bookings, routes, and transaction history |
📈 Performance Metrics
| Metric | Value |
|---|---|
| Daily Transactions | 200+ |
| Payment Success Rate | 99.8% |
| Booking Confirmation Time | < 2 seconds |
| WebSocket Latency | < 100ms |
| Database Query Time | < 50ms (cached) |
| Uptime | 99.95% |
| Active Users (Monthly) | 8,500+ |
| Active Vehicles | 400+ |
| Routes Covered | 200+ |
Project Gallery


