System Architecture9 min read2026-04-10

Inside SAYPO: Building a 98-Endpoint Fitness Backend with an AI Coach

SAYPO pairs a Capacitor mobile app with offline-first SQLite and a Gemini-powered AI coach against a 98-endpoint NestJS backend. Here is how the pieces fit, and the decisions that kept a solo-built system maintainable.

SAYPO is a fitness platform: a Capacitor + React mobile app on iOS and Android, an AI coach running on Gemini, offline-first SQLite for the workouts that have to survive a dead gym Wi-Fi, and a NestJS backend of 98 endpoints behind all of it. It validated to roughly $62k, and most of what made that possible was boring, deliberate scoping.

Offline-first is a data contract, not a feature flag

The app has to log a set, a rep count, GPS distance and step data whether or not the phone has signal. That means the local SQLite schema is the actual source of truth on-device, and sync is a reconciliation job, not a save button. Getting this wrong looks like duplicate workouts after a sync — getting it right means writing the conflict resolution rule once, in one place, before a single screen calls it.

Where the AI coach actually sits

The Gemini-powered coach does not have write access to the workout log directly. It reads the same structured history every screen reads, proposes a plan, and the plan is written back through the same validated endpoints a manual edit would use. That boundary is what keeps a model’s occasional bad suggestion from becoming corrupted user data — the AI is a client of the API, not a bypass around it.

98 endpoints, one ops dashboard

The backend grew to 98 endpoints because a real product has real edges: subscriptions through RevenueCat, health data sync, coaching history, device state. The 20-tab ops dashboard exists because a system that size is unmanageable through direct database access — every one of those tabs maps to an endpoint group, not a table, so the admin surface and the API surface can never silently drift apart.

Let's build something that stands the test of time.

Replies within 24 hours