Enterprise Ride-Hailing Platform

Enterprise Ride-Hailing Platform

Enterprise Ride-Hailing Platform

The Challenge

The client needed a full-featured, scalable ride-hailing platform capable of managing the complete lifecycle of a taxi/ride-sharing business — from rider booking and real-time driver tracking to complex financial settlements across multiple stakeholders (individual drivers, fleet companies, and business partners). The platform had to support multi-language (Arabic/English), multi-region operations, multiple payment gateways, and real-time communication between all parties.

Our Approach

We designed a Clean Architecture with strict separation of concerns across 6 projects:

Layer

Components

Scale / Notes

Presentation Layer

API; Admin; Web Portal

API: 109+ endpoints | Admin: 72 modules | Web Portal: 12 pages

IoC

Dependency Injection Container

Central wiring for services/repos/handlers

Data Layer

Services; Repositories; CQRS

50+ services | 88+ repositories | CQRS (Read/Write DB)

Domain Layer

Entities; Business Models

444 entities + business rules



What We Delivered

  1. REST API (109+ Endpoints, Versioned v1/v2)
    • Authentication: OTP-based login, JWT tokens, refresh/revoke cycle
    • Trip Management: On-demand and scheduled rides with real-time pricing
    • Payment Processing: Card, Wallet, Cash, STC Pay with webhook integration
    • Driver Operations: Registration, car assignment, earnings, settlements, withdrawals
    • Rider Experience: Favorites, coupons, vouchers, ratings, trip history
    • Location Services: Geofencing, heatmaps, driver tracking
    • Privacy: Number masking between driver and rider
  2. Admin Dashboard (72 Controllers, 363 Views)
    • Operations Center: Real-time trip monitoring, driver tracking, heatmap visualization
    • User Management: Driver registration approval, rider management, company onboarding
    • Fleet Management: Vehicle types/categories/models, car assignments, operation cards
    • Financial Hub: Settlements, wallet management, transaction logs, profit distribution
    • Geographic Config: Multi-region setup, city-to-city rates, geofence boundaries
    • Marketing Tools: Coupons, vouchers, banners, blogs, custom notifications
    • Partner Portal: Business partner management with employee and preference controls
    • Bulk Operations: Excel import/export for drivers, companies, and operation cards
  3. User-Facing Web Portal (12 Pages, 59 Views)
    • Bilingual landing page (Arabic/English)
    • Account management with OTP verification
    • Trip history and payment processing
    • Partner and company information pages

Technical Highlights

  • Real-Time Architecture
    • Google Firestore for live trip state, driver location, and pricing updates
    • Firestore-backed trip documents storing pickup/destination, route history, payment status, and driver earnings in real-time
  • CQRS Pattern
    • Separate WriteDbContext and ReadDBContext for optimized database operations
    • PostgreSQL with retry-on-failure for resilience
  • Payment Engine (Strategy Pattern)
    PaymentMethodFactory
    ├── CashPaymentMethod
    ├── CardPaymentMethod (Copy-and-Pay + IPN webhooks)
    ├── WalletPaymentMethod
    ├── STCPaymentMethod
    └── BusinessCardMethod
            
    • Multi-version profit distribution (V1: simple commission, V2: advanced split with DriverOwnToApp, DriverOwnToCompany)
    • Automated refund processing, VAT calculation, and invoice PDF generation
  • Dynamic Pricing
    • Distance and time-based calculation synced to Firestore
    • Region-specific pricing rules
    • Coupon/promo discount engine with automatic application
  • Notification System (Factory Pattern)
    • AWS SNS for push notifications
    • In-app notification center with user preference management
    • Targeted custom notifications by user segment
    • Coupon and voucher notification strategies
  • Background Processing
    • Hangfire with PostgreSQL for scheduled jobs
    • Automated settlement processing
    • Scheduled trip publishing

Design Patterns Implemented

┌──────────────────────┬───────────────────────────────────────────────────────┐
│ Pattern              │ Usage                                                 │
├──────────────────────┼───────────────────────────────────────────────────────┤
│ Clean Architecture   │ 6-project layered structure                           │
├──────────────────────┼───────────────────────────────────────────────────────┤
│ CQRS                 │ Dual Read/Write database contexts                     │
├──────────────────────┼───────────────────────────────────────────────────────┤
│ Repository           │ 88+ repository interfaces with implementations        │
├──────────────────────┼───────────────────────────────────────────────────────┤
│ Strategy             │ Payment methods, notification types, order processing │
├──────────────────────┼───────────────────────────────────────────────────────┤
│ Factory              │ Notifications, order types                            │
├──────────────────────┼───────────────────────────────────────────────────────┤
│ Mediator (MediatR)   │ Decoupled request/handler communication               │
├──────────────────────┼───────────────────────────────────────────────────────┤
│ Dependency Injection │ Centralized IoC container                             │
├──────────────────────┼───────────────────────────────────────────────────────┤
│ Middleware Pipeline  │ Custom auth, rate limiting, security, language checks│
└──────────────────────┴───────────────────────────────────────────────────────┘

Key Metrics

┌─────────────────────┬────────────────┐
│ Metric              │ Value          │
├─────────────────────┼────────────────┤
│ Total Commits       │ 2,384          │
├─────────────────────┼────────────────┤
│ Team Size           │ 10+ developers │
├─────────────────────┼────────────────┤
│ API Endpoints       │ 109+           │
├─────────────────────┼────────────────┤
│ Admin Modules       │ 72             │
├─────────────────────┼────────────────┤
│ Domain Entities     │ 444            │
├─────────────────────┼────────────────┤
│ Database Migrations │ 150+           │
├─────────────────────┼────────────────┤
│ Admin Views         │ 363            │
├─────────────────────┼────────────────┤
│ Repositories        │ 88+            │
├─────────────────────┼────────────────┤
│ Business Services   │ 50+            │
├─────────────────────┼────────────────┤
│ NuGet Packages      │ 40+            │
└─────────────────────┴────────────────┘

Cloud & Infrastructure

┌──────────────┐   ┌──────────────┐   ┌──────────────┐
│ AWS S3       │   │ AWS SNS      │   │ AWS CodeDeploy│
│ File Store   │   │ Push Notif   │   │ CI/CD Deploy  │
└──────┬───────┘   └──────┬───────┘   └──────┬───────┘
        │                  │                  │
        └───────────┬───────┴───────────────────┘
                    ┌──────▼───────┐
                    │ .NET 7 App   │
                    └──────┬───────┘
                           │
                    ┌───────────┼───────────┐
                    │           │           │
                    ┌──────▼──┐ ┌────▼────┐ ┌───▼──────┐
                    │PostgreSQL│ │Firestore│ │ Hangfire │
                    │Read/Write│ │Realtime │ │ Jobs DB  │
                    └─────────┘ └─────────┘ └──────────┘
  • CI/CD: Azure Pipelines → S3 Upload → AWS CodeDeploy (API, Admin, Web independently)
  • Image Processing: Imageflow server-side optimization with S3 storage
  • Geolocation: MaxMind GeoIP2 for IP-based location detection

Business Impact

  • Multi-stakeholder platform serving Riders, Drivers, Companies, Partners, and Admins
  • Scalable multi-region deployment supporting different cities with independent pricing
  • Comprehensive financial engine handling commissions, settlements, wallets, and multi-payment methods
  • Real-time operations with live tracking, instant pricing, and push notifications
  • Enterprise admin tooling with 72 management modules and bulk import capabilities