Local Setup
This guide is for contributors developing Patchwork locally.
Repository Layout
Section titled “Repository Layout”src/app/— Next.js App Router pages and/api/*route handlerssrc/components/— UI components (PatchworkApp.tsx,CommandPalette.tsx,SystemConfigView.tsx,SetupWizard.tsx)src/db/— Drizzle PostgreSQL connection andsrc/db/schema.tssrc/lib/— Domain logic (rbac.ts,settings.ts,commands/,setup.ts,search.ts,realtime.ts)scripts/— Cross-platform Node.js CLI scripts (setup.mjs,seed.mjs,docs/)docs-site/— Separate Astro Starlight documentation packagetests/&e2e/— Vitest integration tests and Playwright E2E tests
Local Setup
Section titled “Local Setup”npm installnpm --prefix docs-site installCopy-Item .env.example .envnpm run db:reset:testnpm run seed -- --size smallnpm run devnpm installnpm --prefix docs-site installcp .env.example .envnpm run db:reset:testnpm run seed -- --size smallnpm run devRunning Verification
Section titled “Running Verification”npm run lintnpm run typechecknpm run testnpm run buildnpm run docs:checknpm run docs:buildFor the full end-to-end suite (including MinIO, PostgreSQL reset, Playwright E2E, and smoke checks), run npm run verify.
Expected Result
Section titled “Expected Result”http://localhost:3000 serves the seeded workspace and all unit, E2E, and docs checks pass on both Windows and Linux.