Thanks for your interest in contributing! This document covers how to get started.
-
Clone the repo
git clone https://github.com/bgerd/rgem.io.git cd rgem.io -
Configure an environment
cp samconfig.toml.example samconfig.toml # Edit samconfig.toml with your AWS-specific values ./configure.sh dev -
Install app dependencies
cd app npm install
cd app
npm run dev # Dev server at localhost:5173
npm run lint # ESLint
npm run test # Vitest unit testsSee CLAUDE.md for detailed conventions. Key points:
- Backend: ES modules, async/await, camelCase, Node.js 20
- Frontend: Strict TypeScript, functional React components, PascalCase for components/types
- Hardware: UPPER_CASE constants, camelCase functions, enum-based state machine
- Comments: Use
TODO:,NOTE:,HACK:,FIXME:markers. Preserve existing annotations.
Follow the existing format: type:scope: description
Examples:
fix:app: correct lint issues
refactor:app: extract standalone functions to src/lib
build:app: install vitest and implement basic tests
Three long-lived branches map directly to deployed environments:
| Branch | Environment | URLs |
|---|---|---|
main |
dev | app-dev.rgem.io, ws-dev.rgem.io |
stage |
stage | app-stage.rgem.io, ws-stage.rgem.io |
prod |
prod | app.rgem.io, ws.rgem.io, rgem.io (landing) |
prod is always a subset of stage; stage is always a subset of main. Changes flow in one direction only: main → stage → prod.
main ──── feature/my-feature ────► main (PR)
│
deploys to dev
-
Cut a
feature/*(orfix/*,chore/*, etc.) branch frommain -
Open a PR against
main -
Merge when ready; deploy to dev to verify:
Run
./configure.sh dev && ./infra/scripts/deploy-backend.sh && ./infra/scripts/deploy-app.sh
main ────────────────────────────► stage (PR)
│
deploys to stage
- Open a PR from
mainintostage - Merge when dev has been verified
- Run
./configure.sh stage && ./infra/scripts/deploy-backend.sh && ./infra/scripts/deploy-app.sh
stage ───────────────────────────► prod (PR)
│
deploys to prod
(+ landing page)
- Open a PR from
stageintoprod - Merge when stage has been verified
- Run
./configure.sh prod && ./infra/scripts/deploy-backend.sh && ./infra/scripts/deploy-app.sh - If landing page changed:
./infra/scripts/deploy-landing.sh
Future: CI/CD automation is planned for the RGem App and Landing Page deployments. When implemented, a merge to
stageorprodwill trigger the relevant deploy scripts automatically.
For urgent production fixes — including all Landing Page changes (which have no dev/stage equivalent) — bypass the normal promotion chain:
prod ──── hotfix/fix-name ────► prod (PR)
│
└──► main (back-merge PR, mandatory)
- Cut a
hotfix/*branch fromprod(notmain) - Make the fix; open a PR into
prod - Deploy immediately after merge
- Mandatory: open a back-merge PR from
prodintomainto prevent drift — do not skip this step stageself-heals on the next normalmain → stagepromotion
Rule:
hotfix/*is the only permitted path that bypassesstage. Keep hotfix scope minimal. If the change is large or non-urgent, route it through the normal chain.
- Cut a branch from
main(feature work) orprod(hotfixes) — see Branch Strategy above - Make your changes, following the code conventions above
- Ensure
npm run lintandnpm run testpass inapp/ - Open a PR with a clear description of the change
Open an issue for discussion before starting large changes.