cd /news/ai-products/show-hn-gymcoach-self-hosted-workout… · home topics ai-products article
[ARTICLE · art-20102] src=github.com pub= topic=ai-products verified=true sentiment=↑ positive

Show HN: GymCoach – Self-hosted workout tracker where you bring your own LLM

GymCoach, a new open-source, self-hosted workout tracker, allows users to log hypertrophy training sessions and receive AI-powered coaching using their own Anthropic or OpenRouter API key. The application, built with Next.js and PostgreSQL, provides features including progress tracking, program generation from natural language, and a streaming AI chat coach, all while keeping user data stored locally in their own database. Developed under an MIT license, GymCoach is designed for self-hosting via Docker and offers a public demo for evaluation.

read6 min publishedJun 3, 2026

Open source, self hosted hypertrophy training tracker with a built in AI coach. Log your sessions, track your progress, and get evidence based weekly debriefs and program suggestions from the LLM of your choice (Anthropic Claude or any OpenRouter model).

▶ Try the live demo · login

demo@gymcoach.app

/ gymcoachdemo

Why GymCoach? It is the only workout tracker you self-host that brings your own LLM. Log your training, see your progress, and get a coach that actually knows your data: weekly debriefs, a streaming chat, and full programs generated from a sentence. Your data stays in your database; the AI runs on your Anthropic or OpenRouter key.

Status: actively developed. Multi-user, provider-agnostic (Anthropic or OpenRouter), with a unit / integration / E2E test suite and deep AI integration.

  • Multi-user accounts: sign up, profiles, per-user data isolation

  • Workout logging with sets, reps, RIR, warmups and drop sets

  • Progress charts and estimated 1RM tracking

  • Bodyweight-aware tonnage (pull-ups, dips, etc.)

  • AI coach: weekly debrief and assisted program adjustments

  • Conversational AI coach: streaming chat grounded in your training data

  • AI program generation from a natural-language goal, editable before saving

  • Pluggable LLM provider: Anthropic SDK or any OpenRouter model

  • Installable PWA with offline session logging

  • Frontend: Next.js 14 (App Router), TypeScript strict, Tailwind CSS, Shadcn UI

  • Backend: Next.js API routes, Prisma ORM, PostgreSQL 16

  • AI: pluggable LLM provider (Anthropic SDK or OpenRouter)

  • Infra: Docker and Docker Compose

A few beliefs shaped GymCoach:

  • Your training data is yours. It lives in a Postgres database you control, not on someone else's servers. No ads, no tracking, no account you cannot delete.
  • AI should be optional and yours to pay for. The coach runs on your own Anthropic or OpenRouter key, so there is no subscription and no rate-limited "free tier". With no key set, the app is a clean, fast tracker.
  • Coaching should be grounded in your numbers, not generic advice. The AI only ever sees a structured summary of your own sessions, program and progress.
  • Evidence over hype. Load progression uses double-progression logic, and the coach is prompted to reason from your data (and cite the usual names: Schoenfeld, Helms, Israetel) rather than invent.
  • Self-hosting should be boring: one Docker Compose file, one database, standard Next.js.

I built it for my own training and open-sourced it under MIT. There is nothing to buy: a public demo lets you look around, but GymCoach is meant to be self-hosted. Clone it, run it, change it.

The app:

  • Next.js 14 (App Router) serves both the UI and the API routes; data lives in PostgreSQL through Prisma. Auth is a signed JWT in an httpOnly cookie; every record is scoped to a user id and every route checks ownership.
  • The session logger is offline-first: each set is written to IndexedDB (Dexie) first for instant feedback, then synced to the server in the background, so a flaky gym connection never blocks you. A Wake Lock keeps the screen awake during a session.
  • Progress is computed server-side: estimated 1RM (Epley), max load over time, and weekly volume per muscle group, with bodyweight-aware tonnage for movements like pull-ups and dips.

The AI layer:

  • A single provider interface ( lib/llm

) sits in front of either the Anthropic SDK or any OpenRouter model. You pick one with theLLM_PROVIDER

env var; the rest of the app does not care which. - For every AI call the server builds a compact, structured payload (your profile + recent sessions + active program + per-exercise progression) instead of dumping raw rows, then:

  • Weekly debrief and program adjustments: one completion that returns markdown plus an optional structured block of suggested changes, validated with Zod before anything touches your program.

  • Chat coach: the same context plus your conversation, streamed back token by token.

  • Program generation: a plain-language goal becomes a JSON program, validated and previewed so you can edit it before it is saved.

  • The stable system prompt is marked for prompt caching, so multi-turn chats reuse it instead of re-sending it every turn.

Chat coach | Weekly debrief + 1-tap adjustments | Program generation |

These clips use the built-in

demo

provider (canned responses, no key). PointLLM_PROVIDER

at your Anthropic or OpenRouter key for the real thing.

  • Node.js 20+
  • Docker and Docker Compose
  • npm

Recommended setup: Postgres in Docker, Next.js running locally for hot reload.

cp .env.example .env

npm install

docker compose up -d db

npm run db:migrate

npm run db:seed

npm run dev

The app runs on http://localhost:3030. Postgres is exposed on localhost:5433

on the host.

The demo account credentials come from .env

(USER_EMAIL

and USER_PASSWORD

); the seed hashes the password at runtime.

All configuration is done through environment variables. See .env.example

for the full list (database, JWT secret, demo account, and the AI provider keys).

Three tiers: unit/component (Vitest + jsdom), integration (Vitest against a real Postgres), and end to end (Playwright driving the built app).

npm run test            # unit and component tests
npm run test:coverage   # with coverage report

docker compose -f docker-compose.test.yml up -d
DATABASE_URL=postgresql://gymcoach_test:gymcoach_test@localhost:5434/gymcoach_test \
  npx prisma migrate deploy
npm run test:integration
npm run build && npm run test:e2e
docker compose -f docker-compose.test.yml down

CI (.github/workflows/ci.yml

) runs lint, typecheck, unit, integration, build and E2E on every push and pull request.

Script Description
npm run dev
Next.js dev server (port 3030)
npm run build
Production build
npm run start
Run the production build
npm run lint
ESLint
npm run typecheck
TypeScript type checking
npm run test
Unit and component tests
npm run test:e2e
End to end tests
npm run format
Prettier
npm run db:migrate
Apply migrations (dev)
npm run db:reset
Reset the database (drop + migrate + seed)
npm run db:seed
Load the demo dataset
npm run db:studio
Open Prisma Studio
npm run db:generate
Regenerate the Prisma client
.
├── app/              # Pages and API routes (App Router)
├── components/       # React components (Shadcn UI in components/ui)
├── lib/              # Helpers (db, auth, stats, llm, etc.)
├── prisma/           # Schema, migrations and seed
├── public/           # Static assets (PWA icons, manifest)
├── tests/            # Integration (Vitest) and E2E (Playwright) tests
├── docs/             # Project documentation
└── docker-compose*.yml

A production stack is provided through docker-compose.prod.yml

(app + Postgres). Put it behind a reverse proxy (Nginx, Caddy, Traefik) for HTTPS.

cp .env.example .env
docker compose -f docker-compose.prod.yml up -d --build
docker compose -f docker-compose.prod.yml exec app npx prisma migrate deploy
  • Single user MVP (logging, progress, weekly AI debrief, program adjustments)
  • Pluggable LLM provider (Anthropic SDK or OpenRouter, switchable via env)
  • Multi user support (registration, profiles, data isolation)
  • AI program generation from a natural language goal
  • Conversational AI coach (streaming chat with your training context)
  • Test pyramid (unit, integration, E2E) and CI
  • In-session AI suggestions and natural-language set logging

Contributions are welcome. See CONTRIBUTING.md for setup, conventions and the test commands.

MIT, see LICENSE.

── more in #ai-products 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-gymcoach-sel…] indexed:0 read:6min 2026-06-03 ·