CodeVetter · Repo Unpack · System map
blitz-js/blitz
The repository separates shared Blitz facilities from authentication, RPC, and Next.js adaptation. Browser and server package entrypoints expose different runtime surfaces, while build loaders connect application resolver imports to HTTP endpoints. Example apps and integration projects consume the same versioned packages and own their databases. Root orchestration builds packages and applications and releases packages through Changesets.
- The workspace spans apps, packages, integration-tests, and recipes; package.json pins pnpm@8.6.6 and delegates build, lint, and test to Turbo.
- The blitz executable loads dist/index.cjs; CLI dispatch lazily imports development, build, start, export, scaffolding, generation, codegen, database, console, and route commands.
- blitz, @blitzjs/next, @blitzjs/rpc, and @blitzjs/auth declare server CJS/ESM entrypoints, a browser entrypoint, and server type declarations.
- setupBlitzServer initializes logging, reduces server plugins, and returns gSSP, gSP, api, and plugin exports; setupBlitzClient returns a withBlitz app wrapper and client plugin exports.
- withBlitz installs RPC Webpack rules or Turbopack rules and starts route-manifest watching outside production and test modes.
- Authentication storage is supplied by the application: PrismaStorage implements session CRUD, while the toolkit-app fixture models User, Session, and Token in SQLite.
- Both Next router architectures are represented: toolkit-app wraps rpcHandler with api, whereas next13 exports GET, POST, and HEAD from withBlitzAuth(rpcAppHandler()).
- Turbo builds dependencies before build/buildapp/test tasks and records dist, .next, or coverage outputs; development tasks are persistent and uncached.
- Deployment-related source includes Next build/start scripts in example apps and npm package publication through a main-branch Changesets release workflow.