Configure
Learn how to set up the MongoDB database for local development.
Set Up MongoDB
Create a MongoDB instance
Create a free cluster on MongoDB Atlas:
- Sign up or sign in.
- Create a free shared cluster.
- Under Database Access, create a database user.
- Under Network Access, add your IP address (or
0.0.0.0/0for development). - Click Connect → Drivers and copy the connection string.
Run a local MongoDB instance with Docker:
docker run --name mongodb -p 27017:27017 -d mongodb/mongodb-community-server:latestYour connection string is:
mongodb://localhost:27017/aiboilerplateUpdate the environment variables
Paste your connection string beside DATABASE_URL in the .env file:
DATABASE_URL=mongodb+srv://username:password@cluster.mongodb.net/dbnameDo not use a production database for local development.
Test the integration
Open Prisma Studio to confirm everything is connected:
pnpm dev --filter @package/dbPrisma Studio can be accessed at http://localhost:5555.