Modern Next.js app with Postgres (Docker) + Prisma, Tailwind CSS v4, ESLint/Prettier, and Better Auth.
- Framework:
next@15,react@19 - DB & ORM: Postgres (Docker) + Prisma
- Auth:
better-auth - UI: Tailwind CSS v4, Radix UI + shadcn components, Lucide icons
- Tooling: ESLint, Prettier, TypeScript
- Node.js 18+ and npm
- Docker Desktop (for the Postgres container)
-
Install deps:
npm install
-
Configure env (create a
.envfile in project root):# Database DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres" # App base URL for auth client (adjust when deploying) BASE_URL="http://localhost:3000"
-
Start dev (spins up Postgres via Docker and Next.js):
npm run dev
-
Run initial Prisma setup in another terminal:
npx prisma generate npx prisma migrate dev --name init # Optional: open Prisma Studio npx prisma studio
- dev:
docker-compose up -d && next dev --turbopack - build:
next build --turbopack - start:
next start - lint:
eslint - prettier:
npx prettier . --write - prettier:check:
npx prettier . --check
Docker service defined in docker-compose.yaml:
- Image:
postgres:latest - Connection:
postgres://postgres:postgres@localhost:5432/postgresEnsure Docker is running beforenpm run dev.
- Server runs at
http://localhost:3000. - Update
BASE_URLwhen deploying (e.g., Vercel URL) sosrc/lib/auth-client.tscan use it. - Prisma is configured in
prisma/schema.prismawith providerpostgresqlandDATABASE_URLfrom env.