Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Simple Next.js template that uses a Postgres database and Kysely as the query builder.
Postgres + Kysely Next.js Starter is a Vercel-published boilerplate for creating Next.js applications that connect to a PostgreSQL database and interact with it using the Kysely query builder. The starter is part of Vercel's official examples repository and ships with Tailwind CSS preconfigured, a live demo, and one-click deployment to Vercel.
The Postgres + Kysely Next.js Starter is a template for building full-stack web applications with Next.js as the framework, PostgreSQL as the database, and Kysely as the typed SQL query builder. It takes database connection credentials via environment variables and produces a runnable Next.js app with a query layer ready to use. The template is maintained by Vercel and is available in the Vercel examples GitHub repository.
create-next-app, copy .env.example to .env.local, configure variables, and run pnpm dev.The starter is aimed at developers who want to skip environment setup and jump straight into building a Next.js app with a Postgres database. It suits full-stack developers who need a clean query layer and prefer typed SQL over a heavy ORM. Teams deploying to Vercel will find the one-click deploy and integration with Vercel Postgres convenient.
The template can be used in two ways: you can deploy it directly to Vercel with the one-click button, or clone it locally using pnpm create next-app --example from the Vercel examples repository. After cloning, copy .env.example to .env.local, fill in the database credentials from Vercel Postgres, and run pnpm dev for local development.
Use the one-click Deploy with Vercel button, which clones the repository and sets up the project on Vercel automatically. Alternatively, clone the repo locally and push it to your own Git provider, then import it into Vercel.
Kysely is a TypeScript SQL query builder that provides type safety and autocompletion for database queries without the overhead of a full ORM. It supports Postgres and other SQL dialects.
The starter is configured for PostgreSQL, specifically Vercel Postgres, a hosted Postgres service integrated with Vercel. You connect by setting environment variables in your project.
Yes. The project includes a .env.example file; you copy it to .env.local and set the connection details for your Postgres database before running the app locally or deploying.
