Haithem Mustafa
Loading
Back to projects
Freelance · 2025

Beeb

Ride-hailing backend in Rust

In development · no public link
Overview

The backend for Beeb, a ride-hailing platform (think Uber / Careem for Baghdad). A single Rust service built on Axum with domain-driven design, real-time trip dispatch, and geospatial matching over PostGIS, serving an admin dashboard and the rider and captain apps.

RoleBackend Developer
Year2025
Stack
  • Rust
  • Axum
  • PostgreSQL
  • PostGIS
  • SQLx
  • Redis
  • WebSockets
  • JWT
  • FCM
  • MinIO
  • Docker
The build
  1. 01Built the service in Rust with Axum, organized as 14 domain-driven modules (trips, captains, payment, zone, realtime, scheduling, identity, privacy, reports, and more), each split into domain / presentation / infrastructure layers.
  2. 02Designed the data layer with raw SQLx (compile-time checked queries) over PostgreSQL with the PostGIS extension — 33 migrations, 33 tables, and 23 enums — using ST_Contains for zone polygon matching and proximity-based dispatch.
  3. 03Built real-time trip flow over WebSockets with a Redis pub/sub bridge, pushing live status, location updates, and room membership between riders and captains.
  4. 04Implemented the trip lifecycle: base + distance + time fares, per-zone cancellation penalties, scheduled and recurring multi-stop trips, and per-rider fare breakdowns.
  5. 05Built the payment layer: a wallet ledger, card and cash methods, and a refund cascade with admin override.
  6. 06Built captain onboarding: document upload to MinIO via presigned URLs, an auto-approval engine, and a compliance-based daily activation gate.
  7. 07Ran 12 background workers / sweepers — OTP SMS, trip dispatch, force-cancel, room expiry, push via Firebase, location-staleness checks, the WebSocket↔Redis bridge, and more.
  8. 08Added JWT + OTP-SMS auth, rate limiting (tower-governor), number-proxy privacy for anonymized rider↔captain calls, OpenAPI/Swagger docs via utoipa, and Docker + systemd deployment.
  9. 09Built analytics rollups (revenue by zone, captain leaderboard, cancellation patterns, daily activation) and admin hardening: audit logs, session revocation, and bulk actions.
Highlights
Back to projects