Internship / backend

Ride-Hailing MVP Backend

A Fastify and TypeScript MVP backend for customer, driver, and administrative ride-hailing workflows.

Period
Aug - Dec 2025
Role
Backend Developer Intern
Delivery
MVP source handover

Overview

Context before technology.

Role-aware access, ride lifecycle handling, location-aware matching, Socket.IO events, Prisma persistence, validation, and operational middleware formed the handover scope.

MVP command and event paths

Persisted commands. Ephemeral notifications.

  1. Clients

    Intended applications

    Customer mobile, driver mobile, and admin web clients are intended consumers; client source is absent.

  2. REST

    Fastify commands

    JWT authentication, role checks, validation, route modules, and Prisma-backed services.

  3. Events

    Socket.IO delivery

    Role rooms for server events plus client-originated ephemeral signals.

  4. Data

    PostgreSQL

    Prisma persistence for user, driver, and ride lifecycle state.

Single-process Fastify and Socket.IO MVP backend. Client integration and deployment are not established by supplied evidence.
  1. 01

    Customer request

    Validate request and customer role

  2. 02

    Estimate trip

    Straight-line Haversine distance and vehicle-based estimated fare

  3. 03

    Persist pending ride

    Create PENDING ride through Prisma

  4. 04

    Find candidates

    Load online drivers then apply in-memory pickup-radius filter

  5. 05

    Notify driver rooms

    Send ride_requested to matched driver rooms

  6. 06

    REST acceptance

    Read-check-update intended to assign first accepting driver

Ride-request and matching flow. Matching is application-memory radius filtering, not route-aware or spatial-database dispatch.

Concurrent acceptance has no transaction, row lock, or conditional pending-state update. Notification delivery is not a durable dispatch guarantee.

  1. 01

    PENDING

    Ride request persisted; customer cancellation path exists.

  2. 02

    ACCEPTED

    Driver REST acceptance intended to assign ride.

  3. 03

    ARRIVED

    Driver arrival command.

  4. 04

    IN_PROGRESS

    Driver start command.

  5. 05

    COMPLETED

    Completion service and rating path; request schema conflict remains.

  6. 06

    CANCELLED

    Customer cancellation from selected pre-completion states.

Implemented lifecycle intent. ON_WAY is declared in source but no inspected route creates it; driver decline leaves PENDING without a persisted decline record.

Lifecycle is MVP behavior, not a transaction-safe state machine. Completion spans multiple writes and route body schemas conflict.

  1. REST

    Persisted command

    DB update then targeted or global server event

  2. Rooms

    Role-room delivery

    Customer or driver rooms receive selected server events

  3. Socket

    Client-originated signal

    Status, location, action, and cancel signals can emit without DB transition

Event-boundary distinction. REST services are database-backed command paths; client-originated Socket.IO handlers are ephemeral signals.

No outbox, retry, replay, or delivery guarantee is implemented. Per-event role and ride-ownership checks are incomplete.

Internship scope

I implemented and handed over the MVP backend during a backend-development internship. The public title stays generic because no product-name disclosure has been approved.

The scope serves customer and driver mobile clients plus an administrative web client at the API and real-time backend boundary.

Backend behavior

The implementation includes role-based authentication, customer and driver flows, straight-line Haversine distance and fare estimation, nearby online-driver filtering, and ride lifecycle operations from request through rating.

Fastify REST services persist command paths through Prisma, then emit selected Socket.IO room events. Client-originated Socket.IO status, location, action, and cancellation signals remain separate from authoritative database transitions.

Evidence boundary

This is MVP source-handover work. No deployment, client-integration, production-readiness, scale, transaction-safety, spatial dispatch, or outcome claim is made.

Meaningful tests exist in source but were not run because the tracked test setup targets a private database and broad cleanup is unsafe.

Working set

Technology serves the system.

  • Node.js
  • TypeScript
  • Fastify
  • PostgreSQL
  • Prisma
  • Socket.IO