- Go to mongodb.com/atlas
- Create free account → Click "Build a Database"
- Select FREE M0 Cluster → Choose region → Click "Create"
- Create database user:
- Username:
safetyuser - Password: (save this!)
- Username:
- Go to Network Access → Add IP Address → Allow Access from Anywhere (0.0.0.0/0)
- Go to Database → Connect → Connect your application
- Copy connection string (looks like):
mongodb+srv://safetyuser:YOUR_PASSWORD@cluster0.xxxxx.mongodb.net/?retryWrites=true&w=majority - Add database name to the end:
mongodb+srv://safetyuser:YOUR_PASSWORD@cluster0.xxxxx.mongodb.net/safety_vision?retryWrites=true&w=majority
- Go to platform.openai.com
- Sign up / Log in
- Click "API Keys" in the left menu
- Click "Create new secret key"
- Copy your key (starts with
sk-...)
- In Emergent, click "Save to GitHub"
- Connect your GitHub account if needed
- Create/select repository
- Code will be pushed automatically
-
Go to render.com → Sign up (free)
-
Click "New +" → "Web Service"
-
Click "Connect a repository" → Select your GitHub repo
-
Configure the service:
Setting Value Name ai-safety-visionRegion Choose closest to you Branch mainRoot Directory (leave empty) Runtime Python 3Build Command chmod +x build.sh && ./build.shStart Command cd backend && uvicorn server:app --host 0.0.0.0 --port $PORT -
Click "Advanced" → "Add Environment Variable":
Key Value MONGO_URLmongodb+srv://safetyuser:PASSWORD@cluster0.xxxxx.mongodb.net/safety_vision?retryWrites=true&w=majorityDB_NAMEsafety_visionOPENAI_API_KEYsk-xxxxx(your OpenAI API key)CORS_ORIGINS*PYTHON_VERSION3.11.0NODE_VERSION18 -
Click "Create Web Service"
-
Wait 5-10 minutes for deployment
-
Your app is live at:
https://ai-safety-vision.onrender.com🎉
/
├── build.sh # Unified build script
├── render.yaml # Render blueprint
├── frontend/ # React frontend
│ ├── src/
│ ├── package.json
│ └── ...
└── backend/ # FastAPI backend
├── server.py # Serves API + static files
├── requirements.txt
└── static/ # React build (created during build)
-
Free Tier: App sleeps after 15 min of inactivity. First request takes ~30 sec to wake up.
-
OpenAI API Costs: GPT-4o Vision API has usage costs. Check your OpenAI billing.
-
Build Time: First deployment takes 5-10 min (building React + installing Python deps)
Build fails?
- Check Render logs for errors
- Ensure all environment variables are set
API not working?
- Verify MONGO_URL is correct
- Check OPENAI_API_KEY is valid and has credits
Frontend not loading?
- Wait for full deployment to complete
- Check if static files were built correctly