- Next.js App Router. Pages live in
app/(e.g.,app/album/[id]/page.tsx); API routes inapp/api/*/route.ts. - UI components in
components/(kebab-case files likephoto-grid.tsx; component names PascalCase). - Server utilities and configuration in
lib/(auth, db, guards, storage). - Data model in
prisma/schema.prisma. Static assets inpublic/. Global styles inapp/globals.css. - Key configs:
next.config.ts,tsconfig.json,eslint.config.mjs,postcss.config.mjs. Env files:.env,.env.example.
pnpm dev— start local dev server.pnpm build— production build.pnpm start— run the built app.pnpm lint— run ESLint and fix issues.pnpm prisma:generate— generate Prisma client fromschema.prisma.pnpm prisma:push— sync schema to the database.- Optional:
scripts/dev-start.sh,scripts/prod-start.shfor environment-specific starts.
- TypeScript + React functional components; prefer hooks and server components/actions where appropriate.
- Filenames: kebab-case (
upload-form.tsx,auth-guards.ts). Components: PascalCase. - Use Tailwind CSS utilities; keep styles in JSX; minimize custom CSS.
- Follow ESLint rules (
pnpm lint); keep imports clean; avoid unused code.
- No formal test suite yet. Add tests under
__tests__/or*.test.tsnear sources. - Focus tests on
lib/*andapp/api/*routes; mock Prisma DB where possible. - Keep tests fast and deterministic; document fixtures.
- Use Conventional Commits:
feat,fix,refactor,build,docswith optional scope (e.g.,feat(search): add album search). - PRs include: clear description, linked issues, steps to verify, and screenshots for UI changes.
- Keep PRs small and focused; update docs when behavior changes.
- Copy
.env.exampleto.envand set DB, NextAuth, storage (TOS), and branding vars. - Never commit secrets. After schema/config changes, run
pnpm prisma:pushand restart. - Containerization via
dockerfileis available; ensure envs are provided at runtime.