This repository contains a refactored MERN job portal split into two apps:
job-portal-client-> React + Vite frontendjob-portal-server-> Node + Express + Mongoose backend
The stack is optimized for zero-cost student/portfolio deployment:
- Database: MongoDB Atlas Free tier (M0)
- Backend: Render Free Web Service
- Frontend: Vercel Hobby
- Auth: Clerk (role-based)
Job-Portal/
job-portal-client/
src/
api/
components/
hooks/
pages/
utils/
Router/
job-portal-server/
src/
config/
controllers/
middleware/
models/
routes/
utils/
index.js
render.yaml
cd job-portal-server
npm install
cp .env.example .env
npm run devcd job-portal-client
npm install
cp .env.example .env
npm run devFrontend default dev URL: http://localhost:5173
Backend default dev URL: http://localhost:3000
PORT=3000
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/job_portal?retryWrites=true&w=majority
CLIENT_URL=http://localhost:5173
CLERK_SECRET_KEY=
CLERK_ISSUER=Notes:
CLERK_SECRET_KEYcomes from Clerk dashboard.CLERK_ISSUERis optional. Leave empty to auto-detect from token.
VITE_API_URL=http://localhost:3000
VITE_CLERK_PUBLISHABLE_KEY=jobProvider-> can post/edit/delete jobs and view own job applications.jobSeeker-> can apply to jobs.
On first sign-in, users are redirected to /select-role.
- Create Atlas account.
- Create a Free cluster (M0).
- Create database user (username/password).
- Add IP access rule:
- Development: your current IP
- Deployment:
0.0.0.0/0(common for hobby projects; use strong password)
- Get connection string and set
MONGODB_URIin backend env.
- Create a Clerk account.
- Create an application (free tier).
- Copy:
- Publishable key -> frontend
VITE_CLERK_PUBLISHABLE_KEY - Secret key -> backend
CLERK_SECRET_KEY
- Publishable key -> frontend
- Add your local/dev and deployed URLs in Clerk allowed origins/redirects.
- Push repo to GitHub.
- In Render:
New->Web Service. - Select repo and configure:
- Root Directory:
job-portal-server - Build Command:
npm install - Start Command:
npm start - Instance Type:
Free
- Root Directory:
- Add env vars in Render dashboard:
PORTMONGODB_URICLIENT_URLCLERK_SECRET_KEYCLERK_ISSUER(optional)
- Deploy and verify
/api/health.
- Import repository in Vercel.
- Set project root to
job-portal-client. - Add env vars:
VITE_API_URLVITE_CLERK_PUBLISHABLE_KEY
- Deploy on Hobby plan.
Base URL: /api
- Public:
GET /api/healthGET /api/jobsGET /api/jobs/:id
- Provider-only:
POST /api/jobsPATCH /api/jobs/:idDELETE /api/jobs/:idGET /api/jobs/my/:emailGET /api/jobs/:id/applications
- Seeker-only:
POST /api/jobs/:id/applyGET /api/applications/my/:email
node_modulesare ignored and not tracked.- Backend production start uses
node index.js. - Frontend API calls use
VITE_API_URLand send Clerk bearer token automatically.