> A full-stack job board platform where employers post jobs, job seekers apply, and admins manage the entire ecosystem.
- About the Project
- Features
- Architecture
- Tech Stack
- Installed Dependencies
- Project Structure
- Getting Started
- Environment Variables
- API Endpoints
- User Roles
- Testing
- Screenshots
- Roadmap
- Contributing
- License
JobSphere is a full-stack job board web application built as a learning project for server-side web development. It simulates a real-world hiring platform where three types of users interact โ Job Seekers, Employers, and Admins.
The platform is split into two separate applications that communicate with each other:
- A Node.js REST API that handles all business logic, authentication, database operations, file uploads, and email notifications.
- A PHP Frontend that renders all pages and communicates with the API using cURL HTTP requests.
This architecture demonstrates how a decoupled frontend and backend work together in a professional, real-world setting.
- Register and manage a personal profile
- Browse and search job listings with filters (keyword, location, job type, salary)
- Apply to jobs by uploading a CV (PDF or Word)
- Write and submit a cover letter with each application
- Track all submitted applications and their current status
- Receive email notifications when application status is updated
- Register and create a company profile with logo upload
- Post, edit, and delete job listings
- View all applications received for each listing
- Download applicant CVs
- Update application statuses (Reviewed, Shortlisted, Interview, Rejected, Offered)
- Receive email notifications when someone applies
- Access a full admin dashboard with platform statistics
- Approve or reject company registrations
- Activate or deactivate user accounts
- Remove inappropriate job listings
- View all users, companies, jobs, and applications
- JWT-based authentication with role-based access control
- Secure file uploads for CVs and company logos
- Email notifications using Nodemailer
- Search and filter system for job listings
- Fully decoupled REST API and PHP frontend
- Comprehensive test coverage with Jest and PHPUnit
Browser
โ
โผ
PHP Frontend (localhost:8000)
โ cURL HTTP Requests + JWT Token
โผ
Node.js REST API (localhost:5000)
โ Mongoose Queries
โผ
MongoDB Atlas (Cloud Database)
The PHP frontend never directly connects to the database. Every data request goes through the Node.js API. JWT tokens returned at login are stored in PHP sessions and sent as Authorization: Bearer <token> headers on every authenticated request.
| Layer | Technology |
|---|---|
| Frontend | PHP 8, HTML5, CSS3, JavaScript |
| Backend | Node.js, Express.js |
| Database | MongoDB (via MongoDB Atlas) |
| ODM | Mongoose |
| Authentication | JWT (JSON Web Tokens) |
| Password Hashing | bcryptjs |
| File Uploads | Multer |
| Nodemailer | |
| API Communication | cURL (PHP โ Node.js) |
| Testing Backend | Jest, Supertest, MongoDB Memory Server |
| Testing Frontend | PHPUnit |
| Dev Tools | Nodemon, Postman, Composer |
| Package | Version | Purpose |
|---|---|---|
express |
^4.18.2 | Web framework for Node.js |
mongoose |
^7.0.0 | MongoDB object modeling (ODM) |
bcryptjs |
^2.4.3 | Password hashing and encryption |
jsonwebtoken |
^9.0.0 | JWT authentication tokens |
multer |
^1.4.5-lts.1 | File upload handling (CVs, logos) |
nodemailer |
^6.9.0 | Email sending service |
dotenv |
^16.0.3 | Environment variable management |
cors |
^2.8.5 | Cross-Origin Resource Sharing |
express-validator |
^6.15.0 | Request validation and sanitization |
| Package | Version | Purpose |
|---|---|---|
jest |
^29.5.0 | JavaScript testing framework |
supertest |
^6.3.3 | HTTP assertion library for testing |
mongodb-memory-server |
^8.12.0 | In-memory MongoDB for testing |
nodemon |
^2.0.22 | Auto-restart server on file changes |
Install all backend dependencies:
cd jobsphere-backend
npm install
---
## ๐ Project Structure
### Backend โ `jobsphere-backend/`
jobsphere-backend/ โ โโโ src/ โ โโโ config/ โ โ โโโ db.js # MongoDB connection โ โ โ โโโ models/ โ โ โโโ User.js โ โ โโโ Company.js โ โ โโโ Job.js โ โ โโโ Application.js โ โ โ โโโ routes/ โ โ โโโ index.js โ โ โโโ auth.routes.js โ โ โโโ job.routes.js โ โ โโโ company.routes.js โ โ โโโ application.routes.js โ โ โโโ admin.routes.js โ โ โ โโโ controllers/ โ โ โโโ auth.controller.js โ โ โโโ job.controller.js โ โ โโโ company.controller.js โ โ โโโ application.controller.js โ โ โโโ admin.controller.js โ โ โ โโโ services/ โ โ โโโ auth.service.js โ โ โโโ job.service.js โ โ โโโ email.service.js โ โ โโโ upload.service.js โ โ โ โโโ middleware/ โ โ โโโ auth.middleware.js โ โ โโโ role.middleware.js โ โ โโโ error.middleware.js โ โ โโโ validate.middleware.js โ โ โ โโโ utils/ โ โโโ response.js โ โโโ jwt.js โ โโโ asyncHandler.js โ โโโ tests/ # Test suites โ โโโ setup.js # Test database configuration โ โโโ unit/ โ โ โโโ models/ โ โ โ โโโ User.test.js โ โ โ โโโ Job.test.js โ โ โ โโโ Company.test.js โ โ โโโ services/ โ โ โ โโโ email.service.test.js โ โ โ โโโ upload.service.test.js โ โ โโโ utils/ โ โ โโโ jwt.test.js โ โโโ integration/ โ โโโ auth.routes.test.js โ โโโ job.routes.test.js โ โโโ application.routes.test.js โ โโโ uploads/ โ โโโ cvs/ # Uploaded CV storage โ โโโ logos/ # Uploaded company logos โ โโโ coverage/ # Jest coverage reports โโโ .env โโโ .env.example โโโ .gitignore โโโ app.js โโโ server.js โโโ package.json โโโ package-lock.json
### Frontend โ `jobsphere-frontend/`
jobsphere-frontend/ โ โโโ config/ โ โโโ app.php # API base URL, app settings โ โโโ src/ โ โโโ helpers/ โ โ โโโ api.helper.php # cURL wrapper for API calls โ โ โโโ auth.helper.php # Session management โ โ โโโ format.helper.php # Date, salary formatting โ โ โ โโโ middleware/ โ โ โโโ require_auth.php โ โ โโโ require_guest.php โ โ โโโ require_role.php โ โ โ โโโ partials/ โ โโโ header.php โ โโโ footer.php โ โโโ navbar.php โ โโโ job_card.php โ โโโ alert.php โ โโโ pagination.php โ โโโ pages/ โ โโโ auth/ โ โ โโโ login.php โ โ โโโ register.php โ โ โโโ logout.php โ โ โ โโโ jobs/ โ โ โโโ index.php โ โ โโโ view.php โ โ โโโ create.php โ โ โ โโโ companies/ โ โ โโโ view.php โ โ โโโ edit.php โ โ โ โโโ dashboard/ โ โ โโโ jobseeker/ โ โ โ โโโ index.php โ โ โ โโโ applications.php โ โ โโโ employer/ โ โ โโโ index.php โ โ โโโ listings.php โ โ โโโ applicants.php โ โ โ โโโ admin/ โ โโโ index.php โ โโโ users.php โ โโโ companies.php โ โโโ jobs.php โ โโโ tests/ # PHPUnit test suites โ โโโ unit/ โ โ โโโ helpers/ โ โ โโโ api.helper.test.php โ โ โโโ auth.helper.test.php โ โโโ integration/ โ โโโ pages/ โ โโโ auth.test.php โ โโโ assets/ โ โโโ css/ โ โโโ js/ โ โโโ images/ โ โโโ vendor/ # Composer dependencies โโโ phpunit.xml # PHPUnit configuration โโโ .phpunit.result.cache # PHPUnit test cache โโโ .htaccess โโโ .gitignore โโโ index.php
---
## ๐ Getting Started
### Prerequisites
Make sure you have the following installed:
- [Node.js](https://nodejs.org/) v18 or higher
- [PHP](https://www.php.net/) v8.0 or higher
- [Composer](https://getcomposer.org/) (optional but recommended)
- A [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) free account
- [Postman](https://www.postman.com/) (for API testing)
---
### 1. Clone the Repository
```bash
git clone https://github.com/your-username/jobsphere.git
cd jobsphere
cd jobsphere-api
npm installCreate your .env file by copying the example:
cp .env.example .envFill in your environment variables (see Environment Variables section below).
Start the development server:
npm run devThe API will run at http://localhost:5000
cd jobsphere-frontendOpen config/app.php and make sure the API URL points to your running Node.js server:
define('API_BASE_URL', 'http://localhost:5000/api');Start the PHP development server:
php -S localhost:8000The frontend will run at http://localhost:8000
After registering a user, go to your MongoDB Atlas dashboard, find that user in the users collection, and manually change their role field from "jobseeker" to "admin". This user can now access the admin panel at /pages/admin/index.php.
Create a .env file inside jobsphere-api/ with the following:
# Server
PORT=5000
# MongoDB
MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/jobsphere
# JWT
JWT_SECRET=your_strong_secret_key_here
JWT_EXPIRES_IN=7d
# Email (Gmail SMTP)
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_gmail_app_password
# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:8000Note: For Gmail, you need to generate an App Password from your Google account security settings. Do not use your regular Gmail password.
| Method | Endpoint | Access | Description |
|---|---|---|---|
| POST | /api/auth/register |
Public | Register a new user |
| POST | /api/auth/login |
Public | Login and receive JWT |
| GET | /api/auth/me |
Private | Get logged in user |
| Method | Endpoint | Access | Description |
|---|---|---|---|
| GET | /api/jobs |
Public | Get all active jobs (supports filters) |
| GET | /api/jobs/:id |
Public | Get single job |
| POST | /api/jobs |
Employer | Create a job listing |
| PUT | /api/jobs/:id |
Employer | Update own job listing |
| DELETE | /api/jobs/:id |
Employer | Delete own job listing |
| GET | /api/jobs/my-listings |
Employer | Get employer's own listings |
| Method | Endpoint | Access | Description |
|---|---|---|---|
| POST | /api/companies |
Employer | Create company profile |
| GET | /api/companies/:id |
Public | View company profile |
| PUT | /api/companies/:id |
Employer | Update company profile |
| Method | Endpoint | Access | Description |
|---|---|---|---|
| POST | /api/applications/:jobId |
Job Seeker | Apply to a job (CV upload) |
| GET | /api/applications/my-apps |
Job Seeker | View my applications |
| GET | /api/applications/job/:jobId |
Employer | View applicants for a job |
| PUT | /api/applications/:id/status |
Employer | Update application status |
| Method | Endpoint | Access | Description |
|---|---|---|---|
| GET | /api/admin/stats |
Admin | Platform statistics |
| GET | /api/admin/users |
Admin | List all users |
| PUT | /api/admin/users/:id/status |
Admin | Activate/deactivate user |
| GET | /api/admin/companies/pending |
Admin | Pending company approvals |
| PUT | /api/admin/companies/:id/approve |
Admin | Approve or reject company |
| DELETE | /api/admin/jobs/:id |
Admin | Remove any job listing |
| Role | Description |
|---|---|
jobseeker |
Can browse jobs, apply, track applications |
employer |
Can create company, post jobs, manage applicants |
admin |
Full platform control, set manually in database |
Screenshots will be added as the project develops.
- Project setup and folder structure
- JWT Authentication with role-based access
- Company profile creation and logo upload
- Job listings CRUD with search and filter
- Job applications with CV upload
- Email notifications (Nodemailer)
- Admin panel and dashboard
- Saved jobs and job alerts (cron jobs)
- Company reviews by applicants
- Application status pipeline (Kanban-style)
- Interview scheduling system
- Employer subscription plans with Stripe payments
- Resume/CV builder (PDF generation with PDFKit)
- Employer analytics dashboard
- REST API refactor with React frontend
- Real-time notifications with Socket.io
This is a personal learning project but contributions, suggestions, and feedback are welcome.
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature-name) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/your-feature-name) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
Your Name
- GitHub: @your-username
- LinkedIn: your-linkedin
Built with โค๏ธ as a university server-side web development project.