Energy retail SaaS

Fuel Retail Operations Platform

Multi-tenant petrol station SaaS—station and admin portals with Hono CQRS APIs on Supabase.

Fuel Retail Operations Platform project preview

Background & Context

Pakistani petrol stations need more than spreadsheets for pumps, nozzles, attendant shifts, sales, cash reconciliation, tank dips, and vehicle credit accounts. Station staff and platform operators need different tools on one coherent tenant model—attendants capture sales under pressure; managers reconcile; owners review trends; platform admins manage tenants and roles.

Tekvers built Petrol Pump Manager as an npm-workspaces monorepo: Next.js 15 station PWA (client-portal) and admin portal, paired Hono CQRS APIs (client-api, admin-api), and Supabase Auth + Postgres 15 with RLS. Station profiles carry tenant_id and roles (attendant | manager | owner); platform operators live in platform_admins and use the service-role client for cross-tenant work. Fuel types include petrol, hi-octane, diesel, and CNG.

Offline-capable flows matter on the forecourt: IndexedDB (ppm-offline) queues start_shift, close_shift, and create_transaction mutations for replay. Optional Google Cloud Vision assists meter OCR; Meta WhatsApp Cloud API can alert on shift-closed events; PDFKit supports shift reports; Recharts powers sales trend views. Billing/SaaS subscriptions and full cancel-shift workflows are explicitly out of scope in source.

The Challenge

Multi-site fuel retailers needed tenant-isolated station operations—shifts, nozzle sales, reconciliation, inventory dips, and credit accounts—plus a separate platform admin plane, without forcing one bloated UI on every role.

The Solution

Fuel Retail Operations Platform: Multi-tenant petrol station SaaS—station and admin portals with Hono CQRS APIs on Supabase. Clear separation of station operations vs platform administration. Tekvers delivered a maintainable energy retail saas system for Fuel Retail Operations Platform using Next.js, Hono, Supabase, TypeScript, with phased rollout, operator workflows, and documentation suited to long-term ownership.

Our Approach

  1. Command/query separation

    Hono adapters call CQRS command and query handlers so station writes (start/close shift, create sale) stay auditable while list/reconciliation reads stay focused—domain services compute cash and liter variance flags against tolerances.

  2. Dual portals on shared tenancy

    Station UI focuses on pumps, shifts, transactions, credit, dips, and reports; admin UI operates tenants, user roles, and overview stats via service role—RLS isolates station tables for tenant users.

  3. Forecourt resilience and assistive integrations

    PWA + IndexedDB offline queue covers core shift/transaction capture; Vision OCR and WhatsApp hooks add meter assist and closed-shift notifications without blocking the ops MVP.

What We Delivered

  • Station Next.js PWA portal (owner / manager / attendant)
  • Platform admin Next.js portal
  • Hono CQRS station API and admin API
  • Supabase Auth, Postgres schema, migrations, and RLS policies
  • Pump/nozzle configuration and meter update flows
  • Shift start/close with cash reconciliation and variance flags
  • Sales transactions (cash / card / credit) scoped to open shifts
  • Vehicle credit accounts with charge/payment ledger entries
  • Tank inventory dip workflows and sales reporting charts
  • Optional Google Vision OCR and WhatsApp shift-closed alerts
  • PDFKit shift reporting and IndexedDB offline mutation queue

Outcomes & Impact

  • Clear separation of station operations vs platform administration
  • Auditable shift and sales commands with tenant isolation
  • Offline-capable capture for core forecourt mutations
  • Multi-site foundation for retail fuel networks in Pakistan

Attendants run shifts from a purpose-built PWA while leadership and platform operators see the network—reconciliation and credit stop living only in notebooks, and the architecture stays honest about what is not yet billed as SaaS subscriptions.

Technology Stack

  • Next.js
  • Hono
  • Supabase
  • TypeScript
  • Google Cloud Vision
  • WhatsApp

Services Delivered

Guides & articles from this niche

Planning a similar platform? Share your scope and we will map architecture, delivery phases, and a realistic timeline.