Never include anyone's real name, email address, phone number, or other personally identifiable information (PII) in GitHub issues, tasks, or PR descriptions. Use placeholders like "[Name]", "[Email]", or generic descriptions instead.
Source env before running commands:
source .env # or use direnv: create .envrc containing `dotenv`Required vars: POSTGRESQL_HOST, POSTGRESQL_PORT, POSTGRESQL_DATABASE, POSTGRESQL_DATABASE_TEST, POSTGRESQL_USER, POSTGRESQL_PASSWORD, SSO_URL, PROJECT, ENVIRONMENT, BUILD_TARGET, API_PORT
Database is already populated with data. Use connection settings from .env:
POSTGRESQL_HOST,POSTGRESQL_PORT,POSTGRESQL_DATABASE,POSTGRESQL_USER,POSTGRESQL_PASSWORD
Do NOT run migrations or seeds unless explicitly asked — they may overwrite existing data.
| Task | Command |
|---|---|
| Dev server (local) | npm run dev (nodemon + babel-node, debug on :9229) |
| Build | npm run build (gulp: babel transpile src/ + scripts/ → build/, copies config/templates) |
| Start (production) | npm start → runs build/src/server.js |
| Lint | npm run test:lint (eslint + prettier, scans src __tests__ __testHelpers__ __mocks__) |
| DB migrate | N/A — knex removed, DB schema frozen |
| DB seed | N/A — knex removed, seed data managed via scripts |
| Full init | npm run initialize_docker (build + migrate + seed + import) |
Two separate docker-compose projects coexist (dev = default, test = myra-project):
| Task | Command |
|---|---|
| Dev setup | make local-setup (build + seed) |
| Dev run | make run-local |
| Test setup | make local-test-setup |
| Test run | make local-test (uses test.docker-compose.yml -p myra-test) |
| DB shell | make database (dev) or make database-test (test) |
| Container shell | make workspace |
Test DB container also starts minio and minio-nginx (required for some features).
- Entry:
src/server.js→src/index.js - Routes:
src/router/ - Business logic:
src/services/,src/libs/ - DB layer:
src/libs/db2/(pg + kysely), no migration system (schema frozen) - Scripts:
scripts/(import, data generation, maintenance) — transpiled tobuild/scripts/ - Build output:
build/(gitignored, generated by gulp) - Frontend:
range-websibling directory
- Node version:
enginessays~6.11.0, babel targets Node 8.9, CI runs 10.x — legacy codebase, all modern syntax transpiled - Knex removal: knex was removed — all runtime queries use
kysely, raw SQL falls back topg.Pool npm run initializehas a typo:npm rum build— useinitialize_dockerinstead- Pre-commit: husky v9 + lint-staged runs
eslint --fixandprettier --writeon staged.jsfiles
Quick query command:
source .env && PGPASSWORD=$POSTGRESQL_PASSWORD psql -h $POSTGRESQL_HOST -p $POSTGRESQL_PORT -U $POSTGRESQL_USER -d $POSTGRESQL_DATABASE -c "SQL_QUERY"Key tables:
plan— extension_status, extension_required_votes, extension_received_votesplan_extension_requests— plan_id, client_id, user_id, requested_extensionuser_account— id, emailuser_client_link— user_id, client_idclient_agreement— client_id, agreement_id
Location: /Users/bamin/range/range-web (sibling directory)
Key file for plan extension UI: src/components/selectRangeUsePlanPage/ExtensionColumn.js — renders Thumbs up/down buttons when extensionStatus === 1 (AWAITING_VOTES)
Use Node 25 via nvm for compatibility:
source ~/.nvm/nvm.sh && nvm use 25 && node build/scripts/plan_extension_exemption.jsWhen user reports a bug, follow this exact sequence:
- Create GitHub issue on correct repo (range-web for frontend, range-api for backend) with title, description, root cause, and impact
- Assign to the user (brijesh-amin)
- Implement fix on
devbranch - Add/update tests to prevent regression (existing test patterns in
__tests__/) - Commit using commit style
#issue-number - description - Push to
origin:dev - Close the issue with a comment pointing to the commit
POSTGRESQL_DATABASE_TESTdefaults tomyra_test— must exist for testsbuild/must exist and be populated beforenpm startornpm run initialize_dockerwill work- Never run
npm testdirectly — it connects to the.envdatabase ($POSTGRESQL_DATABASE, not the test database) and will clear local data. Always usemake local-test(Docker) for integration tests; it uses$POSTGRESQL_DATABASE_TEST. Unit tests that don't touch the DB are fine. - Always use
$POSTGRESQL_DATABASE_TESTfor test-related database queries — never$POSTGRESQL_DATABASE. The local dev database has real data.