This is a job marketplace platform that facilitates the connection between companies and developers. It allows companies to post job openings, search for potential candidates, and manage the hiring process. Developers can explore job opportunities, apply for positions, and track their applications.
- Register an account and create a company profile.
- Post job openings, including job title, description, requirements, and desired skills.
- Edit or delete job postings as needed.
- Manage applications received for each job.
- Communicate with applicants through the platform's messaging system.
- Track the status of job postings and applications.
- Register an account and create a developer profile.
- Search for jobs based on various criteria, such as location, job title, or skills required.
- View detailed job descriptions and requirements.
- Apply for jobs directly through the platform.
- Track application status and receive notifications.
- Communicate with company representatives for further discussion.
- User authentication and authorization for secure access.
- Search functionality with filters and sorting options.
- User-friendly interface for easy navigation and interaction.
- Notifications and alerts for important updates.
- Responsive design for seamless usage on different devices.
- Backend: PHP 8.2
- Database: MySQL
To run the job marketplace platform locally, follow these steps:
- Clone the repository:
git clone https://github.com/basemax/JobMarketplaceDDDPHP.git
- Install dependencies:
composer update
- Set up the database and update the database configuration.
- Run migrations:
php migrate.php
- Start project:
php -S localhsot:8000 public/index.php
- Access the platform in your browser at
http://localhost:8000
We welcome contributions to enhance the job marketplace platform. If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature: git checkout -b feature/your-feature
- Commit your changes: git commit -m "Add your feature"
- Push to the branch: git push origin feature/your-feature
- Open a pull request explaining your changes.
- Please ensure that your code follows the established coding guidelines and passes any existing tests. Also, consider writing new tests to cover your changes.
GET /companies
: Retrieve a list of all companiesPOST /companies
: Create a new companyGET /companies/{id}
: Retrieve a specific company by IDPUT /companies/{id}
: Update a specific company by IDDELETE /companies/{id}
: Delete a specific company by ID
GET /jobs
: Retrieve a list of all jobsPOST /jobs
: Create a new jobGET /jobs/{id}
: Retrieve a specific job by IDPUT /jobs/{id}
: Update a specific job by IDDELETE /jobs/{id}
: Delete a specific job by ID
GET /jobs/{id}/applications
: Retrieve all applications for a specific jobPOST /jobs/{id}/applications
: Create a new application for a specific jobGET /applications/{id}
: Retrieve a specific application by IDPUT /applications/{id}
: Update a specific application by IDDELETE /applications/{id}
: Delete a specific application by ID
GET /developers
: Retrieve a list of all developersPOST /developers
: Create a new developerGET /developers/{id}
: Retrieve a specific developer by IDPUT /developers/{id}
: Update a specific developer by IDDELETE /developers/{id}
: Delete a specific developer by ID
POST /register
: Register a new user (developer or company)POST /login
: Authenticate a user and obtain an access tokenPOST /logout
: Logout the user and invalidate the access token
GET /profile
: Retrieve the user's profile informationPUT /profile
: Update the user's profile informationPUT /profile/password
: Update the user's password
GET /skills
: Retrieve a list of all available skillsPOST /skills
: Create a new skillGET /skills/{id}
: Retrieve a specific skill by IDPUT /skills/{id}
: Update a specific skill by IDDELETE /skills/{id}
: Delete a specific skill by ID
GET /favorites/jobs
: Retrieve a list of favorited jobs by the userPOST /favorites/jobs/{id}
: Add a job to the user's favoritesDELETE /favorites/jobs/{id}
: Remove a job from the user's favorites
GET /saved-searches
: Retrieve a list of saved searches by the userPOST /saved-searches
: Save a search with specified criteriaDELETE /saved-searches/{id}
: Delete a saved search by ID
GET /categories
: Retrieve a list of all job categoriesPOST /categories
: Create a new job categoryGET /categories/{id}
: Retrieve a specific job category by IDPUT /categories/{id}
: Update a specific job category by IDDELETE /categories/{id}
: Delete a specific job category by ID
GET /locations
: Retrieve a list of all available locationsPOST /locations
: Create a new locationGET /locations/{id}
: Retrieve a specific location by IDPUT /locations/{id}
: Update a specific location by IDDELETE /locations/{id}
: Delete a specific location by ID
GET /companies/{id}/reviews
: Retrieve all reviews for a specific companyPOST /companies/{id}/reviews
: Create a new review for a specific companyGET /reviews/{id}
: Retrieve a specific review by IDPUT /reviews/{id}
: Update a specific review by IDDELETE /reviews/{id}
: Delete a specific review by ID
GET /statistics/jobs
: Retrieve statistical data related to jobs (e.g., total jobs, top categories)GET /statistics/companies
: Retrieve statistical data related to companies (e.g., total companies, top locations)
GET /notifications
: Retrieve a list of notifications for the authenticated userPOST /notifications
: Create a new notification for the authenticated userGET /notifications/{id}
: Retrieve a specific notification by IDPUT /notifications/{id}
: Update a specific notification by IDDELETE /notifications/{id}
: Delete a specific notification by ID
POST /subscriptions/jobs
: Subscribe to receive notifications for new job postings based on specific criteriaDELETE /subscriptions/jobs/{id}
: Unsubscribe from notifications for a specific job subscription
GET /reports/jobs
: Generate a report of job postings based on various criteria (e.g., date range, category)GET /reports/companies
: Generate a report of companies based on various criteria (e.g., location, industry)
GET /admin/jobs
: Retrieve a list of all job postings (admin access)GET /admin/companies
: Retrieve a list of all companies (admin access)GET /admin/users
: Retrieve a list of all users (admin access)PUT /admin/users/{id}
: Update a user's profile or permissions (admin access)DELETE /admin/users/{id}
: Delete a user's account (admin access)
-- Table: users
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
role ENUM('company', 'developer') NOT NULL,
token VARCHAR(255) DEFAULT NULL,
token_expires_at TIMESTAMP DEFAULT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
-- Table: companies
CREATE TABLE companies (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
name VARCHAR(255) NOT NULL,
description TEXT,
location VARCHAR(255),
website VARCHAR(255),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: jobs
CREATE TABLE jobs (
id INT PRIMARY KEY AUTO_INCREMENT,
company_id INT NOT NULL,
title VARCHAR(255) NOT NULL,
description TEXT,
requirements TEXT,
location VARCHAR(255),
category VARCHAR(255),
type ENUM('full-time', 'part-time', 'contract', 'freelance') NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (company_id) REFERENCES companies(id) ON DELETE CASCADE
);
-- Table: applications
CREATE TABLE applications (
id INT PRIMARY KEY AUTO_INCREMENT,
job_id INT NOT NULL,
developer_id INT NOT NULL,
cover_letter TEXT,
resume VARCHAR(255),
status ENUM('pending', 'reviewed', 'accepted', 'rejected') NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE CASCADE,
FOREIGN KEY (developer_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: skills
CREATE TABLE skills (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
-- Table: job_skills
CREATE TABLE job_skills (
id INT PRIMARY KEY AUTO_INCREMENT,
job_id INT NOT NULL,
skill_id INT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE CASCADE,
FOREIGN KEY (skill_id) REFERENCES skills(id) ON DELETE CASCADE
);
-- Table: favorites
CREATE TABLE favorites (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
job_id INT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE CASCADE
);
-- Table: saved_searches
CREATE TABLE saved_searches (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
criteria TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: categories
CREATE TABLE categories (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
-- Table: locations
CREATE TABLE locations (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
-- Table: reviews
CREATE TABLE reviews (
id INT PRIMARY KEY AUTO_INCREMENT,
company_id INT NOT NULL,
user_id INT NOT NULL,
rating INT NOT NULL,
comment TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (company_id) REFERENCES companies(id) ON DELETE CASCADE,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: notifications
CREATE TABLE notifications (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
message TEXT,
is_read BOOLEAN DEFAULT false,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: subscriptions
CREATE TABLE subscriptions (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
criteria TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: payments
CREATE TABLE payments (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
job_id INT NOT NULL,
amount DECIMAL(10, 2) NOT NULL,
status ENUM('pending', 'success', 'failed') NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE CASCADE
);
-- Table: reports
CREATE TABLE reports (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
report_type ENUM('jobs', 'companies') NOT NULL,
criteria TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: admin_users
CREATE TABLE admin_users (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: qualifications
CREATE TABLE qualifications (
id INT PRIMARY KEY AUTO_INCREMENT,
developer_id INT NOT NULL,
degree VARCHAR(255),
institution VARCHAR(255),
major VARCHAR(255),
start_date DATE,
end_date DATE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (developer_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: experiences
CREATE TABLE experiences (
id INT PRIMARY KEY AUTO_INCREMENT,
developer_id INT NOT NULL,
company VARCHAR(255),
position VARCHAR(255),
start_date DATE,
end_date DATE,
description TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (developer_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: conversations
CREATE TABLE conversations (
id INT PRIMARY KEY AUTO_INCREMENT,
sender_id INT NOT NULL,
recipient_id INT NOT NULL,
subject VARCHAR(255),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (sender_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (recipient_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: messages
CREATE TABLE messages (
id INT PRIMARY KEY AUTO_INCREMENT,
conversation_id INT NOT NULL,
sender_id INT NOT NULL,
content TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (conversation_id) REFERENCES conversations(id) ON DELETE CASCADE,
FOREIGN KEY (sender_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Table: categories_jobs
CREATE TABLE categories_jobs (
id INT PRIMARY KEY AUTO_INCREMENT,
job_id INT NOT NULL,
category_id INT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE CASCADE,
FOREIGN KEY (category_id) REFERENCES categories(id) ON DELETE CASCADE
);
-- Table: reviews_developers
CREATE TABLE reviews_developers (
id INT PRIMARY KEY AUTO_INCREMENT,
developer_id INT NOT NULL,
user_id INT NOT NULL,
rating INT NOT NULL,
comment TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (developer_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
Registration:
curl --location 'http://localhost:2323/register' \
--header 'Content-Type: application/json' \
--form 'name="AliAhmadi"' \
--form 'email="AliAhmadi@gmail.com"' \
--form 'password="1234"' \
--form 'role="developer"'
Response:
{
"status": "user registration successful"
}
if url does not exist:
{
"status": "Not Found"
}
if method not allowed:
{
"message": "method not allowed",
"allowed methods": [
"POST"
]
}
The job marketplace platform is open-source software licensed under the GPL-3.0 License.
If you have any questions or suggestions regarding the job marketplace platform, please feel free to contact us.
Copyright 2023, Max Base