A modern, full-featured job portal built with the MERN stack (MongoDB/PostgreSQL, Express, React, Node.js) that connects job seekers with recruiters. Features role-based authentication, job posting, application management, and resume uploads.
- User Registration - Sign up as Job Seeker or Recruiter
- Secure Login - JWT-based authentication
- Role-Based Access Control - Different permissions for job seekers and recruiters
- Protected Routes - Secure pages based on authentication status
- Browse Jobs - View all available job listings
- Job Search & Filter - Find jobs by title, location, or skills
- Job Details - View comprehensive job descriptions
- Apply for Jobs - One-click application to job postings
- My Applications - Track all submitted applications and their status
- Resume Upload - Upload and manage resume (PDF, DOC, DOCX)
- Application Status - See if applications are Pending, Shortlisted, or Rejected
- Personal Dashboard - Overview of application statistics
- Post Jobs - Create detailed job listings with title, description, skills, and location
- Manage Jobs - View, edit, and delete posted jobs
- View Applicants - See all candidates who applied for each job
- Application Management - Shortlist, reject, or reset applicant status
- Applicant Details - View candidate information and download resumes
- Recruiter Dashboard - Overview of posted jobs and applications
- Professional UI - Grid-based applicant cards with avatars and status badges
- React 19.2 - Latest React with modern hooks
- Vite - Lightning-fast build tool
- React Router DOM - Client-side routing
- Axios - HTTP client for API requests
- Framer Motion - Smooth animations
- React Hot Toast - Elegant notifications
- Lucide React - Beautiful icons
- Node.js - JavaScript runtime
- Express.js - Web application framework
- Prisma ORM - Type-safe database client
- PostgreSQL - Relational database
- JWT - JSON Web Tokens for authentication
- Bcrypt - Password hashing
- Multer - File upload handling
- CORS - Cross-origin resource sharing
Before you begin, ensure you have the following installed:
- Node.js 18+ (Node 22 recommended)
- npm 10+
- PostgreSQL 14+ (or Supabase account)
- Git (for cloning the repository)
git clone https://github.com/SravanthDev/Job-Portal.git
cd Job-Portalcd backend
npm installCreate a .env file in the backend directory:
# Database Configuration (PostgreSQL)
DATABASE_URL="postgresql://user:password@localhost:5432/job_portal"
DIRECT_URL="postgresql://user:password@localhost:5432/job_portal"
# Server Configuration
PORT=5001
NODE_ENV=development
# JWT Secret (use a strong random string)
JWT_SECRET=your_super_secret_jwt_key_here
# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:5173
# Upload Directory
UPLOAD_DIR=./uploadsNote: For Supabase PostgreSQL:
DATABASE_URL- Use the connection pooling URLDIRECT_URL- Use the direct connection URL
# Generate Prisma Client
npx prisma generate
# Run database migrations
npx prisma migrate dev --name init
# (Optional) Open Prisma Studio to view/edit data
npx prisma studionpm run devThe backend will start on http://localhost:5001
cd frontend
npm installCreate a .env file in the frontend directory:
VITE_API_URL=http://localhost:5001/apinpm run devThe frontend will start on http://localhost:5173
Job-Portal/
βββ backend/
β βββ config/ # Database configuration
β βββ controllers/ # Request handlers
β βββ middleware/ # Auth & error middleware
β βββ prisma/ # Database schema
β βββ routes/ # API routes
β βββ uploads/ # Resume uploads
β βββ utils/ # Helper functions
β βββ server.js # Entry point
β
βββ frontend/
β βββ public/ # Static assets
β βββ src/
β β βββ Components/ # Reusable components
β β βββ Pages/ # Page components
β β βββ services/ # API service layer
β β βββ App.jsx # Main app component
β β βββ index.css # Global styles
β βββ package.json
β
βββ README.md
POST /api/auth/register- Register new userPOST /api/auth/login- Login user
GET /api/jobs- Get all jobsGET /api/jobs/:id- Get job by IDPOST /api/jobs- Create job (Recruiter only)PUT /api/jobs/:id- Update job (Recruiter only)DELETE /api/jobs/:id- Delete job (Recruiter only)
POST /api/applications/:jobId- Apply for job (Job Seeker only)GET /api/applications/user- Get user's applications (Job Seeker only)GET /api/applications/job/:jobId- Get job applications (Recruiter only)PUT /api/applications/:applicationId/status- Update application status (Recruiter only)
GET /api/users/me- Get current user profilePOST /api/users/upload-resume- Upload resume URLPOST /api/users/upload-resume-file- Upload resume file
id- Auto-increment primary keyname- User's full nameemail- Unique email addresspassword- Hashed passwordrole- JOB_SEEKER or RECRUITERresumeUrl- Path to uploaded resume (optional)createdAt- Timestamp
id- Auto-increment primary keytitle- Job titledescription- Job descriptionskills- Required skills (comma-separated)location- Job locationpostedById- Foreign key to UsercreatedAt- Timestamp
id- Auto-increment primary keyjobId- Foreign key to JobuserId- Foreign key to Userstatus- PENDING, SHORTLISTED, or REJECTEDcreatedAt- Timestamp- Unique constraint: (jobId, userId) - Prevents duplicate applications
- Register - Create an account with role "Job Seeker"
- Upload Resume - Go to "Upload Resume" page and upload your CV
- Browse Jobs - View available jobs on the Jobs page
- Apply - Click on a job and hit "Apply Now"
- Track Applications - Check "My Applications" to see status updates
- Register - Create an account with role "Recruiter"
- Post Job - Navigate to "Post a Job" and fill in details
- Manage Jobs - View all your posted jobs in "My Jobs"
- Review Applicants - Click on a job to see all applicants
- Update Status - Shortlist or reject candidates
npm run dev # Start development server with nodemon
npm start # Start production server
npm run build # Generate Prisma client and run migrationsnpm run dev # Start Vite development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint# Find process using port 5001
lsof -i :5001
# Kill the process
kill -9 <PID>
# Or change PORT in backend/.env- Verify PostgreSQL is running
- Check DATABASE_URL and DIRECT_URL in
.env - Ensure database exists:
CREATE DATABASE job_portal; - Run migrations:
npx prisma migrate dev
# Reset database (WARNING: Deletes all data)
npx prisma migrate reset --force
# Regenerate Prisma Client
npx prisma generate- Ensure
backend/uploads/directory exists - Check file permissions
- Verify UPLOAD_DIR in
.env
- Verify FRONTEND_URL in backend
.env - Check VITE_API_URL in frontend
.env - Ensure both servers are running
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.