sarojit049/job

โ˜… 1Forks 0JavaScriptGitHub โ†—Compare

Project website โ†—

README

๐Ÿš€ JobBoard Platform โ€” MERN Stack Capstone

A production-ready, full-stack Job Board Platform built with the MERN stack (MongoDB, Express.js, React.js, Node.js). Features JWT authentication, role-based access control, Cloudinary file uploads, real-time status tracking, and a beautiful dark-mode UI.


๐Ÿ“ธ Screenshots

๐Ÿ  Home Page

Home


๐Ÿ’ผ Browse Jobs

Jobs


๐Ÿ” Login

Login


๐Ÿ“ Register

Register


๐Ÿ‘จ๐Ÿ’ผ Employer Dashboard

Employer Dashboard


๐Ÿ‘จ๐Ÿ’ป Job Seeker Dashboard

Job Seeker Dashboard


โž• Create Job

Create Job


๐Ÿ‘ค Profile

Profile


โœจ Features

Authentication

  • โœ… JWT Access + Refresh Tokens
  • โœ… Role-based Authorization (Employer / Job Seeker)
  • โœ… Persistent login with localStorage
  • โœ… Auto token refresh on expiry

For Employers

  • โœ… Post, edit, delete job listings
  • โœ… Toggle job active/inactive status
  • โœ… View all applicants per job
  • โœ… Update application status (Applied โ†’ Hired)
  • โœ… Dashboard with analytics & charts

For Job Seekers

  • โœ… Browse, search, filter, and sort jobs
  • โœ… Apply with resume (PDF) + cover letter
  • โœ… Save/unsave jobs
  • โœ… Track application status in real-time
  • โœ… Profile with completion tracker

UI/UX

  • โœ… Dark Mode (system preference + manual toggle)
  • โœ… Loading Skeletons
  • โœ… Toast Notifications
  • โœ… Responsive / Mobile-Friendly
  • โœ… Confirmation Dialogs
  • โœ… Pagination

๐Ÿ›  Tech Stack

Layer Technology
Frontend React 18, Vite, Tailwind CSS, Axios, React Hook Form, React Hot Toast
Backend Node.js, Express.js, Mongoose
Database MongoDB Atlas
Auth JSON Web Tokens (JWT) + bcryptjs
File Upload Cloudinary + Multer
Testing Vitest, React Testing Library
Deployment Vercel (Client), Render (Server), MongoDB Atlas

๐Ÿ“ Project Structure

job-board-platform/
โ”œโ”€โ”€ client/                          # React frontend (Vite)
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ api/                     # Axios API functions
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ axios.js             # Axios instance + interceptors
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ auth.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ jobs.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ applications.js
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ dashboard.js
โ”‚   โ”‚   โ”œโ”€โ”€ context/                 # React Context
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AuthContext.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ThemeContext.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ components/              # Reusable UI components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Navbar.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Footer.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ JobCard.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ SearchFilters.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ StatsCard.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ StatusBadge.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Pagination.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ EmptyState.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ConfirmDialog.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Spinner.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ProtectedRoute.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ErrorBoundary.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ pages/                   # Page components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Home.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Login.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Register.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Jobs.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ JobDetails.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ CreateJob.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ EditJob.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Profile.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ MyApplications.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ EmployerDashboard.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ JobSeekerDashboard.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ NotFound.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ utils/helpers.js         # Utility functions
โ”‚   โ”‚   โ”œโ”€โ”€ tests/                   # Test files
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx                  # Router setup
โ”‚   โ”‚   โ”œโ”€โ”€ main.jsx                 # Entry point
โ”‚   โ”‚   โ””โ”€โ”€ index.css                # Global styles
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ vite.config.js
โ”‚   โ”œโ”€โ”€ tailwind.config.js
โ”‚   โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ server/                          # Express backend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ db.js                # MongoDB connection
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ cloudinary.js        # Cloudinary setup + multer
โ”‚   โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ User.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Job.js
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Application.js
โ”‚   โ”‚   โ”œโ”€โ”€ middleware/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ auth.js              # JWT middleware
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ errorHandler.js
โ”‚   โ”‚   โ”œโ”€โ”€ controllers/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ authController.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ jobController.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ applicationController.js
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ dashboardController.js
โ”‚   โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ auth.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ jobs.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ applications.js
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ dashboard.js
โ”‚   โ”‚   โ””โ”€โ”€ utils/
โ”‚   โ”‚       โ”œโ”€โ”€ generateToken.js
โ”‚   โ”‚       โ””โ”€โ”€ apiFeatures.js
โ”‚   โ”œโ”€โ”€ server.js
โ”‚   โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ package.json                     # Root (concurrently)
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ README.md

๐Ÿš€ Installation & Setup

Prerequisites

  • Node.js 18+
  • MongoDB Atlas account
  • Cloudinary account

1. Clone the repository

git clone https://github.com/yourusername/job-board-platform.git
cd job-board-platform

2. Install all dependencies

npm run install-all

3. Configure environment variables

Server โ€” copy and fill in server/.env:

cp server/.env.example server/.env

Client โ€” copy and fill in client/.env:

cp client/.env.example client/.env

4. Run in development mode

npm run dev

This starts both the server (http://localhost:5000) and client (http://localhost:5173) concurrently.


โš™๏ธ Environment Variables

Server (server/.env)

Variable Description
NODE_ENV development or production
PORT Server port (default: 5000)
MONGO_URI MongoDB Atlas connection string
JWT_SECRET Secret for access tokens
JWT_REFRESH_SECRET Secret for refresh tokens
JWT_EXPIRE Access token expiry (e.g., 1h)
JWT_REFRESH_EXPIRE Refresh token expiry (e.g., 7d)
CLOUDINARY_CLOUD_NAME Your Cloudinary cloud name
CLOUDINARY_API_KEY Cloudinary API key
CLOUDINARY_API_SECRET Cloudinary API secret
CLIENT_URL Frontend URL for CORS

Client (client/.env)

Variable Description
VITE_API_URL Backend API base URL

๐Ÿ“ก API Documentation

Authentication

Method Endpoint Access Description
POST /api/auth/register Public Register new user
POST /api/auth/login Public Login user
POST /api/auth/refresh Public Refresh access token
GET /api/auth/profile Private Get current user profile
PUT /api/auth/profile Private Update profile + uploads
PUT /api/auth/change-password Private Change password
PUT /api/auth/saved-jobs/:jobId Job Seeker Toggle save job

Jobs

Method Endpoint Access Description
GET /api/jobs Public List jobs (search/filter/sort/paginate)
GET /api/jobs/:id Public Get single job
POST /api/jobs Employer Create job
PUT /api/jobs/:id Employer (owner) Update job
DELETE /api/jobs/:id Employer (owner) Delete job
GET /api/jobs/employer/my-jobs Employer Get own jobs
PATCH /api/jobs/:id/toggle Employer (owner) Toggle active status

Applications

Method Endpoint Access Description
POST /api/applications Job Seeker Apply with resume
GET /api/applications Private Get applications (role-based)
GET /api/applications/:id Private Get single application
PUT /api/applications/:id Employer Update status
DELETE /api/applications/:id Job Seeker Withdraw application

Dashboard

Method Endpoint Access Description
GET /api/dashboard/employer Employer Full employer analytics
GET /api/dashboard/jobseeker Job Seeker Job seeker stats

๐Ÿงช Testing

Frontend tests

cd client
npm test          # Run tests in watch mode
npm run test:ui   # Open Vitest UI

Run all tests once

cd client && npm run test:coverage

๐ŸŒ Deployment

Frontend โ†’ Vercel

  1. Push to GitHub
  2. Import project in vercel.com
  3. Set Root Directory: client
  4. Add environment variable: VITE_API_URL=https://your-api.onrender.com/api
  5. Deploy!

Backend โ†’ Render

  1. Create a new Web Service on render.com
  2. Set Root Directory: server
  3. Build Command: npm install
  4. Start Command: node server.js
  5. Add all environment variables from server/.env
  6. Deploy!

Database โ†’ MongoDB Atlas

  1. Create cluster on mongodb.com/atlas
  2. Whitelist 0.0.0.0/0 for Render access
  3. Copy connection string to MONGO_URI

๐Ÿ”ฎ Future Improvements

  • Email notifications on application status change
  • Real-time chat between employer and applicant (Socket.io)
  • Advanced analytics with Chart.js / Recharts
  • Company profiles and reviews
  • Job recommendations via ML
  • Mobile app (React Native)
  • Admin panel for platform management
  • Stripe integration for premium job listings
  • Video interview scheduling

๐Ÿ“„ License

MIT License ยฉ 2024


Built with โค๏ธ using the MERN Stack

Issues