# Contributing to KuentaGYM Thanks for taking a look! KuentaGYM is intentionally small and dependency-light, and the goal is to keep it that way — easy to read, easy to self-host. This repository is a modified fork of [openGym](https://gitlab.com/DuarteSantos8/opengym) by Duarte Santos, under the same AGPL v3.0 (see [NOTICE.md](NOTICE.md)). The canonical repository for the fork — and the only place issues and pull requests are read — is its Gitea instance, . ## Project layout ``` frontend/ React + Vite app (src/views, src/components, src/store, src/lib). Builds to static files. android/ + ios/ are the Capacitor shells for the standalone mobile app (docs/MOBILE.md). api/ backend — server.js (Node, no framework), one dependency (@simplewebauthn/server). web/ multi-stage Dockerfile (builds frontend → nginx) + nginx.conf.template (serves app, proxies /api). media/ exercise img/gif (gitignored, fetched at runtime). docs/ self-hosting guide. mcp/ optional Model Context Protocol server — read-only stdio bridge for LLM apps (Claude Desktop, Cursor, …) to query a user's workouts/1RM/muscle balance. Not in the Docker build; only runs when an LLM client spawns it. See mcp/README.md. ``` ## Running for development ```bash cp .env.example .env docker compose up -d --build # api + web + media on :8080 # frontend hot reload: cd frontend && npm install && npm run dev # training logic (progression rules, 1RM, how a session is read back): cd frontend && npm test ``` ## Guidelines - **Keep it dependency-light.** The frontend uses React + Router + Zustand and nothing else; new deps (front or back) are a hard sell. `api/` has two (`@simplewebauthn/server` for passkeys, `web-push` for notifications) — keep it near that. - **Match the style.** Small components, clear names, comments only where the "why" isn't obvious. State lives in the Zustand store (`src/store`); pure helpers in `src/lib`. - **Don't commit** the exercise media (`media/`) or `data/` — they're gitignored. - **Test the flow** you touched — click through the affected screens (and the workout flow) in a browser before opening a pull request. - **Training logic gets a unit test.** Anything deciding what you lift next, or reading a logged session back, belongs in a pure helper in `src/lib` with tests beside it (`npm test`). These rules are easy to get subtly wrong and nearly impossible to verify by clicking — the progression engine grew two real bugs that only a test pinned down. ## What CI does with your pull request Gitea Actions is the CI here, configured in `.gitea/workflows/`: - **`test.yml`** — the `frontend/` suite (`npm test`) on Node 22, the same version as `web/Dockerfile` / `api/Dockerfile` (`node:22-alpine`). It runs on every pull request and on pushes to `main` that touch `frontend/`, `mcp/` or the workflow itself. That is the whole job: no build, no locale check. - **`docker-publish.yml`** — builds both images (`api`, i.e. the `default` target, and `web`) for amd64 and arm64 and pushes them to the Gitea registry, on every push to `main` and again when a release is published. Two things that follow from that. The `mcp/` and `api/` suites are not run in CI — run `npm test` in `mcp/` and `node --test test/*.test.js` in `api/` yourself before you push. And nothing else is automated yet: no job packages the Android APK or the iOS archive, and the marketing site in `website/` is not deployed. `.gitlab-ci.yml`, `.gitlab/` and `.github/workflows/` are copies of upstream's pipeline, kept because they document how upstream builds and releases. They are dormant — no runner executes them for this fork, so a check only they perform does not gate your pull request, and changing them changes nothing here. ## Good first issues - Additional starter plans (upper/lower, full-body, 5×5…) - More languages for the exercise instructions (the dataset ships several) - Percentage / training-max programming (5/3/1-style) on top of the progression engine in `src/lib/progression.js` — the policy interface is already there - Accessibility passes on the workout and chart screens ## Where to ask what | You have | Goes to | | --- | --- | | A question, or self-hosting that won't behave | [An issue labelled `question`](https://git.dploy.lol/dsantillan/kuentagym/issues) | | An idea you're not sure about yet | [An issue labelled `idea`](https://git.dploy.lol/dsantillan/kuentagym/issues) | | A reproducible bug | [Issues](https://git.dploy.lol/dsantillan/kuentagym/issues) | | A change you've already built | [A pull request](https://git.dploy.lol/dsantillan/kuentagym/pulls) | Questions and ideas are issues too (one tracker is enough) — just labelled, so nobody mistakes a question for agreed-on work. An answered question is worth more than the same answer in a chat log: the next person searching "passkey login fails behind my reverse proxy" finds it. Upstream has its own rooms and its own tracker for upstream's code; neither is a channel for this fork. ## Reporting bugs Open an issue with: what you did, what you expected, what happened, and your browser/OS. If it's about login/passkeys, include your `RP_ID`/`ORIGIN` (not the `data/` contents) — most login issues are an origin mismatch. By contributing you agree your work is licensed under the project's [GNU AGPL v3.0](LICENSE).