We have re-engineered the platform to support direct deployment to Netlify for both Frontend and Backend, eliminating the need for Render or Railway.
This is likely causing your current issues:
- Log in to MongoDB Atlas.
- Go to Network Access (in the sidebar).
- Click Add IP Address.
- Select Allow Access from Anywhere (adds
0.0.0.0/0).- Why? Netlify uses dynamic IPs, so Atlas will block connections unless you whitelist everything or use a specific Atlas/Netlify integration.
Steps:
-
Push your code to GitHub.
-
Connect your repo to Netlify.
-
Netlify will automatically detect the settings from
netlify.tomlin the root:- Build command:
npm run build:api && npm run build:web - Publish directory:
apps/web/dist - Functions directory:
apps/api/dist
- Build command:
-
Crucial: Set Environment Variables in Netlify UI:
MONGODB_URI: (Your Atlas connection string)JWT_SECRET: (A strong secret key)NODE_ENV:production
- Backend: Now runs as a Netlify Function. We've added a
lambda.tswrapper for NestJS. - Worker: The Docker-based worker has been replaced with a Serverless-friendly Execution Service using the Piston API. You no longer need a separate server to run code!
- Single Command: Netlify handles the entire build process (Frontend + Backend) in one go.
- Converted API to be Netlify-Function compatible.
- Moved
netlify.tomlto root and configured it for the monorepo. - Replaced Docker Worker with Piston API (Serverless compatible).
- Persistent submissions are now stored in MongoDB (previously volatile in Redis).
- Moved
netlify.tomlto the root for automatic detection. - Added
/api/*proxying innetlify.tomlto avoid CORS issues. - Updated
apps/web/src/config.tsto support relative API paths in production. - Configured SPA redirects to prevent 404 errors on page refresh.
Note: The "issue" with Netlify often stems from it not knowing how to handle monorepos. These changes make it "Plug-and-Play".