Set up
1
Install dependencies
.yarnrc.yml.2
Configure the environment
MONGO_URI, APP_URL, and one LLM provider key. Add integration
credentials only for what you are working on.3
Run it
http://127.0.0.1:3000, with an explorer at /explorer. For docs,
run yarn dev:docs on port 3001.Branch naming
Branches followtype/short-description, and reference the issue number when
one exists:
feat/ for new capability and fix/ for corrections.
Commit messages
Conventional Commits, with the issue number in parentheses at the end when the change closes one:Before you open a PR
yarn lint:fix for the mechanical parts. This runs
ESLint and a Prettier check across the codebase.
There is no
test script in package.json today, though Mocha is configured in
.mocharc.json and tests live in src/__tests__. Verify changes by exercising
them against a running instance, and say in your PR description how you did so.Verifying your change
Prove the behavior end to end rather than reasoning from the code. For anything touching the widget, the CRM, or visitor sessions, test against a clean database with the real widget — polluted data hides duplicate-record and session bugs that only appear on a first-ever visit.Opening the PR
- Target
main. - Describe the user-visible effect, and link the issue with
Fixes #NNN. - Say what you did to verify it, including anything you could not test.
- Keep the diff to one concern. A refactor bundled with a fix is two PRs.
Code conventions
Match the surrounding code — its naming, comment density, and idioms — rather than importing patterns from elsewhere.- Controllers hold routing and validation; business logic belongs in services; data access belongs in repositories.
- Add new endpoints to the controller for that resource rather than creating a catch-all.
- Anything shared between server and client goes in
src/shared/. - Comment the why when a decision is non-obvious. Do not narrate the what.
Architecture decisions
If your change locks in a dependency, a data shape, or an upgrade path, add an ADR underdocs/adr/ using 0000-template.md. Number it sequentially and never
renumber — records are append-only, and a superseded decision is marked as such
rather than edited away.