Skip to content
 
 

Repository files navigation

FlexFit Studio

Class booking and membership management for a single gym site. Members book classes, buy memberships and spend class credits. Staff run the front desk, manage trainers and pull reports. Companies buy credit pools their employees book against.

Requirements

Node 20 or newer, and pnpm. If you don't have pnpm:

npm install -g pnpm

The database is SQLite and lives in a file. There's no server to install and no account to create.

Getting set up

pnpm install
pnpm db:push
pnpm db:seed
pnpm dev

That gets you a populated studio at http://localhost:3000 with a couple of weeks of classes either side of today.

db:push creates flexfit.db and applies the schema. db:seed fills it with sample members, plans, classes and bookings.

Signing in

Role Email Password
Admin admin@flexfit.test admin123
Trainer arjun@flexfit.test trainer123
Member rahul.k@example.com member123

Every seeded member uses member123. The other member emails are in src/db/seed.ts.

Commands

Command What it does
pnpm dev Development server on port 3000
pnpm build Production build
pnpm db:push Apply the schema in src/db/schema.ts
pnpm db:seed Wipe the data and reseed
pnpm db:reset Delete the database file, then push and seed again

db:reset is the one you want when the data gets into a state you don't like. It's destructive and it's meant to be.

Two things that will waste your time

Don't run pnpm build while pnpm dev is running. The build writes over the directory the dev server is using and the app starts throwing MODULE_NOT_FOUND. Nothing is actually broken. Stop the dev server, delete .next, start it again. If you want to typecheck while the server is up, use npx tsc --noEmit instead.

If you're changing anything in src/db/schema.ts, run pnpm db:push afterwards or the app and the database will disagree with each other in confusing ways.

Layout

src/
  app/          routes and pages
  components/   shared components
  db/           schema, client, seed data
  lib/          helpers
  server/       tRPC routers
documents/      empty, for your own notes

About

FlexFit Studio – Smart fitness studio management platform for scheduling, memberships, bookings, attendance and waitlist management.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages