Creating a Job Portal Project involves several components, including a MySQL database schema, file structure, layout design using Bootstrap 5, and complete PHP scripts for user authentication and management. Below is a comprehensive guide to help you set up your system.

Project Introduction

The Job Portal is a web application designed to connect job seekers with employers. This platform allows employers to post job openings and manage applications, while job seekers can create profiles, upload resumes, and apply for jobs. With features for notifications and reporting, the system aims to streamline the job application process and enhance the overall experience for both job seekers and employers.

Project Objectives

  • To develop a secure and user-friendly platform for job seekers and employers to interact.
  • To implement a comprehensive database schema that supports user management, job postings, and application tracking.
  • To provide functionalities for job seekers to upload resumes and cover letters for job applications.
  • To facilitate notifications for job seekers regarding application statuses and new job postings.
  • To create a responsive design that enhances user experience across various devices.
  • To generate reports for administrators to analyze job postings and application trends.

Project Modules

  1. User Management: Handles user registration, authentication, and role assignments (admin, job seeker, employer).
  2. Job Posting Management: Allows employers to create, edit, and manage job postings, including job details and application deadlines.
  3. Application Management: Facilitates job seekers in applying for jobs, including uploading resumes and cover letters.
  4. Resume Management: Allows job seekers to upload and manage their resumes within the platform.
  5. Notification System: Sends alerts and messages to users regarding important updates and application statuses.
  6. Reporting: Generates reports for administrators to analyze job postings, applications, and user activity.

1. MySQL Database Schema


CREATE DATABASE job_portal;
USE job_portal;
-- Table for users
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
role ENUM('admin', 'job_seeker', 'employer') DEFAULT 'job_seeker',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Table for job postings
CREATE TABLE job_postings (
id INT AUTO_INCREMENT PRIMARY KEY,
employer_id INT NOT NULL,
title VARCHAR(255) NOT NULL,
description TEXT NOT NULL,
requirements TEXT,
salary DECIMAL(10, 2),
location VARCHAR(255),
application_deadline DATE,
status ENUM('active', 'closed') DEFAULT 'active',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (employer_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table for applications
CREATE TABLE applications (
id INT AUTO_INCREMENT PRIMARY KEY,
job_id INT NOT NULL,
seeker_id INT NOT NULL,
resume_path VARCHAR(255),
cover_letter_path VARCHAR(255),
status ENUM('applied', 'interviewed', 'rejected') DEFAULT 'applied',
application_date DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (job_id) REFERENCES job_postings(id) ON DELETE CASCADE,
FOREIGN KEY (seeker_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table for resumes
CREATE TABLE resumes (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
resume_path VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table for notifications
CREATE TABLE notifications (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
message TEXT NOT NULL,
is_read BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table for reports
CREATE TABLE reports (
id INT AUTO_INCREMENT PRIMARY KEY,
report_type VARCHAR(100) NOT NULL,
content TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

2. File and Folder Structure


job_portal/

├── config/
│ └── db.php

├── public/
│ ├── index.php
│ ├── login.php
│ ├── register.php
│ ├── dashboard.php
│ ├── job_postings.php
│ ├── applications.php
│ ├── resumes.php
│ ├── notifications.php
│ ├── admin_dashboard.php
│ └── reports.php

├── includes/
│ ├── header.php
│ ├── footer.php
│ └── functions.php

├── assets/
│ ├── css/
│ │ └── styles.css
│ ├── js/
│ │ └── scripts.js
│ └── images/

└── vendor/
└── (Bootstrap and other libraries)
3. Layout Based Design with Bootstrap 5

3. Layout Based Design with Bootstrap 5

Header (includes/header.php)


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/styles.css">
<title>Job Portal</title>
</head>
<body>
<div class="container">
<header class="my-4">
<h1>Job Portal</h1>
</header>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="index.php">Home</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="job_postings.php">Job Postings</a>
</li>
<li class="nav-item">
<a class="nav-link" href="applications.php">My Applications</a>
</li>
<li class="nav-item">
<a class="nav-link" href="resumes.php">My Resumes</a>
</li>
<li class="nav-item">
<a class="nav-link" href="notifications.php">Notifications</a>
</li>
<li class="nav-item">
<a class="nav-link" href="login.php">Login</a>
</li>
<li class="nav-item">
<a class="nav-link" href="register.php">Register</a>
</li>
</ul>
</div>
</div>
</nav>
<main class="my-4">

Footer (includes/footer.php)


</main>
<footer class="text-center my-4">
<p>© 2023 Job Portal. All rights reserved.</p>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

4. PHP Code for User Authentication

Registration (public/register.php)


<?php
require '../config/db.php';
require '../includes/header.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$username = $_POST['username'];
$email = $_POST['email'];
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
$role = $_POST['role'];
$stmt = $conn->prepare("INSERT INTO users (username, email, password, role) VALUES (?, ?, ?, ?)");
$stmt->bind_param("ssss", $username, $email, $password, $role);
$stmt->execute();
$stmt->close();
header("Location: login.php");
}
?>
<form method="POST" action="">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" id="username" name="username" required>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<input type="email" class="form-control" id="email" name="email" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<div class="mb-3">
<label for="role" class="form-label">Role</label>
<select class="form-select" id="role" name="role">
<option value="buyer">Buyer</option>
<option value="seller">Seller</option>
<option value="admin">Admin</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Register</button>
</form>
<?php require '../includes/footer.php'; ?>

Login (public/login.php)


<?php
session_start();
require '../config/db.php';
require '../includes/header.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$username = $_POST['username'];
$password = $_POST['password'];
$stmt = $conn->prepare("SELECT * FROM users WHERE username = ?");
$stmt->bind_param("s", $username);
$stmt->execute();
$result = $stmt->get_result();
$user = $result->fetch_assoc();
if ($user && password_verify($password, $user['password'])) {
$_SESSION['user_id'] = $user['id'];
$_SESSION['role'] = $user['role'];
header("Location: dashboard.php");
} else {
echo "Invalid credentials.";
}
}
?>
<form method="POST" action="">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" id="username" name="username" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-primary">Login</button>
</form>
<?php require '../includes/footer.php'; ?>

5. Additional PHP Scripts

Dashboard (public/dashboard.php)


<?php
session_start();
require '../config/db.php';
require '../includes/header.php';
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}
$user_id = $_SESSION['user_id'];
$stmt = $conn->prepare("SELECT * FROM users WHERE id = ?");
$stmt->bind_param("i", $user_id);
$stmt->execute();
$result = $stmt->get_result();
$user = $result->fetch_assoc();
?>
<h2>Welcome, <?php echo $user['username']; ?></h2>
<p>Your role: <?php echo ucfirst($user['role']); ?></p>
<?php require '../includes/footer.php'; ?>

Document Management (public/documents.php)


<?php
session_start();
require '../config/db.php';
require '../includes/header.php';
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$document_name = $_POST['document_name'];
$file_path = $_FILES['file']['name'];
$target_dir = "uploads/";
$target_file = $target_dir . basename($file_path);

// Upload file
move_uploaded_file($_FILES['file']['tmp_name'], $target_file);
$stmt = $conn->prepare("INSERT INTO documents (user_id, document_name, file_path) VALUES (?, ?, ?)");
$stmt->bind_param("iss", $_SESSION['user_id'], $document_name, $target_file);
$stmt->execute();
$stmt->close();
header("Location: documents.php");
}
?>
<h2>Manage Documents</h2>
<form method="POST" action="" enctype="multipart/form-data">
<div class="mb-3">
<label for="document_name" class="form-label">Document Name</label>
<input type="text" class="form-control" id="document_name" name="document_name" required>
</div>
<div class="mb-3">
<label for="file" class="form-label">Upload File</label>
<input type="file" class="form-control" id="file" name="file" required>
</div>
<button type="submit" class="btn btn-primary">Upload Document</button>
</form>
<h3>Existing Documents</h3>
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Document Name</th>
<th>File Path</th>
<th>Uploaded At</th>
</tr>
</thead>
<tbody>
<?php
$stmt = $conn->prepare("SELECT * FROM documents WHERE user_id = ?");
$stmt->bind_param("i", $_SESSION['user_id']);
$stmt->execute();
$result = $stmt->get_result();
while ($doc = $result->fetch_assoc()): ?>
<tr>
<td><?php echo $doc['id']; ?></td>
<td><?php echo $doc['document_name']; ?></td>
<td><a href="<?php echo $doc['file_path']; ?>" target="_blank">View</a></td>
<td><?php echo $doc['created_at']; ?></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
<?php require '../includes/footer.php'; ?>

Task Management (public/tasks.php)


<?php
session_start();
require '../config/db.php';
require '../includes/header.php';
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$project_id = $_POST['project_id'];
$assigned_to = $_POST['assigned_to'];
$title = $_POST['title'];
$description = $_POST['description'];
$due_date = $_POST['due_date'];
$stmt = $conn->prepare("INSERT INTO tasks (project_id, assigned_to, title, description, due_date) VALUES (?, ?, ?, ?, ?)");
$stmt->bind_param("iisss", $project_id, $assigned_to, $title, $description, $due_date);
$stmt->execute();
$stmt->close();
header("Location: tasks.php");
}
// Fetch users for assignment
$stmt = $conn->prepare("SELECT * FROM users WHERE role = 'employee'");
$stmt->execute();
$result = $stmt->get_result();
$employees = $result->fetch_all(MYSQLI_ASSOC);
// Fetch projects for the form
$stmt = $conn->prepare("SELECT * FROM projects");
$stmt->execute();
$result = $stmt->get_result();
$projects = $result->fetch_all(MYSQLI_ASSOC);
?>
<h2>Manage Tasks</h2>
<form method="POST" action="">
<div class="mb-3">
<label for="project_id" class="form-label">Select Project</label>
<select class="form-select" id="project_id" name="project_id" required>
<?php foreach ($projects as $project): ?>
<option value="<?php echo $project['id']; ?>"><?php echo $project['name']; ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="mb-3">
<label for="assigned_to" class="form-label">Assign To</label>
<select class="form-select" id="assigned_to" name="assigned_to" required>
<?php foreach ($employees as $employee): ?>
<option value="<?php echo $employee['id']; ?>"><?php echo $employee['username']; ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="mb-3">
<label for="title" class="form-label">Task Title</label>
<input type="text" class="form-control" id="title" name="title" required>
</div>
<div class="mb-3">
<label for="description" class="form-label">Description</label>
<textarea class="form-control" id="description" name="description" required></textarea>
</div>
<div class="mb-3">
<label for="due_date" class="form-label">Due Date</label>
<input type="date" class="form-control" id="due_date" name="due_date" required>
</div>
<button type="submit" class="btn btn-primary">Add Task</button>
</form>
<?php require '../includes/footer.php'; ?>

6. Additional Features to Consider

User Profiles: Allow users to edit their profiles and manage their settings.

Advanced Reporting: Implement more sophisticated reporting features for better insights.

Mobile Responsiveness: Ensure the application is fully responsive for mobile users.

7. Security Measures

Input Validation: Ensure all user inputs are validated to prevent SQL injection and XSS attacks.

Password Security: Use strong hashing algorithms for storing passwords.

Session Security: Implement secure session management practices to protect user sessions.

8. Testing and Deployment

Unit Testing: Conduct unit tests for individual components to ensure they function correctly.

Integration Testing: Test the integration of different modules to ensure they work together seamlessly.

Deployment: Choose a reliable hosting provider and deploy the application, ensuring all configurations are optimized for performance.

9. Documentation

User Documentation: Create a user manual to guide users through the platform's features and functionalities.

Developer Documentation: Document the codebase and architecture for future reference and maintenance.

10. Future Enhancements

AI-Powered Insights: Implement machine learning algorithms to provide insights into employee performance and project management.

Mobile Application: Develop a mobile application for users to access the platform on the go.

Integration with Other Systems: Consider integrating with existing HR or project management systems for a more comprehensive solution.

This structured approach will help you build a comprehensive Office Management System that meets user needs and adapts to future requirements.