fe/— React + Vite UI (entrysrc/main.tsx). Create new pages insidefe/src/components/<feature>/and register them infe/src/App.tsx; keep feature helpers beside the page.fe/src/components/layout/holds shared shells/navs, andfe/src/components/ui/keeps reusable primitives—reuse these before reaching for Radix or adding another control.be/— TypeScript libp2p relay (src/index.ts) configured viaconfig.yamlplus local overrides inconfig.local.yaml.libs/— shared packages (protocols,icod-crypto-js) with compiled output in each package’sdist/directory.
yarn install— install workspace dependencies.yarn dev-prepare— compile@icod2/protocolsbefore running anything else.yarn dev— start frontend and backend together and regeneratefe/.env.localfrom.envfiles.yarn workspace @icod2/fe dev— run only the UI.yarn workspace @icod2/be start— run only the relay.yarn workspace @icod2/<lib> build— rebuild touched libraries; rerunyarn dev-prepareafter contract changes sofe/beload the new dist.yarn workspace @icod2/fe build/yarn workspace @icod2/be build— build production bundles.
- Biome enforces two-space indentation, double quotes, and trailing commas; rely on it for formatting via
yarn :lint-fixoryarn workspace <pkg> lint. - Use PascalCase for React components, camelCase for utilities and services, and SCREAMING_SNAKE_CASE only for constants.
- Hooks live in
fe/src/hooks/and begin withuse; Zustand stores belong infe/src/stores/. - Backend services in
be/src/services/export camelCase factories or classes mirroring their filename.
- Vitest with Testing Library drives UI coverage; run
yarn workspace @icod2/fe test, co-locate specs asComponent.test.tsx, and import helpers fromfe/src/test/setup.ts. - For integration checks, start the relay with
yarn workspace @icod2/be start. - Backend unit tests are currently absent; if you add them, pick a TypeScript-native runner (Vitest or Jest) and add a script to
be/package.json. - Update fixtures and types in
libs/protocols/srcwhenever protocol payloads change.
- Write Conventional Commits (
fix:,refactor:,feat:) and add a scope when it clarifies impact (e.g.,feat(protocols): add handshake timeout). - Include PR summaries, linked issues, verification commands, and UI screenshots when applicable; flag config/env changes and request review from maintainers of touched packages.
- Keep shared secrets in
.env; put local overrides in.env.localorbe/config.local.yaml. - Rerun
yarn devafter updating env keys; it rebuildsfe/.env.local. - Never commit generated peer IDs or other sensitive artifacts.