Next.js + Neon
Overview of the Next.js + Neon starter: stack, what ships out of the box, prerequisites and where to go next.
This kit uses Next.js App Router, Neon Postgres, Drizzle and Better Auth. You get the account, workspace and project foundation, a separately deployed admin app, and separate agent connections for users and application administrators.
Open the live demo · Repository
The repository name still says PlanetScale
The repository is nextjs-planetscale-starter because the kit started on PlanetScale. The current main branch is a Neon Postgres implementation: Drizzle with node-postgres, a Postgres 17 container for local work, and Postgres migrations in apps/database/drizzle-postgres/. The old MySQL migrations in apps/database/drizzle/ are kept for reference only and are never applied. You don't need a PlanetScale account.
The stack
| Layer | What the kit uses |
|---|---|
| Frontend | Next.js 16 App Router with React 19, Tailwind CSS 4 and shadcn/ui |
| Apps | apps/web for customers on port 3000 and apps/admin for administrators on port 3001, sharing one database and the web app's server modules |
| Database | Neon Postgres in production, Postgres 17 in Docker locally, Drizzle ORM with node-postgres |
| Authentication | Better Auth with the admin, organization, magic link, API key, one-time token and Stripe plugins |
| Storage | Any S3-compatible bucket; MinIO locally |
| Realtime | Centrifugo fed by a transactional outbox and a dispatcher process |
| React Email templates sent through SMTP (Mailpit locally) or Resend | |
| Hosting used by the demo | Vercel for the website and the admin app (two projects), Neon for the database |
What you get out of the box
- Accounts with email and password, email verification, password reset, magic links, email change and account deletion.
- Workspaces built on Better Auth organizations, with
owner,admin,memberandreadonlyroles, invitations and member management. - Projects inside a workspace, with comments and notifications.
- An onboarding flow at
/onboardingand a user area at/user/settings, including security settings and API keys under/user/settings/developer. - A separate admin app in
apps/adminwith its own sign-in page, an admin panel at/app-admin(users, workspaces, a marketing CMS for blog, authors, tags and changelog, payment gateway views and settings) and moderation views for feedback and the roadmap. Admins can ban users, change application roles, create users, send login links and impersonate customers through an audited handoff to the web app. - A public feedback board and roadmap, plus marketing pages, blog and changelog in the web app.
- A User MCP at
/mcp/useron the web app and an Admin MCP at/mcp/adminon the admin app, both read-only, with OAuth consent built in. See agent connections. - Optional integrations that render a disabled state until configured: Stripe billing, OpenAI chat and image generation, PostHog, Google Analytics, Sentry and Vercel Analytics.
- Audit logs and outbox events written in the same transaction as every mutation.
- Shared instructions and skills for AI coding tools (Claude Code, Codex, Cursor and others), generated from
AGENTS.mdand.agents/.
Authorization lives in server code. There is no row-level security for application data in this kit; every query and action checks the signed-in actor and their workspace membership.
Prerequisites
- Node.js 24 or newer. The web and admin apps declare
"node": ">=24.0.0"and CI runs on Node 24. - pnpm 10.33.0, declared in the root
package.jsonpackageManagerfield. Runcorepack enableand let Corepack pick it. - Docker with Compose. The local stack starts Postgres, MinIO, Mailpit, Valkey and Centrifugo from
apps/database/docker-compose.yml. - Access to the GitHub repository with the account that has your license.
- For production: a Neon account, a Vercel account (two projects, one per app), an S3-compatible bucket and a Resend account (or another SMTP sender). Stripe is optional.
Next steps
- Installation: clone, start the local stack and the two apps, and sign in with a seeded account.
- Environment variables: every variable in
.env.exampleandapps/admin/.env.local.exampleand what it does. - Authentication: how Better Auth is configured and how admin access works across the two apps.
- Agent connections: the User and Admin MCP servers in this kit.
- Project structure: the monorepo and where to make changes.
- Deployment: Neon, migrations and the two Vercel projects.
For the shared concepts, read getting started and workspaces and the admin area.