Back

Case study

Aara Trips

Multi-Tenant Fleet SaaS

aaratrips.com

Visit live site

Product preview

Screenshots

Overview

Architected Aara Trips — a multi-tenant fleet SaaS with NestJS and Prisma on PostgreSQL, public discovery and enquiry dedupe, trip and tour operations with driver provisioning, fleet analytics, Razorpay billing and GST invoices, Socket.IO realtime, Firebase push, cloud object storage, and Docker deployment on a shared platform edge.

Problem & goal

The Challenge

Travelers need a trustworthy way to compare fleet vehicles, taxi rates, and tour packages across operators. Fleet owners need one system for listings, enquiries, trip and tour dispatch, driver assignment, odometer-based billing, and subscription billing — without spreadsheets and phone-only coordination.

Aara Trips runs a three-sided marketplace SaaS: consumers discover and enquire, fleet partners convert leads into trips and tours on a tenant workspace, and platform operators onboard, verify, and monetize fleet tenants.

Target users

Who It's For

  • Consumers — search and discover vehicles, taxi rates, and tour packages; wishlist, compare, submit enquiries, and track status

  • Fleet partners — manage vehicles, drivers, rates, packages, enquiries, trips, tours, analytics, and Razorpay billing

  • Drivers — view assigned vehicles and access a limited fleet portal via provisioning invites

  • Platform admins — fleet verification, tenant and user management, plans, subscriptions, and roles

Core capabilities

Platform Modules

Auth & portals

Secure login with Google OAuth and phone verification, with distinct customer, fleet, driver, and platform operator portals.

Discovery

Public vehicle search, taxi rates, tour packages, top routes, and branded partner storefront pages.

Enquiries

Lead capture with dedupe rules, availability checks, and a status workflow that converts to trips or tours.

Fleet operations

Vehicles, drivers, assignments, trips, tours, odometer readings, and fare component tracking.

Analytics

Fleet and driver summaries, revenue, conversion rates, and utilization charts for operational insight.

Billing

Razorpay checkout, payment webhooks, GST invoices, and entitlement-driven feature gates.

Platform admin

Fleet partner verification, tenant lifecycle, user management, and plan catalog administration.

Real-time

Live updates to users, tenants, and admins via a real-time gateway for enquiries and trip events.

Notifications

Firebase push and transactional email for verification, invitations, and operational alerts.

High-level design

System Architecture

The platform ships as three deployable applications sharing one domain model: a Next.js customer app for marketplace discovery and fleet portal operations, a Next.js admin console for platform governance, and a NestJS API handling versioned REST endpoints and a real-time gateway. PostgreSQL stores tenant-centric fleet data with Prisma. Redis provides BullMQ background job queue infrastructure ready for async mail, notifications, payments, and file processing. Customer and admin frontends proxy API requests same-origin in production.

External integrations include DigitalOcean Spaces for presigned media uploads, Razorpay for payments, Resend for email, Firebase for push notifications, and Puppeteer for GST invoice PDF generation. Each fleet partner is an isolated tenant workspace with vehicles, drivers, and operational data scoped by tenant. Secure authentication with role-based access, portal-scoped registration guards, and webhook signature verification protect tenant data and platform operations.

Production stack

Technology Stack

Frontend

  • Next.js
  • React.js
  • TypeScript
  • TanStack Query
  • Recharts

Backend

  • NestJS
  • Express
  • Prisma
  • Socket.IO

Data & messaging

  • PostgreSQL
  • Redis
  • Firebase Cloud Messaging

Infrastructure

  • Docker
  • Shared platform edge TLS
  • DigitalOcean Spaces
  • Razorpay

Public catalog

Marketplace & Discovery

Vehicle search

Unauthenticated search with discover facets on vehicle segment and type for fast marketplace browsing.

Taxi rates & packages

Public taxi rate cards by trip type and tour package listings with top routes for consumer discovery.

Partner storefronts

Branded fleet partner pages by slug so operators can share a direct link to their catalog.

Wishlist & compare

Authenticated consumers save vehicles, rates, and packages to wishlist and side-by-side compare views.

Fleet dispatch

Trip & Tour Operations

Trip types

Local, drop, round trip, outstation, and airport transfer jobs with distinct fare rules per type.

Job lifecycle

Upcoming, ongoing, completed, and cancelled statuses with pickup, drop, scheduled time, and passenger details.

Odometer billing

Start and end odometer readings with distance, per-km pricing, driver allowance, night charges, and waiting charges.

Enquiry conversion

Confirmed enquiries link to a trip or tour record with rate card copied at booking time.

Driver provisioning

Fleet partners invite drivers to the tenant portal with email invitations and limited portal access.

Lead pipeline

Enquiry & CRM

Status workflow

Enquiries progress from new through contacted, quoted, and confirmed to closed or rejected.

Dedupe rules

Location-normalized fingerprint prevents duplicate active enquiries for the same travel intent and blocks re-enquiry while a confirmed job is in progress.

Fleet customer records

CRM record per tenant and mobile number, linked to registered users when present.

Pre-submit checks

Availability and contact validation before enquiry submit to reduce junk leads.

Subscriptions & invoices

Billing & Entitlements

Plan catalog

Monthly and yearly plans with free tier, trial days, and feature caps managed from the admin console.

Razorpay checkout

Order creation, client-side checkout, payment signature verification, and webhook processing.

GST invoices

Puppeteer-rendered invoice PDFs with fleet billing profile and paise-accurate GST calculation.

Entitlement sync

Tenant features update on plan change with expiry and past-due handling for subscription lifecycle.

Live updates

Real-Time & Notifications

User and tenant rooms

Real-time gateway fans out enquiry, trip, and admin events to user, tenant, and admin channels.

Firebase push

Device token registry with multicast delivery for operational alerts.

Transactional email

Verification, invitations, and driver invite emails via Resend.

Challenges solved

Engineering Highlights

01

Duplicate enquiries from repeat clicks

Location-normalized fingerprint with status-aware blocking rules per enquiry and active job state.

02

Taxi vs tour product shapes

Separate trip and tour models with shared enquiry conversion paths and distinct fare fields.

03

Fleet partner trust on marketplace

Verification workflow from draft through pending review to approved with admin audit events.

04

Multi-portal auth confusion

Portal registration guards and distinct roles for customer, fleet partner, and driver access.

05

Driver access without full fleet admin

Driver provisioning invites that link portal users to driver records with scoped permissions.

06

Payment webhook tampering

Signature verification on payment webhook payloads before subscription state changes.

07

Vehicle search UX at scale

Denormalized vehicle segment and leaf facets with a dedicated discover endpoint for fast filtering.

Built for production load

Performance & Scale

  • Denormalized vehicle facets avoid parsing type strings at query time on public search

  • Presigned cloud storage URLs offload image and document serving from the API

  • Stateless API scales horizontally behind shared platform edge nginx

  • Tenant-scoped queries isolate fleet data with no cross-tenant joins

  • TanStack Query cache on customer and admin apps with targeted invalidation on mutations

  • Background job queue infrastructure ready for async mail, notifications, and payments

  • Pagination and period filters on fleet list and analytics endpoints

Operations

Deployment

The production stack runs in Docker containers — database, cache, API, customer app, and admin console — on a shared platform edge network with automated TLS. Health checks on core services, scheduled database backups, and Asia/Kolkata timezone defaults support ongoing operations. Prisma migrations and seed scripts manage schema evolution.

Roadmap

What's Next

  • Background job workers for mail, notifications, payments, and file processing

  • Socket room authorization with tenant membership validation on subscribe

  • Live GPS and trip tracking for ongoing jobs from driver apps

  • Customer payment links on quoted enquiries before confirmation

  • Full-text search index across vehicles, routes, and packages

  • WhatsApp enquiry notifications for fleet operators on new leads

  • Multi-city marketplace with geo indexes on service areas

  • Native mobile apps consuming the same portal APIs