docs: add CLAUDE.md with repo-specific guidance#36
Open
EricGrill wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLAUDE.mdat 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
lsor by readingpackage.json:backend/(main),web/(React dashboard),mobile/(Expo), andfrontend/(single static HTML page served by the backend, distinct fromweb/)..envat repo root, notbackend/—server.jsresolves it two levels up, which is easy to get wrong.requireAuth(minRole)is registered as a standalone middleware before the router so GETs stay public;AUTH_ENABLEDauto-flips off when no keys are set (dev mode).try { ALTER TABLE ... } catch {}appended togetDb()(see existingpay_rate_sats/overtime_multiplieradditions).lib/liquid.jsis the designated Phase-2 GDK swap point;lib/lightning.jsauto-entersDEMO_MODEwhen LNbits keys are placeholder/absent.require.main === moduleso tests/imports don't schedule jobs.NODE_ENV=testshort-circuits both rate limiters; running a single test usesnode --test --test-name-pattern='<regex>' test/api.test.js.Test plan
CLAUDE.mdrenders correctly on GitHubnpm run dev,npm run seed,npm test, web lint/build, mobile start) match the actual package.json scripts🤖 Generated with Claude Code