Job Board API Documentation
Overview
The Job Board API is a RESTful API built with Node.js and Express that allows employers to
post job listings and job seekers to apply for jobs. The API includes authentication, job
management, user profiles, and application tracking.
Technologies Used
• Node.js
• Express.js
• MongoDB (Mongoose ODM)
• JWT Authentication
• Cloud Storage (for resume uploads)
• Swagger (for API documentation)
Features
• User Authentication (Employer & Job Seeker)
• Job Posting and Management
• Job Search and Filtering
• Job Applications
• User Profile Management
API Endpoints
Authentication
1. Register User
Endpoint: POST /api/auth/register Description: Register a new user (Employer or Job
Seeker) Request Body:
"name": "John Doe",
"email": "[email protected]",
"password": "securepassword",
"role": "employer" // or "job_seeker"
}
Response:
"message": "User registered successfully",
"token": "JWT_TOKEN"
2. Login User
Endpoint: POST /api/auth/login Description: Authenticate user and return JWT token
Request Body:
"email": "[email protected]",
"password": "securepassword"
Response:
"message": "Login successful",
"token": "JWT_TOKEN"
Jobs
3. Create Job Listing (Employer Only)
Endpoint: POST /api/jobs Description: Employers can post a new job listing Headers:
Authorization: Bearer JWT_TOKEN Request Body:
"title": "Software Engineer",
"company": "TechCorp",
"location": "Remote",
"salary": "$80,000 - $100,000",
"description": "Job description goes here"
Response:
{
"message": "Job posted successfully",
"job": {
"id": "job123",
"title": "Software Engineer",
"company": "TechCorp",
"location": "Remote",
"salary": "$80,000 - $100,000"
4. Get All Jobs
Endpoint: GET /api/jobs Description: Retrieve all job listings with optional filters Query
Parameters:
• title (optional) - Filter by job title
• location (optional) - Filter by location Response:
"id": "job123",
"title": "Software Engineer",
"company": "TechCorp",
"location": "Remote",
"salary": "$80,000 - $100,000"
5. Apply for a Job (Job Seeker Only)
Endpoint: POST /api/jobs/:id/apply Description: Job seekers can apply for a job Headers:
Authorization: Bearer JWT_TOKEN Request Body:
"resume": "resume_link_here",
"coverLetter": "I am excited about this role because..."
Response:
"message": "Application submitted successfully"
Error Handling
• 400 Bad Request: Invalid input data
• 401 Unauthorized: Authentication required
• 403 Forbidden: Access denied
• 404 Not Found: Resource not found
Security
• JWT-based authentication
• Input validation
• Role-based access control
Conclusion
This API serves as a backend for a job board platform where employers can post jobs, and
job seekers can apply for opportunities. Future improvements can include real-time
notifications, chat features, and interview scheduling.