A minimal full-stack starter template built with:
- 🔐 Clerk Authentication (Sign In / Sign Up)
- 🗄 Prisma ORM
- 🌐 ngrok Webhook Integration
- ⚡ Next.js App Router
Perfect foundation for SaaS apps, dashboards, or authenticated platforms.
- Clerk authentication (Google, GitHub, Email, Name + Last Name)
- Prisma + PostgreSQL database
- Automatic user creation via Clerk webhooks
- Local webhook development using ngrok
- Clean scalable starter structure
You need accounts for:
git clone https://github.com/KapteynUniverse/nextjs-clerk-prisma-starter-template
cd nextjs-clerk-prisma-starter-template
npm installnpx prisma init --db --output ../app/generated/prismaYou’ll be prompted to:
- Choose the region closest to you
- Enter a database name
This creates:
prisma/directoryschema.prismaDATABASE_URLin.env
npx prisma migrate dev --name init
npx prisma generateThis will:
- Create database tables
- Generate Prisma Client
- Sign in to Clerk:
- Click Create Application
- Enter a title
- Select sign-in options:
- GitHub
- Name + Last Name
- Click Create Application
Create a .env file in the root:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="<your-publishable-key>"
CLERK_SECRET_KEY="<your-secret-key>"Clerk sends events like user.created via webhooks.
FDuring local development, your app must be publicly accessible so Clerk can deliver these events.
npm install --global ngrok
ngrok http 3000Copy the Forwarding URL shown in the terminal.
Example:
"https://a60b-99-42-62-240.ngrok-free.app"
- Go to Clerk Dashboard
- Navigate to: Configure → Developers → Webhooks
- Click Add Endpoint
- Paste:
"https://your-ngrok-url.ngrok-free.app/api/webhooks/clerk"
Copy the Signing Secret from Clerk and update .env:
# Prisma
DATABASE_URL= "<your-database-url>"
# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="<your-publishable-key>"
CLERK_SECRET_KEY="<your-secret-key>"
CLERK_WEBHOOK_SIGNING_SECRET="<your-signing-secret>"Start the dev server:
npm run dev- Visit
http://localhost:3000 - Click Sign Up
- Create an account
Open Prisma Studio:
npx prisma studioYou should see a User record in your database.
- Clerk handles authentication
- Webhooks sync user data into Prisma
- PostgreSQL stores application data
- ngrok enables local webhook development