Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Next.js starter that provisions a per-user Turso SQLite database, with Clerk auth and Drizzle.

Astro landing page starter with gradient background, responsive hamburger/dropdown menu, and switchable floating/fullscreen headers.
The Turso Per User Starter is an open-source Next.js boilerplate that demonstrates a SaaS multitenancy pattern where every authenticated user receives their own isolated SQLite database on Turso. It pairs Next.js with Clerk authentication, Drizzle ORM, Tailwind CSS, and the Turso Platforms API to handle per-user database provisioning automatically.
The Turso Per User Starter is a Next.js application that uses the Turso Platforms API to create a database per user. It takes a newly authenticated Clerk user as input and produces a dedicated Turso SQLite database, so app data stays logically isolated across tenants. The code is published on GitHub under the repository notrab/turso-per-user-starter and is designed to be deployed to Vercel with one click.
db/schema.ts and npm scripts (db:generate, db:migrate) to create and apply migrations against each user database.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY, TURSO_API_TOKEN, TURSO_ORG, TURSO_DATABASE_NAME, and TURSO_GROUP_AUTH_TOKEN.npm run dev.db/schema.ts, run npm run db:generate, then npm run db:migrate to evolve each user's database schema.The typical setup begins by cloning the repository, then using the Turso CLI to create a database, a group token, and an API token. After adding the Clerk keys and running migrations, the app launches at localhost:3000. When a user signs in, the app calls the Turso Platforms API and provisions a dedicated database owned by that user.
The template itself is open source and hosted on GitHub, so there is no license cost. Using it live requires accounts with Turso, Clerk, and Vercel; each service has its own free tier and paid plans, so the total cost depends on your usage.
Use the Deploy with Vercel button in the README. Vercel prompts you for the six environment variables (NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY, TURSO_API_TOKEN, TURSO_ORG, TURSO_DATABASE_NAME, TURSO_GROUP_AUTH_TOKEN) and then builds the project.
Yes. The repository wiki has a section on using Clerk webhooks in both local and production setups to automate database creation so users don't wait on provisioning during sign-up.
You need Node.js and npm, the Turso CLI, a Turso account, and a Clerk application. The README walks through each step, including creating a group token for the default group.
