Skip to content

docs: add CLAUDE.md with repo-specific guidance#36

Open
EricGrill wants to merge 1 commit into
mainfrom
claude/vigorous-meitner-5dcb14
Open

docs: add CLAUDE.md with repo-specific guidance#36
EricGrill wants to merge 1 commit into
mainfrom
claude/vigorous-meitner-5dcb14

Conversation

@EricGrill
Copy link
Copy Markdown
Contributor

Summary

  • Adds CLAUDE.md at the repo root so future Claude Code sessions can come up to speed without re-deriving project conventions from scratch.

What's captured

Only the non-obvious stuff — not things a future instance could trivially discover with ls or by reading package.json:

  • Four-app monorepo shapebackend/ (main), web/ (React dashboard), mobile/ (Expo), and frontend/ (single static HTML page served by the backend, distinct from web/).
  • .env at repo root, not backend/server.js resolves it two levels up, which is easy to get wrong.
  • Auth middleware patternrequireAuth(minRole) is registered as a standalone middleware before the router so GETs stay public; AUTH_ENABLED auto-flips off when no keys are set (dev mode).
  • Migration convention — idempotent try { ALTER TABLE ... } catch {} appended to getDb() (see existing pay_rate_sats / overtime_multiplier additions).
  • Simulation seamslib/liquid.js is the designated Phase-2 GDK swap point; lib/lightning.js auto-enters DEMO_MODE when LNbits keys are placeholder/absent.
  • Cron registration is gated on require.main === module so tests/imports don't schedule jobs.
  • Test quirksNODE_ENV=test short-circuits both rate limiters; running a single test uses node --test --test-name-pattern='<regex>' test/api.test.js.

Test plan

  • Verify CLAUDE.md renders correctly on GitHub
  • Confirm commands listed (npm run dev, npm run seed, npm test, web lint/build, mobile start) match the actual package.json scripts

🤖 Generated with Claude Code

Captures non-obvious setup so future Claude Code sessions can be
productive without re-discovering it: the four-app monorepo layout,
.env lives at repo root (not backend/), the auth middleware pattern
applied before route mounting, the idempotent ALTER TABLE migration
convention, DEMO_MODE behavior for Lightning, and the designated
Phase-2 GDK swap point in lib/liquid.js.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant