Recipe storage and display application built with Next.js.
- Framework: Next.js 16 (App Router, Turbopack)
- Language: TypeScript
- Auth: Better Auth
- Database: PostgreSQL
- Production: Neon
- Development: Postgres in Docker
- Tests: Postgres in Docker (separate container)
- ORM: Drizzle
- Deployment: Vercel (with Speed Insights)
app/ # Next.js App Router pages
components/ # React components (includes shadcn/ui)
db/
├── schema.ts # Drizzle schema definitions
├── index.ts # DB connection
├── seed.ts # Database seeding script
└── migrations/ # Drizzle migrations
lib/
├── auth.ts # Better Auth server config
├── auth-client.ts # Better Auth client config
├── cache.ts # React cache wrapper
└── utils.ts # Utility functions (cn)
pnpm dev— Start dev server (Turbopack)pnpm build— Production buildpnpm db:generate— Generate Drizzle migrationspnpm db:migrate— Run migrationspnpm db:studio— Open Drizzle Studiopnpm db:seed— Seed database with sample datapnpm typecheck— check types with tscpnpm lint— lintpnpm test— run unit tests
- Use TypeScript for all files
- Use Prettier with default config
- Use descriptive type names
- Prefer
condition ? 'value' : nullovercondition && 'value'in JSX - Prefer function declarations over function expressions
- Use named exports
Core entities:
- users — Managed by Better Auth
- recipes — title, description, servings, prepTime, cookTime, imageUrl, authorId
- ingredients — name, quantity, unit, recipeId
- steps — order, instruction, recipeId
- tags — name (many-to-many with recipes)
DATABASE_URL= # Postgres connection string
BETTER_AUTH_SECRET= # Auth secret
BETTER_AUTH_URL= # App URL for auth callbacks
- Start Postgres:
docker compose up -d - Copy
.env.exampleto.env.local - Run migrations:
pnpm db:migrate - Start dev server:
pnpm dev
- All times (prepTime, cookTime) stored in minutes
- Recipe images stored as URLs (external hosting)
- Soft delete for recipes (deletedAt timestamp)