Developer blog platform served from Express + EJS on Render:
backend/: Node.js, Express, MongoDB, Mongoose, JWT auth, REST API, and EJS pages
- User registration and login with hashed passwords and JWT
- Protected profile update flow
- Blog CRUD with owner-only update/delete
- Likes and comments
- Search and pagination on posts
- Server-rendered pages with EJS on the backend
- Deployment-ready backend structure for Render
DevConnect/
├── backend/
├── render.yaml
└── README.mdBackend runs on http://localhost:5000.
POST /api/auth/registerPOST /api/auth/loginGET /api/auth/me
GET /api/users/:idPUT /api/users/:id
POST /api/postsGET /api/postsGET /api/posts/:idPATCH /api/posts/:idDELETE /api/posts/:idPOST /api/posts/:id/like
GET /api/posts/:postId/commentsPOST /api/posts/:postId/commentsPATCH /api/comments/:idDELETE /api/comments/:id
- Create a Render Web Service from this repo
- Use
backendas the root directory - Build command:
npm install - Start command:
npm start - Add env vars:
NODE_ENV=productionMONGODB_URIJWT_SECRETCLIENT_URL(optional; comma-separated list of allowed origins for/apiCORS)
render.yaml is included for convenience.
- The main UI is now served by the backend at
/,/login,/register,/profile,/create-post,/users/:id, and/posts/:id - The Render URL is the only URL you need for webpages and API
- For production, keep
JWT_SECRETlong and private - MongoDB Atlas is recommended for deployment
- Registered users are stored in MongoDB, and the server keeps auth in an
httpOnlycookie for the EJS flow