Build Internal Tools Using Neon, StackAuth, and Vercel
An open-source Next.js template for internal tools combines Neon serverless Postgres, Stack Auth and Vercel free tiers to provide a database, API routes, authentication, role-based access control and an admin panel. Setup takes a few steps: clone the repo, fill in the env vars, push the schema with drizzle-kit, create nested admin/user roles in Neon's Auth tab, claim admin at /setup and deploy to Vercel. Access is controlled by verified-email domain whitelisting, per-email grants for contractors and explicit blocklists, all managed from /tools/admin. New tools are added under app/tools and registered in config/app.ts.
Related posts
- Next.js authentication using Clerk, Drizzle ORM, and Neon
Neon mediumAdept
Clerk can handle authentication for a Next.js 14 App Router app while Drizzle ORM and Neon's serverless HTTP driver store non-PII data keyed by the Clerk user ID. The walkthrough defines a Drizzle schema, generates and pushes migrations with Drizzle Kit, and protects routes with Clerk's authMiddleware and ClerkProvider/UserButton. It then implements Server Actions that use currentUser() to insert and delete a per-user row. PII stays in Clerk's compliant infrastructure, and only the user ID is referenced in Postgres.
- How to Build a Secure Project Management Platform with Next.js, Clerk, and Neon
Neon mediumAdept
A security-first tutorial for building Kozi, a collaborative project management app, using Next.js, Clerk authentication and a Neon serverless Postgres database accessed through Prisma. Security rests on three layers: Clerk middleware protecting every /app route, server actions as the only path to the database so credentials never reach the client, and cross-checking the requesting user ID against record ownership on every read and write. The guide walks through the Prisma schema, the middleware configuration, sidebar and layout components, and task server actions that verify ownership before mutating data.
- The agent builds the app, the user claims the database: how Ideavo does it
Neon easyNovice
Ideavo, a bring-your-own-key AI app builder, has its agent provision a separate Neon Postgres project for every generated app through the Neon API. The connection string goes into the app's .env as DATABASE_URL, and the agent then sets up Drizzle and runs migrations without the credential ever entering the LLM context. Users can later take ownership of the database through Neon's claim/transfer flow while keeping the same connection string. The team chose Neon over Supabase's bundled services and over self-hosting a database fleet to avoid lock-in and keep operational load low for a small team.
- A database for every preview environment using Neon, GitHub Actions, and Vercel
Neon mediumAdept
Neon's copy-on-write branching can give every pull request its own production-like Postgres database, avoiding the bottlenecks of shared staging or shared preview databases. Branches are isolated, are created in about a second regardless of database size, and bill only for unique data. A GitHub Actions pipeline creates a Neon branch per PR, runs Prisma migrations against it, deploys a Vercel preview wired to that branch, and comments the URLs on the PR. Merging applies migrations to the primary branch, deploys to production and deletes the preview branch.
- Introducing neon.ts: infrastructure as code for your Neon projects
Neon mediumAdept
neon.ts is a TypeScript infrastructure-as-code file for Neon projects that declares services (Postgres, Neon Auth, Data API, with functions, buckets and an AI gateway coming under a preview block) and provisions them with `neon config plan` and `neon config apply`. A companion `@neondatabase/env` package provides `parseEnv`, which validates `process.env` against the declared services and returns a typed env object, with optional per-app subsets. A programmable `branch` function sets TTL, autoscaling limits and scale-to-zero for new branches created via `neon checkout`. Type-level encoding of service dependencies turns cryptic `never` errors into messages that explain the fix, such as requiring Neon Auth for the Data API.