Codebase
Where things live. The behavior of those pieces is on the architecture page.
Directories
- app/ — route modules, server adapters in app/lib, and the UI catalog in app/ui.
- ai/ — the memory the coding agent reads. core/ is always loaded. decisions/, skills/, guides/, and tools/ load when a task matches.
- prisma/ — schema.prisma, migrations, and the SQLite file.
- mocks/ — MSW handlers. server/ for Node, client/ for the browser, fixtures/email/ for the last mocked message.
- scripts/ — the database-url wrapper and the Stripe plan script.
Routes
app/routes.ts calls autoRoutes() and exports the result. A file under app/routes/ is a URL. A name that starts with + is private to the route beside it and is not a URL. A directory does not wrap its children. _layout.tsx does.
The URL list is not handwritten. Flat-route filename prefixes are refused, because a shared prefix would silently become a layout. The kitchen-sink route is dropped from the production build after autoRoutes() runs. Typegen still sees it.
Sign-in is login.tsx. Account pages live in account/ with one layout. GitHub comes back through auth.$provider.callback.ts.
Server modules
Routes call these modules. They do not each open their own vendor client.
- app/lib/db.server.ts — the Prisma singleton.
- app/lib/env.server.ts — the Zod parse of process.env. It runs on the first request, not at import, so typegen and build do not need production secrets.
- app/lib/email.server.ts — sendEmail.
- app/lib/auth.server.ts — sessions, magic links, and the current user.
- app/lib/stripe.server.ts — the only Stripe client. app/lib/subscription.server.ts is what the rest of the app calls.
- app/lib/providers/github.server.ts — the OAuth adapter. It short-circuits when GitHub login is mocked.
UI catalog
The shadcn/ui look is source in this repo, on Base UI, styled with Tailwind CSS v4. Do not run the shadcn CLI. A second fetch of the same Button is a second source.
Files sit in three layers, and the folders sort in that order:
- app/ui/atoms/ — a catalog part with no product meaning. Grouped by job: actions, forms, navigation, feedback, overlays, layout, display.
- app/ui/composites/ — how this app always combines atoms. The folder appears with the first file.
- app/ui/sections/ — a named region used by more than one page. A region only one page renders stays in that route’s + folder.
Sections may import composites. Composites may import atoms. Atoms do not import upward. Routes may import all three.