Getting started
You need Node.js 24 or newer. pnpm comes with Corepack, so you install nothing else.
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” needs no OAuth setup. In local development (ENVIRONMENT=development), the sign-in page also accepts an email and a password. To try Google or GitHub sign-in, add their client ids and secrets to .dev.vars. Then 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. What you see locally is what runs on Cloudflare.
Seed accounts
Section titled “Seed accounts”Start the dev server, then run:
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 uses the SDK like any client and sets the admin role in the local database. If you run it again, it 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()Each operation in SDK operations is a method on the client. It has typed variables and typed 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 a build of its own, on port 4331