This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Development:
npm run dev(uses turbopack for faster builds) - Build:
npm run build - Production:
npm start - Lint:
npm run lint - Tests:
npm test(runs Playwright tests) - Tests UI Mode:
npm test:ui(runs Playwright tests in UI mode) - Email Dev Server:
npm run email(runs React Email dev server)
This is a Next.js 15 app using the App Router with TypeScript and Tailwind CSS.
- Uses better-auth library with Prisma adapter
- Email/password authentication enabled
- Auth configuration in
src/lib/auth.ts(server) andsrc/lib/auth-client.ts(client) - Protected routes use
(auth)route group pattern - Database-backed sessions with PostgreSQL
- Prisma ORM with PostgreSQL
- Schema located in
prisma/schema.prisma - Generated client output:
@prisma/client - Models: User, Session, Account, Verification (better-auth tables)
- After schema changes, run:
npx prisma generateandnpx prisma db push
- ThemeProvider: Manages dark mode state via
src/context/theme-context.tsx. Wrapped around the entire app in layout. - RecipeVariablesContext: Manages recipe form state including country selection, dietary requirements, and special requests in
src/context/recipe-variables-context.tsx. Handles API submission to/api/updateRecipe.
/api/updateRecipe: Generates traditional recipes via OpenAI API (gpt-3.5-turbo) with streaming responses. Also generates DALL-E 3 images based on recipes. Supports email delivery via Resend./api/auth/[...all]: better-auth catch-all route handler/api/mock: Mock endpoint for testing
- Built with Radix UI primitives (checkbox, label, switch, slot)
- Custom components in
src/components/ui/ - Styled with Tailwind CSS 4 and
class-variance-authorityfor component variants - Uses Geist and Geist Mono fonts
- Form validation with react-hook-form and Zod (schemas in
src/lib/validation-schemas.tsx) - Toast notifications via sonner
- Interactive world map using react-simple-maps for country selection (
src/components/map.tsx) - Dark mode toggle functionality
- Recipe generation with streaming responses and AI-generated images
- Email delivery of recipes using React Email components (templates in
src/components/ui/Email/) - Audio playback with wavesurfer.js
/- Main recipe interface page/(auth)/sign-in- Sign in page/(auth)/sign-up- Sign up page/login- Legacy login page/recipe-ui- Recipe UI page
Required environment variables:
DATABASE_URL- PostgreSQL connection stringOPENAI_API_KEY- OpenAI API key for recipe generationRESEND_API_KEY- Resend API key for email delivery
- Playwright for end-to-end testing
- Test files in
tests/directory - Example:
tests/updateRecipe.spec.tstests the recipe API endpoint - Run tests with
npm testornpm test:ui
@/*maps to./src/*for cleaner imports