Developer Guide
This page is the practical workflow for extending ByteBox safely.
npm run setupThis creates .env if needed, installs deps, generates Prisma client, applies migrations, and seeds sample data.
Common Scripts
Section titled “Common Scripts”npm run dev- start Next.js dev server on port1334npm run build- production buildnpm run lint- lint projectnpm run db:generate- generate Prisma clientnpm run db:migrate- development migration workflownpm run db:seed- seed sample data
Quality Gate Before PR
Section titled “Quality Gate Before PR”npm run lintnpx tsc --noEmitnpm run buildnext.config.ts currently allows build with ignored TypeScript errors, so always run explicit typecheck.
Codebase Map
Section titled “Codebase Map”src/app/*- route pages and API handlerssrc/components/*- UI componentssrc/contexts/*- global state contextssrc/hooks/*- reusable behavior hookssrc/lib/*- shared utilities and DB layerprisma/*- schema, migrations, seed
Making API Changes
Section titled “Making API Changes”- Update route handler under
src/app/api/*. - Update DB helper in
src/lib/db/queries.tsif needed. - Validate impacted docs under API and concepts sections.
- Run lint/typecheck/build.
Migration Discipline
Section titled “Migration Discipline”- Keep migrations atomic and descriptive.
- Validate migration on clean DB and existing DB.
- Include any compatibility notes in changelog/docs.