This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- always write code that is 'future-proof' meaning it should work when the application is scaled; it should work the same in a production environment just as it does locally
- think about the big picture when fixing bugs; avoid using band-aid type fixes which tend to just mask issues
npm run dev- Start development server with Turbopacknpm run build- Build for productionnpm run start- Start production server
npm run lint- Run ESLintnpm run lint:fix- Run ESLint with auto-fixnpm run types- Run TypeScript type checkingnpm run format:write- Format code with Prettiernpm run clean- Run both lint:fix and format:write
npx drizzle-kit push- Push schema changes to databasenpx drizzle-kit generate- Generate migration filesnpx drizzle-kit migrate- Run migrationsnpx bun db/seed- Seed databasenpx supabase start- Start local Supabase instance
npm run test- Run all tests (unit + e2e)npm run test:unit- Run Jest unit testsnpm run test:e2e- Run Playwright e2e tests
npx shadcn@latest add [component-name]- Install new Shadcn UI components
This is a Next.js 15 SaaS template using the App Router with clear separation between authenticated and unauthenticated routes.
/app/(unauthenticated)- Public routes(marketing)- Landing pages, pricing, features(auth)- Login and signup flows
/app/(authenticated)- Protected routes requiring Clerk authdashboard- Main application with account, billing, support sections
/app/api- API routes including Stripe webhook handler
- Server Actions in
/actionsfor data mutations (customers, Stripe operations) - Database Schema in
/db/schemausing Drizzle ORM with PostgreSQL - UI Components in
/components/uifrom Shadcn UI library - Authentication handled by Clerk middleware with protected route groups
- Payments integrated via Stripe with webhook handling
- Authentication state managed by Clerk (
@clerk/nextjs) - Customer data stored in PostgreSQL via Drizzle ORM
- Stripe integration for subscription management
- Server actions handle all data mutations with proper auth checks
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY- Clerk public keyCLERK_SECRET_KEY- Clerk secret keySTRIPE_SECRET_KEY- Stripe secret key- Database connection handled by Supabase CLI