- Go to: https://www.mongodb.com/cloud/atlas/register
- Sign up for free account
- Create a FREE cluster (M0 - Shared)
- Choose your region (closest to you)
- Click "Connect" on your cluster
- Choose "Connect your application"
- Copy the connection string (looks like):
mongodb+srv://<username>:<password>@cluster0.xxxxx.mongodb.net/?retryWrites=true&w=majority
Replace <username> and <password> with your Atlas credentials:
# Edit .env file
MONGODB_URI=mongodb+srv://yourusername:yourpassword@cluster0.xxxxx.mongodb.net/pentest-dashboard?retryWrites=true&w=majority- In Atlas dashboard, go to "Network Access"
- Click "Add IP Address"
- Click "Allow Access from Anywhere" (for development) or add your IP
- Save
- Go to "Database Access"
- Click "Add New Database User"
- Create username/password (remember these!)
- Set role to "Atlas Admin" or "Read and write to any database"
- Use these credentials in your connection string
That's it! Your app will connect to MongoDB Atlas cloud database.