Overview

Welcome to Job Portal

A modern, feature-rich job portal built with React 18 (Admin Panel), Angular (Frontend), and Node.js (Backend). Perfect for job boards, recruitment agencies, and HR departments.

For Employers

Post jobs, manage applications, communicate with candidates, and track your hiring process.

For Job Seekers

Search jobs, apply with multiple resumes, track applications, and communicate with employers.

Admin Panel (React)

Modern React-based admin with CMS, user management, bulk operations, and analytics dashboard.

Technology Stack

React 18
Angular
Node.js
MongoDB
Express.js
TypeScript
JWT Auth

Quick Links

Installation Guide

Prerequisites: Node.js 18+, MongoDB, npm/yarn

Step 1: Install Dependencies

Backend
cd backend
npm install
Frontend
cd frontend
npm install
Admin Panel (React)
cd admin
npm install

Step 2: Set Up MongoDB

  1. Install MongoDB from official website
  2. Start MongoDB service:
    Linux/Mac
    sudo systemctl start mongod
    # or
    mongod
  3. Verify MongoDB is running:
    Command
    mongosh

Step 3: Configure Environment

Update environment files in each application:

Backend Configuration

Create .env file in backend/ directory:

.env
PORT=4000
DB_URL=mongodb://localhost:27017/job-portal
JWT_SECRET=your-secret-key-change-in-production
SESSION_SECRET=your-session-secret-change-in-production

# Optional
SENDGRID_API_KEY=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
LINKEDIN_CLIENT_ID=
LINKEDIN_CLIENT_SECRET=

Admin Panel Configuration (Optional)

Create .env file in admin/ directory:

.env
VITE_API_URL=http://localhost:4000/

If not provided, defaults to http://localhost:4000/

Step 4: Start Development Servers

1

Backend Server

Terminal 1
cd backend
npm start

Runs on http://localhost:4000

2

Frontend Application

Terminal 2
cd frontend
npm start

Runs on http://localhost:4200

3

Admin Panel (React)

Terminal 3
cd admin
npm run dev

Runs on http://localhost:3001

Step 5: Create Admin User

Before logging in, create an admin user:

cURL
curl -X POST http://localhost:4000/auth/register/admin \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Admin User",
    "email": "admin@example.com",
    "password": "Admin123!",
    "company": "My Company"
  }'

Then login at http://localhost:3001/login with your credentials.

Step 6: Seed Sample Data (Optional)

Populate database with test data:

API Call
curl -X POST http://localhost:4000/api/seeder/seed

See Test Credentials section for login details.

Access URLs

  • Admin Panel: http://localhost:3001
  • Frontend: http://localhost:4200
  • Backend API: http://localhost:4000
Installation Complete! Your Job Portal is now ready to use.

Configuration Guide

Environment Variables

Configure your application using environment variables or config files.

Backend Environment Variables

Variable Description Default
DB_URL MongoDB connection string mongodb://localhost:27017/job-portal
JWT_SECRET Secret key for JWT tokens your-secret-key-change-in-production
PORT Server port 4000
NODE_ENV Environment mode development
SENDGRID_API_KEY SendGrid API key for emails -
GOOGLE_CLIENT_ID Google OAuth client ID -
GOOGLE_CLIENT_SECRET Google OAuth client secret -

File Upload Configuration

Configure file upload settings in backend/app/config/config.js:

config.js
upload: {
  maxFileSize: 5 * 1024 * 1024, // 5MB
  allowedMimeTypes: [
    'image/jpeg',
    'image/png',
    'application/pdf',
    'application/msword'
  ]
}

Email Configuration

Set up email notifications using SendGrid:

  1. Create a SendGrid account
  2. Generate an API key
  3. Add to .env:
    .env
    SENDGRID_API_KEY=your-api-key-here
    FROM_EMAIL=noreply@yourdomain.com
    FROM_NAME=Job Portal

OAuth Configuration

Configure Google and LinkedIn OAuth from the admin panel under Settings → OAuth.

See ../OAUTH_SETUP_GUIDE.md for detailed OAuth setup instructions.

Features

Employer Features

Job Posting

Create and manage job listings with rich descriptions, requirements, and salary information.

Application Management

Review, shortlist, and manage candidate applications with status tracking.

Real-Time Messaging

Communicate directly with job seekers through integrated chat system.

Application Notes

Add internal notes and comments to applications for team collaboration.

Advanced Filtering

Filter applications by status, date range, and job position.

Job Seeker Features

Advanced Job Search

Search by keywords, location, industry, salary range, and more.

Multiple Resume Management

Upload and manage multiple resumes, set default, select per application.

Cover Letter Support

Add personalized cover letters to job applications.

Job Alerts

Create personalized job alerts with email notifications.

Search History

Automatically save and access recent job searches.

Social Sharing

Share job listings on social media platforms.

Admin Features

Dashboard Analytics

Real-time statistics, metrics, and activity tracking with clickable navigation cards.

Bulk Operations

Select multiple jobs/users for bulk activate, deactivate, or delete operations.

Job Approval Workflow

Approve or reject jobs with notes, track approval status, and manage pending jobs.

CSV Export

Export jobs, users, and applications data to CSV format.

CMS Management

Create and manage custom content pages (About, Contact, Help, Terms, Privacy) with SEO.

Settings & Branding

Configure application settings, upload logos/favicons, OAuth setup, and customize colors.

User Verification

Verify or reject users with notes, block/unblock users, and manage user status.

API Reference

Base URL: http://localhost:4000/api/ (development) or /api/ (production)

Authentication

Most endpoints require authentication. Include JWT token in headers:

Headers
Authorization: Bearer YOUR_JWT_TOKEN

Endpoints

Authentication

POST
/auth/register

Register a new user

POST
/auth/login

Login user

Jobs

GET
/jobs

Get all jobs

POST
/jobs

Create a new job

GET
/jobs/:id

Get job by ID

Applications

POST
/applications

Submit job application

GET
/applications

Get user applications

DELETE
/applications/:id

Withdraw application

Resumes

POST
/resumes

Upload resume

GET
/resumes

Get user resumes

Postman Collections

Import Postman collections for easy API testing:

  • Complete Collection: backend/postman/job-portal-complete.postman_collection.json (All APIs - Admin + Frontend)
  • Admin Only: backend/postman/job-portal-admin.postman_collection.json (Admin APIs only)
  • Original: backend/postman/job-portal.postman_collection.json

See backend/postman/README.md for detailed usage instructions.

Deployment Guide

Build for Production

Frontend Build

Command
cd frontend
npm run build -- --configuration production

Output: frontend/dist/frontend/

Admin Panel Build (React)

Command
cd admin
npm run build

Output: admin/dist/

Nginx Configuration

Example Nginx configuration for single domain deployment:

nginx.conf
server {
    listen 80;
    server_name your-domain.com www.your-domain.com;

    # Frontend Angular SPA at /
    root /var/www/job-portal/frontend;
    index index.html;

    # API under /api -> Node on port 4000
    location /api/ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:4000/;
    }

    # Admin React SPA at /admin
    location /admin/ {
        alias /var/www/job-portal/admin/dist/;
        try_files $uri $uri/ /admin/index.html;
    }

    # SPA fallback for frontend
    location / {
        try_files $uri $uri/ /index.html;
    }
}

SSL Certificate

Enable HTTPS with Let's Encrypt:

Command
sudo certbot --nginx -d your-domain.com -d www.your-domain.com

PM2 Process Manager

Run backend with PM2 for production:

Install PM2
npm install -g pm2
Start Backend
cd backend
pm2 start server.js --name job-portal-api
pm2 save
pm2 startup

Troubleshooting

Common Issues

MongoDB Connection Error

Problem: Cannot connect to MongoDB

Solution:

  • Verify MongoDB is running: mongosh
  • Check connection string in .env file
  • Ensure MongoDB service is started: sudo systemctl start mongod

Port Already in Use

Problem: Port 4000, 4200, or 3001 is already in use

Solution:

  • Find process using port: lsof -i :4000 (or :4200, :3001)
  • Kill process: kill -9 PID
  • Or change port in configuration:
    • Backend: Change PORT in backend/.env
    • Admin: Change port in admin/vite.config.ts or use npm run dev -- --port 3002
    • Frontend: Use ng serve --port 4300

Admin Panel Cannot Connect to Backend

Problem: Admin panel shows connection errors

Solution:

  • Verify backend is running on port 4000
  • Check VITE_API_URL in admin/.env file
  • Check browser console for CORS errors
  • Verify backend CORS configuration allows http://localhost:3001

Cannot Login to Admin Panel

Problem: Login fails or credentials don't work

Solution:

  • Verify admin user was created (see Step 5 in Installation)
  • Check credentials are correct
  • Check backend logs for errors
  • Verify JWT_SECRET is set in backend .env
  • Clear browser localStorage and try again

Module Not Found

Problem: npm module errors

Solution:

  • Delete node_modules folder
  • Delete package-lock.json
  • Run npm install again

CORS Errors

Problem: CORS policy errors in browser

Solution:

  • Check CORS configuration in backend/app/config/config.js
  • Ensure frontend URL is in allowed origins
  • Verify API URL in frontend environment files

JWT Token Errors

Problem: Authentication token invalid or expired

Solution:

  • Clear browser localStorage
  • Login again to get new token
  • Check JWT_SECRET in backend configuration

Log Files

Check log files for detailed error information:

  • backend/logs/error.log - Error logs
  • backend/logs/combined.log - All logs

Test Credentials

Note: All test accounts use password: Demo@123

Employer Accounts

Name Company Email Password
Sarah Johnson TechCorp Solutions sarah.johnson@techcorp.com Demo@123
Michael Chen InnovateAI michael.chen@innovateai.com Demo@123
Emily Rodriguez Creative Design Studio emily.rodriguez@designstudio.com Demo@123
David Thompson FinanceHub david.thompson@financehub.com Demo@123
Lisa Anderson HealthcarePlus lisa.anderson@healthcareplus.com Demo@123

Job Seeker Accounts

Name Email Password
Alex Martinez alex.martinez@email.com Demo@123
Jessica Kim jessica.kim@email.com Demo@123
Ryan Patel ryan.patel@email.com Demo@123
Sophie Williams sophie.williams@email.com Demo@123
James Wilson james.wilson@email.com Demo@123
Maria Garcia maria.garcia@email.com Demo@123

Seed Sample Data

To populate database with test data:

API Call
curl -X POST http://localhost:4000/api/seeder/seed

Get credentials:

API Call
curl http://localhost:4000/api/seeder/credentials