Database
Choose Your Boilerplate
If Using Prisma Boilerplate
The boilerplate comes with Postgres. To use a different database:
- Switch to MySQL:
// schema.prisma
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
- Apply changes:
npx prisma generate
npx prisma db push
If Using Mongoose Boilerplate
The boilerplate comes with MongoDB setup. To use MongoDB Atlas:
- Visit MongoDB Atlas
- Create Project & Cluster
- Setup Access:
- Database Access: Create user
- Network Access: Allow IP
- Get connection string from: Database → Connect → Drivers
- Replace existing connection string in your config
Choose the guide based on your selected boilerplate. Each boilerplate is pre-configured - you only need to change the database provider (Prisma) or connection (MongoDB).