Skip to content

Commit 423db26

Browse files
committed
docs: add instructions for production Postgres database
1 parent 84a2f96 commit 423db26

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

.env.production

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ BILLING_PLAN_ENV=prod
1919
######## After creating the file, you can add the following variables.
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=saasboilerplateenv
23+
# Tested and compatible with SaaS Boilerplate
2224
# DATABASE_URL=postgresql://postgres@localhost:5432/postgres
2325

2426
# Stripe

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Packed with essential features like built-in **Authentication**, **Multi-Tenancy** with Team support, **Role & Permission**, Database, I18n (internationalization), Landing Page, User Dashboard, Form handling, SEO optimization, Logging, Error reporting 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), Testing, Deployment, Monitoring, and **User Impersonation**, this SaaS template provides everything you need to get started.
1010

11-
Designed with developers in mind, this **Next.js Starter Kit** uses TypeScript for type safety and integrates ESLint to maintain code quality, along with Prettier for consistent code formatting. The testing suite combines Vitest and React Testing Library for robust unit testing, while Playwright handles integration and E2E testing. Continuous integration and deployment are managed via GitHub Actions. For user management, authentication is handled by [Clerk](https://go.clerk.com/zGlzydF). For database operations, it uses Drizzle ORM for type-safe database management across popular databases like PostgreSQL, SQLite, and MySQL.
11+
Designed with developers in mind, this **Next.js Starter Kit** uses TypeScript for type safety and integrates ESLint to maintain code quality, along with Prettier for consistent code formatting. The testing suite combines Vitest and React Testing Library for robust unit testing, while Playwright handles integration and E2E testing. Continuous integration and deployment are managed via GitHub Actions. For user management, authentication is handled by [Clerk](https://go.clerk.com/zGlzydF). For database operations, it uses Drizzle ORM for type-safe database management across popular databases like PostgreSQL, SQLite, and MySQL. One recommended option is to use [Prisma PostgreSQL](https://www.prisma.io/?via=saasboilerplatetop), which provides a free PostgreSQL database that is compatible and has been tested with SaaS Boilerplate.
1212

1313
Whether you're building a new SaaS app or looking for a flexible, **production-ready SaaS template**, this boilerplate has you covered. This free, open-source starter kit has everything you need to accelerate your development and scale your product with ease.
1414

@@ -144,6 +144,7 @@ Developer experience first, extremely flexible code structure and only keep what
144144
- 👤 Multi-Factor Auth (MFA), Social Auth (Google, Facebook, Twitter, GitHub, Apple, and more), User Impersonation
145145
- 📦 Type-safe ORM with DrizzleORM, compatible with PostgreSQL, SQLite, and MySQL
146146
- 💽 Offline and local development database with PGlite
147+
- ☁️ Remote and production database with [Prisma Postgres](https://www.prisma.io/?via=saasboilerplate)
147148
- 🌐 Multi-language (i18n) with [next-intl](https://next-intl-docs.vercel.app/) and [Crowdin](https://l.crowdin.com/next-js)
148149
- ♻️ Type-safe environment variables with T3 Env
149150
- ⌨️ Form with [React Hook Form](https://react-hook-form.com)
@@ -212,6 +213,8 @@ Then, you can run the project locally in development mode with live reload by ex
212213
npm run dev
213214
```
214215

216+
[![Run the command in Warp](public/assets/images/warp-banner.png)](https://go.warp.dev/nextjs-bp)
217+
215218
Open http://localhost:3000 with your favorite browser to see your project.
216219

217220
### Free vs Pro version
@@ -269,6 +272,10 @@ Now, you have a fully working authentication system with Next.js: Sign up, Sign
269272

270273
The project uses DrizzleORM, a type-safe ORM that is compatible with PostgreSQL, SQLite, and MySQL databases. By default, the project is set up to work seamlessly with PostgreSQL and you can easily choose any PostgreSQL database provider.
271274

275+
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=saasboilerplate), which provides a free PostgreSQL database. This database is compatible and has been tested with Next.js Boilerplate.
276+
277+
After creating your Prisma account, you can get the connection string in the `Connect to your database` section and select the `Any client` tab. Then, you can generate the connection string by clicking the `Generate database credentials` button. Finally, you can copy the connection string and add the `DATABASE_URL` variable to the `.env.local` file.
278+
272279
### Translation (i18n) setup
273280

274281
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.
@@ -331,6 +338,8 @@ After making changes to the schema, generate a migration by running the followin
331338
npm run db:generate
332339
```
333340

341+
[![Run the command in Warp](public/assets/images/warp-banner.png)](https://go.warp.dev/nextjs-bp)
342+
334343
This will create a migration file that reflects your schema changes. The migration is automatically applied during the next database interaction, so there is no need to run it manually or restart the Next.js server.
335344

336345
### Commit Message Format
@@ -384,6 +393,8 @@ All unit tests are located alongside the source code in the same directory, maki
384393
npm run test
385394
```
386395

396+
[![Run the command in Warp](public/assets/images/warp-banner.png)](https://go.warp.dev/nextjs-bp)
397+
387398
### Integration & E2E Testing
388399

389400
The project uses Playwright for integration and end-to-end (E2E) testing. You can run the tests with the following commands:
@@ -427,6 +438,8 @@ Then, you can generate a production build with:
427438
$ npm run build
428439
```
429440

441+
[![Run the command in Warp](public/assets/images/warp-banner.png)](https://go.warp.dev/nextjs-bp)
442+
430443
It generates an optimized production build of the boilerplate. To test the generated build, run:
431444

432445
```shell
614 KB
Loading

src/libs/DB.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { Env } from './Env';
1515
let client;
1616
let drizzle;
1717

18+
// Need a database for production? Check out https://www.prisma.io/?via=saasboilerplatesrc
19+
// Tested and compatible with Next.js Boilerplate
1820
if (process.env.NEXT_PHASE !== PHASE_PRODUCTION_BUILD && Env.DATABASE_URL) {
1921
client = new Client({
2022
connectionString: Env.DATABASE_URL,

src/models/Schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import {
1717
// The migration is automatically applied during the next database interaction,
1818
// so there's no need to run it manually or restart the Next.js server.
1919

20+
// Need a database for production? Check out https://www.prisma.io/?via=saasboilerplatesrc
21+
// Tested and compatible with Next.js Boilerplate
2022
export const organizationSchema = pgTable(
2123
'organization',
2224
{

0 commit comments

Comments
 (0)