Sellzy stores everything in MongoDB. Pick one option.
Option A: local MongoDB with Docker
Best for development. Install Docker Desktop, then:
pnpm db:up # start MongoDB 8 on localhost:27017
pnpm db:down # stop it (your data is kept)
The container only listens on your own computer. Use this connection string in apps/api/.env (it’s already the default):
MONGO_URI=mongodb://localhost:27017/sellzy
Option B: MongoDB Atlas (free cloud database)
Needed when you deploy, and works for development too.
- Sign up at mongodb.com/cloud/atlas/register and create a free M0 cluster.
- Database Access → Add New Database User. Choose a username and password. Avoid
@ : / ? #in the password, or URL-encode them. - Network Access → Add IP Address. For testing choose Allow access from anywhere (
0.0.0.0/0). In production, add only your server’s IP. - Connect → Drivers. Copy the connection string, replace
<password>, and add the database name/sellzybefore the?:
MONGO_URI=mongodb+srv://USER:PASSWORD@cluster0.xxxxx.mongodb.net/sellzy?retryWrites=true&w=majority
Warning
Without /sellzy in the string, MongoDB writes to a database called test. pnpm check:setup warns you when the name is missing.
Check the connection
pnpm check:setup
It connects to the database and counts products, categories and admin accounts. Common errors and fixes are in Troubleshooting.
