Skip to content

Commit c710d89

Browse files
committed
docs: add recommended database for production
1 parent 6053ff8 commit c710d89

File tree

6 files changed

+25
-2
lines changed

6 files changed

+25
-2
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
1212

1313
# Database
1414
# Local database with PGLite, already included in the project, no Docker needed
15+
# Need a database for production? Check out https://www.prisma.io/?via=nextjsboilerplate
16+
# Tested and compatible with Next.js Boilerplate
1517
DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/postgres
1618

1719
# Next.js

.env.production

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ NEXT_PUBLIC_SENTRY_DSN=
1919

2020
# Database
2121
# Using an incorrect DATABASE_URL value, Next.js build will timeout and you will get the following error: "because it took more than 60 seconds"
22+
# Need a database for production? Check out https://www.prisma.io/?via=nextjsboilerplate
23+
# Tested and compatible with Next.js Boilerplate
2224
# DATABASE_URL=postgresql://postgres@localhost:5432/postgres
2325

2426
# Error monitoring

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</a>
1111
</p>
1212

13-
🚀 Boilerplate and Starter for Next.js with App Router, Tailwind CSS, and TypeScript ⚡️ Prioritizing developer experience first: Next.js, TypeScript, ESLint, Prettier, Lefthook (replacing Husky), Lint-Staged, Vitest (replacing Jest), Testing Library, Playwright, Commitlint, VSCode, Tailwind CSS, Authentication with [Clerk](https://clerk.com?utm_source=github&utm_medium=sponsorship&utm_campaign=nextjs-boilerplate), Database with DrizzleORM (PostgreSQL, SQLite, and MySQL), Error Monitoring with [Sentry](https://sentry.io/for/nextjs/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo), Logging with Pino.js and Log Management, Monitoring as Code, Storybook, Multi-language (i18n), AI-powered code reviews with [CodeRabbit](https://www.coderabbit.ai?utm_source=next_js_starter&utm_medium=github&utm_campaign=next_js_starter_oss_2025), Secure with [Arcjet](https://launch.arcjet.com/Q6eLbRE) (Bot detection, Rate limiting, Attack protection, etc.) and more.
13+
🚀 Boilerplate and Starter for Next.js with App Router, Tailwind CSS, and TypeScript ⚡️ Prioritizing developer experience first: Next.js, TypeScript, ESLint, Prettier, Lefthook (replacing Husky), Lint-Staged, Vitest (replacing Jest), Testing Library, Playwright, Commitlint, VSCode, Tailwind CSS, Authentication with [Clerk](https://clerk.com?utm_source=github&utm_medium=sponsorship&utm_campaign=nextjs-boilerplate), Database with DrizzleORM (PostgreSQL, SQLite, and MySQL), Local database with PGlite and production with [Prisma Postgres](https://www.prisma.io/?via=nextjs-boilerplate), Error Monitoring with [Sentry](https://sentry.io/for/nextjs/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo), Logging with Pino.js and Log Management, Monitoring as Code, Storybook, Multi-language (i18n), AI-powered code reviews with [CodeRabbit](https://www.coderabbit.ai?utm_source=next_js_starter&utm_medium=github&utm_campaign=next_js_starter_oss_2025), Secure with [Arcjet](https://launch.arcjet.com/Q6eLbRE) (Bot detection, Rate limiting, Attack protection, etc.) and more.
1414

1515
Clone this project and use it to create your own Next.js project. You can check out the live demo at [Next.js Boilerplate](https://demo.nextjs-boilerplate.com), which includes a working authentication system.
1616

@@ -150,7 +150,7 @@ Developer experience first, extremely flexible code structure and only keep what
150150
- ⌨️ Form handling with React Hook Form
151151
- 🔴 Validation library with Zod
152152
- 📏 Linter with [ESLint](https://eslint.org) (default Next.js, Next.js Core Web Vitals, Tailwind CSS and Antfu configuration)
153-
- 💖 Code Formatter with [Prettier](https://prettier.io)
153+
- 💖 Code Formatter with Prettier
154154
- 🦊 Husky for Git Hooks (replaced by Lefthook)
155155
- 🚫 Lint-staged for running linters on Git staged files
156156
- 🚓 Lint git commit with Commitlint
@@ -234,6 +234,10 @@ Now you have a fully functional authentication system with Next.js, including fe
234234

235235
The project uses DrizzleORM, a type-safe ORM that is compatible with PostgreSQL, SQLite, and MySQL databases. By default, the project is configured to seamlessly work with PostgreSQL, and you have the flexibility to choose any PostgreSQL database provider of your choice.
236236

237+
To set up a remote and production database, you need to create a PostgreSQL database and obtain the connection string. One recommended option is to use [Prisma PostgreSQL](https://www.prisma.io/?via=nextjs-boilerplate), which provides a free PostgreSQL database and compatible with Next.js Boilerplate.
238+
239+
After creating your Prisma account, you can get the connection string in the section `Connect to your database` and select `Any client` tab. Then, you can generate the connection string by clicking on the `Generate database credentials` button. Finally, you can copy the connection string and add the `DATABASE_URL` variable in the `.env.local` file.
240+
237241
### Translation (i18n) setup
238242

239243
For translation, the project uses `next-intl` combined with [Crowdin](https://l.crowdin.com/next-js). As a developer, you only need to take care of the English (or another default language) version. Translations for other languages are automatically generated and handled by Crowdin. You can use Crowdin to collaborate with your translation team or translate the messages yourself with the help of machine translation.

src/app/[locale]/(marketing)/page.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ export default async function Index(props: IIndexProps) {
6969
(includes passwordless, social, and multi-factor auth)
7070
</li>
7171
<li>📦 ORM with DrizzleORM (PostgreSQL, SQLite, MySQL support)</li>
72+
<li>
73+
💽 Dev database with PGlite and production with
74+
{' '}
75+
<a
76+
className="font-bold text-blue-700 hover:border-b-2 hover:border-blue-700"
77+
href="https://www.prisma.io/?via=nextjsindex"
78+
>
79+
Prisma PostgreSQL
80+
</a>
81+
</li>
7282
<li>
7383
🌐 Multi-language support (i18n) with next-intl and
7484
{' '}

src/libs/DB.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const globalForDb = globalThis as unknown as {
1010
drizzle: NodePgDatabase<typeof schema>;
1111
};
1212

13+
// Need a database for production? Check out https://www.prisma.io/?via=nextjsboilerplate
14+
// Tested and compatible with Next.js Boilerplate
1315
const createDbConnection = () => {
1416
return drizzle({
1517
connection: {

src/models/Schema.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import { integer, pgTable, serial, timestamp } from 'drizzle-orm/pg-core';
1010
// The migration is automatically applied during the next database interaction,
1111
// so there's no need to run it manually or restart the Next.js server.
1212

13+
// Need a database for production? Check out https://www.prisma.io/?via=nextjsboilerplate
14+
// Tested and compatible with Next.js Boilerplate
15+
1316
export const counterSchema = pgTable('counter', {
1417
id: serial('id').primaryKey(),
1518
count: integer('count').default(0),

0 commit comments

Comments
 (0)