This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
pnpm dev # Start dev server (auto-opens browser at localhost:3000)
pnpm build # Lint + production build
pnpm test # Format + lint + build + Playwright E2E tests (full CI suite)Playwright tests require a running server (next start or existing dev server). To run a single test file:
npx playwright test tests/public/00_initial_load.spec.tsHusky pre-commit hooks run Prettier automatically on staged files.
Next.js App Router with the src/ directory. Package manager is pnpm.
src/app/— Pages using App Router conventions(homepage)/— Home page (route group, no URL segment)admin/— Protected admin area: whisky journal CRUD, film list CRUD, Chopin Liszt shopping list, holidayscocktails/,films/,whiskyjournal/,games/,decisionmaker/— Public-facing features
src/components/— All React components in a flat structure (no subdirectories)src/services/— Server-side Postgres query functions (authenticate.ts,chopinliszt.ts,filmlist.ts,whiskyjournal.ts)src/actions/— Next.js server actions (currently onlysignOutAction.ts)src/styles/— Global CSS, CSS modules, and the Mantine theme (acalat.tsx)
Auth.js uses two config files intentionally:
src/auth.config.ts— Edge-runtime-safe config (route protection callbacks, sign-in page redirect). Used by middleware.src/auth.ts— Full Node.js auth config with the credentials provider (bcrypt + Postgres). Not safe for Edge.src/proxy.ts— Acts asmiddleware.ts; re-exports the edge-compatible auth. All routes under/adminrequire authentication.
Vercel Postgres (hosted on Neon), accessed via @vercel/postgres. The .env file must have credentials — see .env.example. Tables: users, whisky_journal, film_list, chopin_liszt.
Database seeding is done by creating a temporary src/app/seed/route.ts (git-ignored) and hitting http://localhost:3000/seed locally. See src/seed.md for the full pattern and table schemas.
Mantine v8 with a custom theme (acalat), dark mode by default. Icons from Tabler. PostCSS is configured for Mantine via postcss-preset-mantine.
Playwright E2E tests in tests/, split into three folders:
tests/public/— Public pages, no auth neededtests/public-database/— Public pages that read from the databasetests/admin/— Admin area (requires auth)
Tests run against Mobile Chrome, Desktop Chrome, and Firefox (Safari/WebKit disabled).