Skip to content
PTLog ikonuOur own product2026

PTLog

A multi-tenant management platform for gyms, with a member PWA.

Web
Let’s build something like this
PTLog interface 1
PTLog mobile interface 1
SaaS · PWAAMG / 26
Project
Our own product
Our role
Product · Architecture · Full stack · Multi-tenant infrastructure
Duration
3 months

01 / Behind the product

A real need. A considered solution.

01

Challenge

Trainers keep measurements and session logs in a notebook; when it is time to show progress there is nothing to show. The first version served a single trainer. For gyms the problem is bigger: every gym wants a panel under its own brand and address with an app its members can install, but separate deployments are not sustainable.

02

Approach

Multi-tenant v2 on one codebase: middleware resolves gym.ptlog.dev or a custom domain to a tenant, and a Supabase auth hook writes tenant, role and permission claims into the session JWT. A branding engine generates each tenant’s PWA manifest and icons per hostname from its colours, fonts and logo (sharp).

A module registry builds navigation and permissions from manifests; packages, sessions, classes, attendance, training and progress each have their own migration series. Five languages, a three-part error dictionary, optional Resend, Upstash and Web Push; a missing key turns the system status card red without taking the app down.

03

Result

ptlog.dev is live. The member PWA covers home, progress, messages and an assistant; the owner and staff panel is separate; a superadmin sees tenants, the audit log and system status. Schema and RLS tests run on local Postgres without Docker, and 45 end-to-end tests run against the production build in about six minutes.

03 / Scope & details

The details make the experience.

  • 01

    Every gym on its own subdomain or custom domain, under its own brand

  • 02

    Tenant, role and permission claims written into the JWT by a Supabase auth hook

  • 03

    PWA manifest and icons generated per hostname

  • 04

    Five languages; 45 end-to-end tests against the production build

  • 05

    Packages, sessions, classes, attendance, training and progress modules

Technology

Next.jsReactTypeScriptSupabasePostgreSQL

Next.js / Supabase / PostgreSQL / PWA

INSIDE THE PRODUCT

The engineering behind the interface.

Systems we built and concrete problems we addressed in this project.

01

Claims in the JWT

custom_access_token_hook writes tenant, role and permission claims into the session JWT; without the hook, middleware sends everyone to /switch. Host resolution rewrites <slug>.<domain>/* requests under app/t/; *.localhost means no hosts entry is needed locally.

02

The branding engine

lib/branding feeds the manifest.webmanifest and icons/[spec] routes per hostname with a palette derived from the tenant’s colours, fonts and sharp-generated icons; members add the gym’s own app to their home screen.

03

Database tests without Docker, e2e against production

npm run db:test runs harness + migrations + RLS and security tests on local Postgres 17. 45 end-to-end tests run against the production build on the real Supabase project with an e2e-slug gym rebuilt from scratch each round; a test that fails twice in a row is broken, once is the network (Decision 65).

Your idea could be next.

What could we build for you?

From a first release to a growing platform. Let’s plan the design, development and launch together.

Tell us about your project

From Türkiye to the US, UK, Australia and everywhere in between.