Skip to content

Running locally

Getting the apps and backend running on your machine. This summarises the commands in AGENTS.md; that file is the source of truth for tooling.

Prerequisites

  • Node 22.x (see .nvmrc / .node-version). nvm use picks it up.
  • pnpm — the package manager for the backend and JS tooling.
  • Flutter via FVM — version pinned in .fvmrc. Use fvm flutter ....
  • Melos — manages the Flutter monorepo workspace.

Flutter apps

melos bootstrap          # install deps across the workspace
melos analyze            # static analysis
melos test               # run all tests
melos format             # format
melos build_runner       # codegen (Riverpod, freezed, etc.)

# single test
flutter test test/specific_test.dart

Run codegen after touching anything annotated (@riverpod, freezed, json):

fvm flutter pub run build_runner build --delete-conflicting-outputs

Always run melos analyze && melos test before committing.

Backend functions

Run from the package directory — these scripts are not exposed at the repo root.

cd apps/perci-platform-backend/functions
pnpm install
pnpm run dev             # Firebase emulators (functions, firestore)
pnpm run serve           # emulators incl. auth + pubsub
pnpm run test            # vitest
pnpm run lint            # eslint
pnpm run lint:fix

Run pnpm run lint && pnpm run test before committing.

Worktrees need Node 22 explicitly

In a fresh git worktree the default shell may be on Node 18, which breaks vitest. Run nvm use 22 and pnpm install first. pnpm run build runs clean && generate && tsc -b, and generate needs secrets; to just type-check, run tsc -b directly.

Web professionals

Also its own package; run from its directory.

cd apps/perci-platform-backend/web-professionals
pnpm install
pnpm run dev             # vite
pnpm run lint

Building these docs

The docs toolchain is managed by uv (pyproject.toml + uv.lock). uv installs Python and the dependencies on first run.

uv run mkdocs serve          # live preview at http://127.0.0.1:8000
uv run mkdocs build --strict # what CI runs; fails on broken links