Project: SatShield Backend Deployment
I built a Node + Express backend that connects to a MongoDB Atlas database and then deployed it
to Render for production.
Steps I followed
1. Local setup
- Installed dependencies with npm install.
- Created a .env file containing:
MONGO_URI=<Atlas connection string>
PORT=4000
JWT_SECRET=satshield_secret_key
NODE_ENV=development
- Loaded environment variables in [Link] using dotenv.
- Started the server locally with node [Link].
2. MongoDB Atlas configuration
- Created a free cluster on Atlas.
- Added my IP to Network Access.
- Created a database user and copied the full mongodb+srv://... URI.
3. Connecting to the database
- Used the MongoClient driver in code.
- Wrapped the connection in an async function:
const client = new MongoClient(MONGO_URI);
await [Link]();
[Link]("MongoDB Connected Successfully");
- Handled errors with a try/catch block.
4. Deploying on Render
- Pushed code to GitHub and connected it to Render.
- In Render's Environment tab, added variables:
MONGO_URI=mongodb+srv://...
PORT=4000
JWT_SECRET=satshield_secret_key
NODE_ENV=production
- Set build command npm install and start command npm start.
5. Debugging
- Fixed a port conflict error (EADDRINUSE) by running
netstat -ano | findstr :4000 and taskkill /PID <pid> /F.
- Fixed "Invalid scheme" MongoDB error by pasting the correct URI that starts with
mongodb+srv://.
Final output
In Render logs:
Mongoose connected to Atlas cluster
Server listening on port 4000
Your service is live
Public URL:
[Link]
Visiting /api/health returns:
{ "ok": true, "time": "..." }
Summary for judges
I configured environment variables securely, handled connection errors gracefully, solved port and
URI issues, and successfully deployed a live Node-Express-MongoDB backend on Render. It's
production-ready and fully connected to MongoDB Atlas.