Skip to content
01Multi-tenant SaaS2026Live

GymFlow

Gym Management SaaS Platform

A live, commercial multi-tenant SaaS for independent gyms in India. Two product surfaces — an owner console covering members, payments, dues, attendance, inventory and programs, plus a member PWA — sold on its own subscription with a 14-day trial.

0

Shipped modules

0

Product surfaces

0

Subscription tiers

  • Next.js
  • TypeScript
  • PostgreSQL
  • Supabase
  • Tailwind CSS
  • WhatsApp API
GymFlow marketing site hero reading 'Gym management, made effortless' above a product dashboard
01

Problem

Independent gyms in India run on notebooks, a spreadsheet and a WhatsApp thread. Nothing reconciles. A membership lapses and nobody notices until the member stops showing up; the day's cash is counted separately from the UPI screenshots; the register at the front desk only gets filled in when someone remembers. The owner has no answer to the two questions that matter — who owes money, and who is about to leave.

  • Member records split across a notebook, a spreadsheet and chat history
  • Renewals tracked by memory, so expiries and dues quietly slip past
  • Cash, UPI and card collections never reconciled into one number
  • Attendance registers filled in retrospectively, if at all
  • Reminders sent manually, one member at a time
02

Solution

GymFlow replaces that stack with one multi-tenant application, and deliberately ships two surfaces rather than one. Owners get a console covering members, payments, dues, attendance, inventory and workout programs. Members get their own progressive web app for membership status, workouts, progress and rewards. Renewal chasing — the job owners most want to stop doing — is automated over WhatsApp.

  • One relational model spanning members, plans, payments, dues and attendance
  • Each gym is a tenant with its data isolated at the database layer
  • A second product surface: a member PWA with gamified rewards
  • Attendance captured as self-service, so it costs the front desk nothing
  • WhatsApp automation for expiry and dues reminders
  • GymFlow sells itself: owner subscriptions with a 14-day trial and three tiers
03

Features

  • Members — roster with plan, expiry and status, searchable by name, phone or member ID, with CSV import and export
  • Onboarding — a two-step wizard that suggests the next member ID and validates availability as you type
  • Payments — collection split by cash, UPI and card, separated into memberships, inventory and dues, over any date range
  • Dues — outstanding fee tracking with per-member balances and reminder actions
  • Attendance — a kiosk screen members operate themselves, with morning and evening sessions and a daily check-in count
  • Inventory — stock and supplement sales that feed the same collection totals
  • Programs — reusable workout templates with draft and published states, assignable to members
  • Member App — portal access control, invitations, gamification, and weekly and monthly active counts
  • Subscription — GymFlow's own billing across monthly, six-month and yearly tiers behind a trial
  • Daily report PDF, light and dark themes, and a responsive layout for running the floor from a phone
04

Architecture

Two clients and a kiosk talk to one Next.js application. Middleware resolves the session and the tenant before a request reaches a route handler, authorisation is applied in a single policy layer, and Postgres row level security acts as the backstop. Supabase supplies auth, Postgres and storage; WhatsApp sits behind the service boundary.

Client
Edge
Services
Data & external

Swipe sideways to see the full diagram · tap a node to trace its outbound calls

05

Implementation

The decisions that mattered were mostly about where to put trust, and how much the front desk should have to do. Anything security-relevant resolves on the server and is re-checked in the database; anything routine is designed to need no staff attention at all.

  • Tenant id is derived from the session, never read from the request body
  • Row level security policies mirror the application's role rules, so a mistake in a query cannot leak another gym's data
  • Money is stored in integer minor units, so cash, UPI and card totals reconcile exactly
  • Attendance writes are idempotent per member per session, so a double tap at the kiosk cannot inflate the count
  • Member IDs are human-readable and sequential per tenant, with availability checked live during onboarding
  • Reminder sweeps are scheduled and idempotent, so a retry cannot message the same member twice
  • Dashboard counters are computed in SQL against indexes on tenant and date rather than aggregated in JavaScript
  • Every mutation boundary is schema-validated before it reaches the database
06

Challenges

Multi-tenancy without a database per gym

A database per tenant is easy to reason about and expensive to operate. I went with shared tables plus row level security, which meant every policy had to be written and tested deliberately. The rule I settled on: the application filters for correctness, the database filters for safety, and both apply the same tenant predicate.

Reconciling three payment modes into one number

Cash, UPI and card arrive through completely different paths, and owners care about one figure. Modelling every collection as a payment row with a mode, and deriving the split at query time, meant the dashboard, the payments screen and the daily PDF could never disagree with each other.

Getting attendance recorded at all

The first version put attendance behind a staff login, and it went unused — the front desk is busy. Turning it into a kiosk the member operates themselves, with nothing but a member ID and a session toggle, is what made the data start existing. Idempotent writes were then non-negotiable.

Dues and expiry that stay correct over time

Memberships get renewed late, extended, and paid in parts. Treating a membership as a date pair broke immediately. It became a series of periods with explicit status plus a separate dues ledger, so a part payment and a late renewal are two different facts rather than one overwritten field.

Building for two audiences at once

An owner console and a member app want opposite things — density versus focus. Sharing the data layer but keeping the interfaces genuinely separate, instead of trying to make one responsive app serve both, kept each surface honest about who it was for.

Being the vendor as well as the developer

GymFlow charges for itself, which means trials, tier limits and an expiring subscription banner are product features, not afterthoughts. Modelling the gym's own subscription with the same rigour as its members' memberships avoided two competing notions of what 'expired' means.

07

Result

GymFlow is live and selling. The marketing site is at gymflow.sbs and the product runs at app.gymflow.sbs, with eight shipped modules across an owner console and a member PWA, a 14-day trial, and three subscription tiers. It is the project where I own every layer — schema, authorisation, billing, deployment and the pricing page — rather than just the features.

08

Lessons Learned

Two things I would do differently. Write the row level security policies alongside the schema rather than after the features, because retrofitting them meant re-testing every read path. And model money as an append-only ledger from the first commit — I arrived there, but only after the mutable version had produced balances I could not explain. The broader lesson was about adoption: the attendance module only started producing data once I stopped asking staff to operate it.

09

Screens

GymFlow owner dashboard with active members, collection and dues metrics
Owner dashboard — active members, today's collection, expiring memberships and outstanding dues
GymFlow member roster with plan, expiry and status columns
Members — roster filtered by status, searchable by name, phone or member ID, with CSV import and export
GymFlow payments screen showing monthly collection split by payment mode
Payments — collection split across cash, UPI and card, separated into memberships, inventory and dues
GymFlow self-service attendance kiosk asking for a member ID
Attendance — a kiosk screen members operate themselves, with morning and evening sessions
GymFlow member portal management with invitation and login activity
Member App — portal access, invitations and gamification, with weekly and monthly active counts
GymFlow subscription plans with monthly, six-month and yearly pricing
Subscription — GymFlow's own billing: three tiers behind a 14-day trial, no card required

Next project

LightBase

Open Source Backend Platform