A modern SaaS boilerplate that combines Next.js 16, Clerk authentication, and Convex real-time data, enabling you to launch dashboards, billing flows, and synced user records with minimal setup.
- ✅ Pre-wired Clerk auth (UI + JWT templates) with Convex validation
- ✅ Convex schema + mutations to keep a
userstable synced via Clerk webhooks - ✅ HTTP endpoint (
/clerk-users-webhook) that verifies Svix signatures - ✅ Shared React provider (
ConvexProviderWithClerk) for safe Convex hooks - ✅ Tailwind-ready UI primitives, theme toggling, and placeholder public/dashboard routes
See docs/setup.md for the full walk-through.
- Next.js App Router (Turbopack dev server)
- Clerk for auth UI and JWT issuance
- Convex for data, server functions, and webhooks
- Tailwind CSS + shadcn/ui components
- pnpm for dependency management
-
Clone the repository template to your desired directory.
-
After cloning the repository, open a terminal in your cloned repository, then run the setup script to create a new project by executing:
./setup.bash- Install the necessary packages by executing the command below:
pnpm install- After installing the dependencies, create an account and project in Convex, after which you can execute the command below and select your project:
pnpm convex:dev
or
pnpm dlx convex dev-
Then, we need to create an account in Clerk, which has simple steps to follow in their documentation. Make sure to copy the environment variables mentioned in their documentation and paste them into the
.env.localfile created by Convex. -
Once the Convex and Clerk environment variables are saved in
.env.local, we need to set up the webhook. Go to the HTTP File and copy the path (/clerk-users-webhook), then append it to yourNEXT_PUBLIC_CONVEX_URL, and change.cloudto.site, resulting in something like this:https://..x.convex.site/clerk-users-webhook. After obtaining that value, you can paste it into the Clerk webhook settings. -
Make sure you have updated the Convex environment variables; they should include
CLERK_JWT_ISSUER_DOMAINandCLERK_WEBHOOK_SECRETset up there. -
After configuring both Clerk and Convex, you can execute:
pnpm devOr launch everything at once—Convex dev server, Convex dashboard, and the app—with:
pnpm start:allOpen http://localhost:3000 to view the public marketing page. Use the Clerk modal to sign in. Convex verifies the JWT, saves user details via the webhook, and enables you to begin querying the synced records for dashboards.
| Command | Description |
|---|---|
pnpm dev |
Start Next.js (Turbopack). |
pnpm build |
Production build. |
pnpm start |
Run the built Next.js app. |
pnpm lint |
ESLint. |
pnpm convex:dev |
Start Convex dev server + hot reload functions. |
- Fork or clone the repo.
- Update
convex/schema.tsand runpnpm convex:devto sync schema. - Extend
convex/users.tswith more metadata (roles, billing state, etc.). - Build dashboard routes under
app/(dashboard)/. - Add billing integrations (Stripe, Lemon Squeezy, etc.) – place hooks in Convex actions/mutations for a unified backend.
Pull requests are welcome! This template is meant to stay lean but pragmatic; If something slows down your setup, feel free to improve it and share.
