Files
Alejandro Gutiérrez 3527e732d4 feat: turbostarter boilerplate
Production-ready Next.js boilerplate with:
- Runtime env validation (fail-fast on missing vars)
- Feature-gated config (S3, Stripe, email, OAuth)
- Docker + Coolify deployment pipeline
- PostgreSQL + pgvector, MinIO S3, Better Auth
- TypeScript strict mode (no ignoreBuildErrors)
- i18n (en/es), AI modules, billing, monitoring

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 01:01:55 +01:00

3.4 KiB

title, description, url
title description url
Overview Get started with the database. /docs/web/database/overview

Overview

We're using Drizzle ORM to interact with the database. It basically adds a little layer of abstraction between our code and the database.

If you know SQL, you know Drizzle.

For the database we're leveraging PostgreSQL, but you could use any other database that Drizzle ORM supports (basically any SQL database e.g. MySQL, SQLite, etc.).

Drizzle ORM is a powerful tool that allows you to interact with the database in a type-safe manner. It ships with **0** (!) dependencies and is designed to be fast and easy to use.

Setup

To start interacting with the database you first need to ensure that your database service instance is up and running.

<Tabs items={["Local development", "Cloud instance"]}> For local development we recommend using the Docker container.

You can start the container with the following command:

```bash
pnpm services:setup
```

This will start all the services (including the database container) and initialize the database with the latest schema.

**Where is DATABASE\_URL?**

`DATABASE_URL` is a connection string that is used to connect to the database. When the command will finish it will be displayed in the console and setup to your environment variables.
You can also use a cloud instance of database (e.g. [Supabase](/docs/web/recipes/supabase), [Neon](https://neon.tech/), [Turso](https://turso.tech/), etc.), although it's not recommended for local development.
If you choose Supabase as your provider, follow the [Supabase recipe](/docs/web/recipes/supabase#configure-environment-variables) for details on configuring `DATABASE_URL` and running migrations.

**Where is DATABASE\_URL?**

It's available in your provider's project dashboard. You'll need to copy the connection string from there and add it to your `.env.local` file. The format will look something like:

* Neon: `postgresql://user:password@ep-xyz-123.region.aws.neon.tech/dbname`
* Turso: `libsql://your-db-xyz.turso.io`

Make sure to keep this URL secure and never commit it to version control.

Then, you need to set DATABASE_URL environment variable in root .env.local file.

# The database URL is used to connect to your database.
DATABASE_URL="postgresql://postgres:postgres@127.0.0.1:54322/postgres"

You're ready to go! 🥳

Studio

TurboStarter provides you also with an interactive UI where you can explore your database and test queries called Studio.

To run the Studio, you can use the following command:

pnpm with-env pnpm --filter @turbostarter/db db:studio

This will start the Studio on https://local.drizzle.studio.

Drizzle Studio

Next steps