Building Gym Manager: An Offline-First Approach
Hey everyone! 👋
Recently, I built Gym Manager, a comprehensive fitness center management system. I actually developed this for my friend who just opened a gym, and it was a great chance to have some fun while solving a real-world problem.
If you’ve ever worked at or managed a gym, you know the struggles: manual member tracking is slow, physical membership cards get lost (and cost money to print), and lacking good analytics makes it hard to make business decisions.
But the biggest technical challenge? Internet reliability.
Existing cloud-based solutions become completely useless the second the gym’s internet drops, which halts the front desk. On the flip side, purely local software isolates your data and makes it impossible to build modern features like a customer-facing mobile app.
To solve this, I went with an offline-first hybrid architecture. Here is a high-level look at how it all comes together:
1. The Desktop Hub (Rust, Tauri & SvelteKit)#
The core of the system is a desktop application used by gym employees. I built it using Rust and Tauri for a lightweight, native feel, with SvelteKit handling a snappy UI.
- Fully Offline: It can run 100% locally. Employees can scan cards, register members, and check access control without needing a connection.
- Analytics: It includes built-in data analytics to track attendance trends and membership statuses.
- Auto-Backups: It automatically creates and pushes
.sqlitedatabase backups to the cloud so data is never lost.
2. Cloud Sync & Infrastructure (AWS & Supabase)#
To get the best of both worlds (local speed + cloud connectivity), the app seamlessly syncs data in the background.
- The Sync Worker: I implemented a reliable background sync worker in the desktop app using the “outbox” pattern. When the internet is up, it quietly pushes local changes to a Supabase PostgreSQL database.
- Serverless Backups: I used AWS (API Gateway, Serverless Lambda functions, and S3) to securely route, store, and version the local database backup files.
- Auth & Emails: Supabase handles JWT user sessions and transactional emails (via Resend SMTP) to invite users to the mobile app.
3. The Member Mobile App (Flutter)#
To get rid of physical plastic cards, I built a cross-platform mobile app using Flutter. Gym members can simply open the app on their phone to scan into the gym, check their active membership status, and manage their account.
4. Shipping It (CI/CD)#
To make updates painless, I set up GitHub Actions to automate the build process. When I push a new Git tag, it automatically triggers the Tauri updater so the desktop app can download new versions right from its own interface, while mobile updates are pushed to the App Store and Google Play.
Wrapping Up#
Building Gym Manager was an incredible experience. It forced me to think deeply about distributed state, conflict resolution, and building resilient software that people actually enjoy using on a daily basis.
You can check out the source code for the desktop app on my GitHub!