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. 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 https://demo-gymcoach.mesureprivee.com · 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 https://demo-gymcoach.mesureprivee.com 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 the LLM 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 . Point LLM 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. 1. Environment variables cp .env.example .env Edit .env the example ships with working dev defaults 2. Install dependencies npm install 3. Start Postgres docker compose up -d db 4. Apply Prisma migrations npm run db:migrate 5. Seed demo data account + exercise catalog + program + sample session npm run db:seed 6. Start the dev server npm run dev The app runs on http://localhost:3030 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 Integration + E2E use a dedicated Postgres docker-compose.test.yml, port 5434 : 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 Fill in real values JWT SECRET, the AI provider key, NEXTAUTH URL, ... 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 /Julien-Au/gymcoach/blob/main/CONTRIBUTING.md for setup, conventions and the test commands. MIT, see LICENSE /Julien-Au/gymcoach/blob/main/LICENSE .