r/coolgithubprojects • u/imnotsurprisedmfker • 4h ago
PlainGym: open-source, self-hosted gym management for martial arts gyms (TypeScript, PostgreSQL, AGPL-3.0)
galleryRepo: https://github.com/plaingym/plaingym
Live demo: https://tryplaingym.app (no signup). Look around the shared showcase, then make a private copy and switch between owner, coach and student. Copies are deleted within 24 hours, and billing runs in Stripe test mode.
PlainGym runs a gym: memberships, recurring billing, class booking, kiosk check-in, waivers and a member portal. It's built for martial arts gyms (belts, stripes, kyu/dan grades, promotions, family billing for kids' programs), and rank tracking is optional, so it works for any gym.
What's in the repo:
- One install = one gym = one server. Docker Compose (app + Caddy + PostgreSQL), a one-line installer and a setup wizard in the browser.
- Updates itself: patch releases apply nightly with automatic rollback, and every update takes a snapshot first. Releases are signed.
- Backups: encrypted
pg_dumpsnapshots to any S3-compatible storage, with restore from the setup wizard. - Payments through the gym's own Stripe account. No platform fee, no cut.
- Data isolation in the database: every query goes through PostgreSQL row-level security, so one household's data can't leak to another.
- No Redis, no external queue: background jobs live in a Postgres table, claimed with
SKIP LOCKED. - Imports members, memberships, ranks and attendance from other software's CSV exports, without charging or emailing anyone.
Server requirements:
- Ubuntu 24.04 or 26.04 LTS, amd64 or arm64
- 1 GB of RAM minimum (the installer adds 1 GB of swap if there's none); 2 GB gives more headroom. The whole stack has been load-tested on a 1 GB server with no out-of-memory kills.
- A domain name pointed at the server, with ports 80 and 443 open (Caddy gets the HTTPS certificate)
- An SMTP provider for member emails, an S3-compatible bucket for backups, and a Stripe account for billing
- About 30 minutes. The install guide assumes you've never run a server before.
Stack: TypeScript, Node.js, Hono, React + Vite + Tailwind + shadcn/ui, PostgreSQL + Drizzle ORM, Better Auth, Vitest.
License: AGPL-3.0.
AI disclosure: built with heavy AI assistance (coding agents), with tests and CI on every change.
Feedback welcome, especially on the install and the setup wizard.