We4You — Taxi Booking Platform

End-to-end ride booking, assignment, and management system.

Last updated: Sept 18, 2025

🚖 Taxi Booking Flow

1. Authentication

Secure login with JWT, role-based users (employees, drivers, admins, doctors).

2. Ride Request

User books a taxi, enters pickup & drop location.

3. Driver Assignment

Nearest driver assigned via Redis GEO + ride persisted in MongoDB.

4. Real-time Tracking

Driver location updated with MQTT + Socket.IO.

5. Notifications

Firebase Cloud Messaging alerts users & drivers of updates.

6. Ride Management

Driver dashboard shows active/upcoming/completed rides.

✨ Key Features

Chat System

One-to-one chat with unread counts, last message tracking, stored in MongoDB.

CRM & Analytics

Customer tracking, automated follow-ups, and sales insights.

🛠 Tech Stack

Backend

  • FastAPI (Python)
  • MongoDB (bookings, messages)
  • Redis GEO (nearest driver)

Real-time

  • MQTT (driver telemetry)
  • Socket.IO (chat + live updates)
  • FCM (push notifications)

Frontend & Ops

  • Next.js + TypeScript
  • Tailwind CSS
  • Docker + Nginx
  • GitHub Actions (CI/CD)

We4You — Complete Project Summary

End-to-end ride booking and employee transport platform — detailed breakdown of modules, flow, and technology.

Updated: Sept 18, 2025

📖 Project Overview

We4You is a comprehensive taxi booking and employee transport solution built to manage real-time ride allocation, driver tracking, chat, and sales/CRM features. The platform was designed with scalability and real-world constraints in mind, such as nearest-driver assignment, low-latency communication, and reliable notifications. The system supports multiple roles (employees, drivers, admins, doctors) with role-based access and workflow segregation.

🚖 Complete Taxi Booking Flow

  1. User Authentication: Employees, doctors, and admins log in using JWT. Tokens are validated on each API request.
  2. Ride Request: A user provides pickup and drop locations. The system validates constraints (timing, availability, employee eligibility).
  3. Driver Discovery & Assignment: Redis GEO queries find the nearest available driver within a configurable radius. If no driver is found, fallback expansion occurs. Ride details are saved in MongoDB.
  4. Ride Confirmation: Notifications sent via Firebase Cloud Messaging to driver and user. Ride status transitions to assigned.
  5. Real-time Tracking: Driver coordinates stream in via MQTT, relayed through Socket.IO to the passenger's client app.
  6. In-ride Communication: Secure one-to-one chat between user and driver (stored in MongoDB with unread counts).
  7. Ride Completion: Driver marks ride as completed. Status updated in MongoDB and analytics recorded for reporting.

🧩 Core Modules

Authentication & Roles

Secure login flow with JWT. Supports drivers, employees, admins, and doctors with role-based authorization. Includes refresh token rotation.

Ride Booking & Assignment

Booking APIs allow users to request rides. Redis GEO used for efficient nearest driver search. MongoDB persists booking and ride lifecycle states.

Real-time Tracking

Drivers publish coordinates to MQTT broker. FastAPI + Socket.IO broadcasts live updates to passengers. Ensures sub-second location refresh.

Chat System

Secure user-driver messaging. Messages stored with sender/receiver IDs, timestamps, last message per room, and unread counters.

Notification Service

Firebase Cloud Messaging integration. Dynamic function to send push notifications to targeted drivers or employees based on ride events.

CRM & Analytics

Customer tracking, automated follow-ups, sales performance insights. Optimized DB queries reduced latency by 45% for CRM workflows.

🛠 Detailed Tech Stack

Backend

  • FastAPI (Python) — API backend
  • MongoDB — bookings, messages, ride states
  • Redis (GEO) — nearest driver search, caching
  • Nginx + Docker — containerized deployment

Real-time Layer

  • MQTT — driver telemetry
  • Socket.IO (ASGI) — chat & live ride updates
  • Firebase Cloud Messaging — notifications

Frontend & DevOps

  • Next.js + TypeScript — frontend UI
  • Tailwind CSS — utility-first styling
  • GitHub Actions — CI/CD pipeline
  • Docker Compose — local orchestration

⚡ Challenges & Solutions

  • Nearest Driver Search: Solved with Redis GEO queries and radius expansion fallback for high availability.
  • Real-time Communication: Combined MQTT (lightweight driver telemetry) with Socket.IO (chat + updates).
  • Chat Query Performance: Implemented compound indexes + pagination in MongoDB for efficient message retrieval.
  • CRM Scalability: Refactored queries and caching, improving latency by 45% and retrieval speeds by 35%.
© 2026 We4You — Detailed Project Summary