Skip to main content
Mohamed Noor
Back to work
SaaS Development

TravelGrid Africa Travel Commerce Platform

A multi-tenant travel platform designed around flight, hotel and car booking workflows, where agent and corporate organisations share one prepaid wallet and every debit has to be correct under concurrency, replay and rollback.

Role
Sole developer
Period
2026
Stack
  • TypeScript
  • Node.js
  • Express.js
  • PostgreSQL
  • Drizzle
  • Next.js
  • React
  • Better Auth
  • Paystack
  • Docker
The TravelGrid Africa home page: a dark blue hero reading Explore Africa, Travel Smarter, above a white search panel with tabs for flights, hotels and cars and fields for origin, destination, dates, passengers and cabin class.

Measured

  • 357

    Automated server tests

    Across 39 suites, run against a real Postgres database on 5 October 2026, alongside 739 frontend tests. The financial set proves webhook replay cannot double-credit, and two concurrent bookings against one unit of inventory yield exactly one booking.

  • Postgres RLS

    Tenant isolation

    rlsIsolation.test.ts connects as a dedicated non-superuser role and proves a forgotten filter still cannot return another tenant's rows. The API refuses to boot in production if its role would bypass the policies.

  • Atomic

    Wallet debits

    An insufficient balance rolls the inventory decrement back in the same transaction, proved in the integration suite rather than asserted.

Overview

TravelGrid Africa is a wallet-first travel commerce platform for flights, hotels and cars. Guests and customers book and pay at checkout. Travel agents and corporate travel desks join as organisations that share one prepaid wallet, invite their own members, and, for agents, earn commission on what they sell. An admin console runs the platform.

The Problem

Travel agents and corporate travel desks do not buy the way a consumer does. They top a balance up once and draw against it all month, several people book on the same account, and an agent earns commission on what they sell. That turns a booking flow into a financial system: money moves before inventory is confirmed, two people can book the last seat at the same moment, and a payment provider will happily deliver the same webhook twice.

The Solution

The platform treats a booking as a financial transaction first. An organisation's wallet sits on an append-only ledger, inventory and the wallet debit move together in one database transaction, and payment webhooks are verified and replay-safe before anything is credited or confirmed.

Provider integration was designed as a seam from the start. The normalised flight, hotel and vehicle models mirror the shapes the real GDS APIs return, Amadeus offers for flights and hotels and Travelport for vehicles, so wiring the live providers changes nothing above the seam.

Key Features

Everything a guest, an organisation and an operator needs to book, pay, and keep the books straight.

  • Flight, hotel and car search and booking, including round-trip flights
  • Guest checkout through Paystack, with self-service by secure link for e-tickets, invoices and cancellation
  • Organisation wallets shared across members, with single-use, email-bound invites
  • Agent commission, with the rate snapshotted at sale
  • Invoices and e-tickets as PDFs, and notifications by email
  • An admin console for bookings, refunds, organisations and their applications, wallets, commissions, audit logs and a failed-email, refund and webhook error queue

Architecture

Two services from two Docker images: an API on Node, TypeScript, Express 5 and Drizzle over Postgres, and a web app on Next.js 16 with the App Router. The web app calls the API on its own origin, and both are stateless.

Folders are layers and a filename carries its role, so one resource reads as a matching set of router, controller, service and validators. Controllers stay thin. Services own the business rules and every transaction boundary. Repositories hold Drizzle queries only, including the conditional updates that make an inventory decrement and a wallet debit atomic.

  • Tenant isolation enforced twice: every query is scoped in the application, and a request-pinned connection carries the tenant into Postgres row-level security
  • Better Auth sessions in an httpOnly, SameSite=Lax cookie, with optional Google sign-in and no credential in localStorage
  • Paystack webhooks verified by HMAC-SHA512 before anything is trusted
  • An append-only ledger, with database constraints as the backstop rather than the plan

Engineering Challenges

The hard parts are the ones a screenshot never shows, so each was handled where it cannot be forgotten: in a transaction, a constraint, or a test that provokes the failure.

  • Concurrency: two bookings racing for one unit of inventory must yield exactly one booking
  • Payments and webhooks: a replayed webhook must never credit or confirm twice
  • Data integrity: an insufficient balance rolls the inventory decrement back in the same transaction
  • Multi-tenancy: Postgres exempts superusers from row-level security, so the API connects as a dedicated non-superuser role and refuses to boot in production if its role could bypass the policies
  • Commission history: rates are snapshotted at sale, so a later rate change cannot rewrite what an agent earned
  • Connection pinning: every authenticated request holds one pooled connection to carry its tenant, which makes the pool size a concurrency ceiling to plan for rather than a default

Testing

357 backend tests across 39 suites, with Vitest and Supertest against a real Postgres test database, and 739 frontend tests across 69 files with Testing Library. Both suites passed in full on 5 October 2026.

CI runs lint, typecheck, test and build for both packages on every push, with the backend's integration suites running against a real postgres:16 service.

  • Webhook replay proved unable to double-credit or double-confirm
  • Two concurrent bookings against one unit of inventory yield exactly one booking
  • Commission rates proved immutable after sale, and commission approval idempotent
  • Tenant isolation tested from a non-superuser connection, where row-level security actually applies

Technology

Chosen for a financial system that has to stay correct as it grows, and for a codebase another developer can pick up.

  • Backend: Node.js, TypeScript, Express 5, Zod
  • Database: PostgreSQL with Drizzle ORM and drizzle-kit migrations
  • Frontend: Next.js 16, React 19, Tailwind CSS, shadcn/ui, TanStack Query
  • Authentication: Better Auth, with Google sign-in
  • Payments: Paystack
  • Email and storage: Resend, and Cloudinary for private documents behind signed, expiring links
  • Infrastructure: Docker images on Railway, CI on GitHub Actions

My Role

Role: Sole developer. I was responsible for the architecture, frontend, backend, database, authentication, payment integration, testing and deployment.

Outcome

Agents and corporate travel desks can book against one shared prepaid balance with every debit accounted for, guests can book and manage a trip without an account, and operators can see and correct the money from one console.

The financial and multi-tenancy behaviour is proved rather than described, by 1,096 automated tests across the two packages, and the platform runs as two stateless services on Railway.

Need something like this built?

Tell me what you are building. You can send a brief, a Figma file or a short description, and you will get a reply within one business day with a practical way to approach it.