Duplicate enquiries from repeat clicks
Location-normalized fingerprint with status-aware blocking rules per enquiry and active job state.
Case study
Multi-Tenant Fleet SaaS
aaratrips.com
Product preview
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
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
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
Secure login with Google OAuth and phone verification, with distinct customer, fleet, driver, and platform operator portals.
Public vehicle search, taxi rates, tour packages, top routes, and branded partner storefront pages.
Lead capture with dedupe rules, availability checks, and a status workflow that converts to trips or tours.
Vehicles, drivers, assignments, trips, tours, odometer readings, and fare component tracking.
Fleet and driver summaries, revenue, conversion rates, and utilization charts for operational insight.
Razorpay checkout, payment webhooks, GST invoices, and entitlement-driven feature gates.
Fleet partner verification, tenant lifecycle, user management, and plan catalog administration.
Live updates to users, tenants, and admins via a real-time gateway for enquiries and trip events.
Firebase push and transactional email for verification, invitations, and operational alerts.
High-level design
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
Public catalog
Unauthenticated search with discover facets on vehicle segment and type for fast marketplace browsing.
Public taxi rate cards by trip type and tour package listings with top routes for consumer discovery.
Branded fleet partner pages by slug so operators can share a direct link to their catalog.
Authenticated consumers save vehicles, rates, and packages to wishlist and side-by-side compare views.
Fleet dispatch
Local, drop, round trip, outstation, and airport transfer jobs with distinct fare rules per type.
Upcoming, ongoing, completed, and cancelled statuses with pickup, drop, scheduled time, and passenger details.
Start and end odometer readings with distance, per-km pricing, driver allowance, night charges, and waiting charges.
Confirmed enquiries link to a trip or tour record with rate card copied at booking time.
Fleet partners invite drivers to the tenant portal with email invitations and limited portal access.
Lead pipeline
Enquiries progress from new through contacted, quoted, and confirmed to closed or rejected.
Location-normalized fingerprint prevents duplicate active enquiries for the same travel intent and blocks re-enquiry while a confirmed job is in progress.
CRM record per tenant and mobile number, linked to registered users when present.
Availability and contact validation before enquiry submit to reduce junk leads.
Subscriptions & invoices
Monthly and yearly plans with free tier, trial days, and feature caps managed from the admin console.
Order creation, client-side checkout, payment signature verification, and webhook processing.
Puppeteer-rendered invoice PDFs with fleet billing profile and paise-accurate GST calculation.
Tenant features update on plan change with expiry and past-due handling for subscription lifecycle.
Live updates
Real-time gateway fans out enquiry, trip, and admin events to user, tenant, and admin channels.
Device token registry with multicast delivery for operational alerts.
Verification, invitations, and driver invite emails via Resend.
Challenges solved
Location-normalized fingerprint with status-aware blocking rules per enquiry and active job state.
Separate trip and tour models with shared enquiry conversion paths and distinct fare fields.
Verification workflow from draft through pending review to approved with admin audit events.
Portal registration guards and distinct roles for customer, fleet partner, and driver access.
Driver provisioning invites that link portal users to driver records with scoped permissions.
Signature verification on payment webhook payloads before subscription state changes.
Denormalized vehicle segment and leaf facets with a dedicated discover endpoint for fast filtering.
Built for production load
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
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
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