Getting started
You need Node.js 24 or newer. pnpm comes through Corepack, so there’s nothing else to install.
Run the app
Section titled “Run the app”export COREPACK_ENABLE_DOWNLOAD_PROMPT=0corepack pnpm installcp apps/web/.dev.vars.example apps/web/.dev.vars # set BETTER_AUTH_SECRET to 32+ random characterscorepack pnpm --filter @gymgym/web db:migrate:localcorepack pnpm devOpen http://localhost:4321. “Continue as guest” works without any OAuth setup, and in local development (ENVIRONMENT=development) the sign-in page also takes an email and password. To try Google or GitHub sign in, add their client ids and secrets to .dev.vars and register http://localhost:4321/api/auth/callback/google (or /github) as the callback URL.
The dev server runs the real Worker in workerd, with a local D1 database, so what you see locally is what runs on Cloudflare.
Seed accounts
Section titled “Seed accounts”With the dev server running:
corepack pnpm seed # add --reset to replace the demo data| Account | Password | What it has |
|---|---|---|
demo@gymgym.test |
gymgym-dev-password |
A push/pull/legs plan, four weeks of workouts, body-weight readings and a goal |
admin@gymgym.test |
gymgym-dev-password |
The admin role: Settings → Admin dashboard |
The script goes through the SDK like any client and sets the admin role in the local database. Running it again leaves existing data alone.
Call the API from code
Section titled “Call the API from code”import { createGymClient } from '@gymgym/sdk'
const gym = createGymClient({ baseUrl: 'http://localhost:4321' })await gym.auth.signIn.anonymous()const { viewer } = await gym.me()Every operation in SDK operations is a method on the client, with typed variables and results.
Checks
Section titled “Checks”corepack pnpm contract # print schema.graphql and regenerate the SDKcorepack pnpm typecheckcorepack pnpm test # unit tests and Workers testscorepack pnpm check:features # every catalogued feature has a tagged testcorepack pnpm test:e2e # Playwright against the running dev server