{"id":17712607,"url":"https://github.com/gr7800/hiring_managment_system","last_synced_at":"2026-01-24T16:06:05.869Z","repository":{"id":258263174,"uuid":"871462872","full_name":"gr7800/Hiring_Managment_System","owner":"gr7800","description":"This is a full-stack hiring management system where hiring managers can post jobs, users can apply for jobs, and managers can track and update the status of job applications. ","archived":false,"fork":false,"pushed_at":"2024-10-23T16:51:25.000Z","size":4750,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-23T23:47:13.831Z","etag":null,"topics":["bcrypt","cloudinary","css","express","git","html5","javascript","jest","jwt","mongodb","nodejs","nodemailer","react","reactjs","tailwindcss"],"latest_commit_sha":null,"homepage":"https://dreamjobing.netlify.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gr7800.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-12T03:22:52.000Z","updated_at":"2024-10-23T16:51:28.000Z","dependencies_parsed_at":"2024-10-25T10:19:57.924Z","dependency_job_id":null,"html_url":"https://github.com/gr7800/Hiring_Managment_System","commit_stats":null,"previous_names":["gr7800/hiring_managment_system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr7800%2FHiring_Managment_System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr7800%2FHiring_Managment_System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr7800%2FHiring_Managment_System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr7800%2FHiring_Managment_System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gr7800","download_url":"https://codeload.github.com/gr7800/Hiring_Managment_System/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252531836,"owners_count":21763290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bcrypt","cloudinary","css","express","git","html5","javascript","jest","jwt","mongodb","nodejs","nodemailer","react","reactjs","tailwindcss"],"created_at":"2024-10-25T09:05:45.270Z","updated_at":"2026-01-24T16:06:05.830Z","avatar_url":"https://github.com/gr7800.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hiring Management System\n\nThis project is a full-stack hiring management system designed to streamline the process of job postings, applications, and management. It includes features for both hiring managers and applicants, ensuring smooth functionality for posting jobs, managing applications, and applying for positions.\n\n## Features\n\n- **Job Management**: Hiring managers can create, update, and delete job postings.\n- **Job Application**: Applicants can apply to jobs by submitting resumes.\n- **Application Tracking**: Managers can review, track, and update the status of job applications.\n- **Authentication**: Secure login and registration system using JSON Web Tokens (JWT).\n- **File Upload**: Users can upload resumes, which are stored in Cloudinary.\n- **Pagination, Sorting, and Filtering**: Jobs can be paginated, searched, and sorted.\n- **Role-Based Access Control**: Different user roles (e.g., manager, user) with protected routes.\n\n## Tech Stack\n\n- **Backend**: Node.js, Express.js, MongoDB\n- **Frontend**: React, Redux Toolkit, Vite, TailwindCSS\n- **Authentication**: JWT (JSON Web Tokens)\n- **File Storage**: Cloudinary for resume uploads\n- **State Management**: Redux Toolkit for managing application state\n\n## Prerequisites\n\nEnsure you have the following installed before running the application:\n\n- Node.js (v14 or higher)\n- MongoDB (locally or using MongoDB Atlas)\n- A Cloudinary account for file storage\n\n## Installation\n\n### Backend Setup\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/your-repo/hiring-management-system.git\n   cd hiring-management-system/backend\n   ```\n\n2. Install backend dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Create a `.env` file in the `backend` directory and add the following environment variables:\n\n   ```bash\n   PORT=5000\n   MONGO_URI=\u003cYour MongoDB URI\u003e\n   JWT_SECRET=\u003cYour JWT secret key\u003e\n   CLOUDINARY_CLOUD_NAME=\u003cYour Cloudinary cloud name\u003e\n   CLOUDINARY_API_KEY=\u003cYour Cloudinary API key\u003e\n   CLOUDINARY_API_SECRET=\u003cYour Cloudinary API secret\u003e\n   ```\n\n4. Start the backend server:\n   ```bash\n   npm run dev\n   ```\n\n### Frontend Setup\n\n1. Navigate to the frontend directory:\n\n   ```bash\n   cd ../frontend\n   ```\n\n2. Install frontend dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Create a `.env` file in the `frontend` directory with the following content:\n\n   ```bash\n   VITE_BASE_URL=http://localhost:5000\n   ```\n\n4. Start the frontend development server:\n   ```bash\n   npm run dev\n   ```\n\n## API Documentation\n\n### Authentication\n\nAll protected routes require a JWT token in the `Authorization` header.\n\n- **Authorization Header Format**:\n  ```\n  Authorization: Bearer \u003ctoken\u003e\n  ```\n\n### Job Routes\n\n- **GET** `/jobs`: Retrieves all job postings with optional pagination, search, and sorting.\n\n  - **Query Params**:\n    - `page`: Current page (e.g., `/jobs?page=2`)\n    - `search`: Search for job titles or descriptions (e.g., `/jobs?search=developer`)\n    - `sort`: Sort by fields (e.g., `/jobs?sort=-datePosted`)\n\n- **GET** `/jobs/:jobId`: Retrieve a specific job by its ID.\n\n- **POST** `/jobs`: Create a new job posting (Protected: Manager).\n\n  - **Request Body**:\n    ```json\n    {\n      \"title\": \"Full Stack Developer\",\n      \"description\": \"Looking for an experienced developer.\",\n      \"requirements\": [\"3+ years experience\", \"React, Node.js\"],\n      \"location\": \"Remote\",\n      \"salaryRange\": \"60,000-80,000\"\n    }\n    ```\n  - **Authorization**: Requires a JWT token with a `role: \"manager\"`.\n\n- **PUT** `/jobs/:jobId`: Update a job posting (Protected: Manager).\n\n  - **Request Body**: Same as for job creation.\n  - **Authorization**: JWT token with `role: \"manager\"` required.\n\n- **DELETE** `/jobs/:jobId`: Delete a job posting (Protected: Manager).\n  - **Authorization**: JWT token with `role: \"manager\"` required.\n\n### Application Routes\n\n- **POST** `/applications/:jobId/apply`: Apply to a job posting.\n\n  - **Authorization**: Requires a JWT token.\n  - **Request Body (FormData)**:\n    - **Field**: `resume` (file upload)\n  - **Example**:\n    ```bash\n    curl -X POST -H \"Authorization: Bearer \u003ctoken\u003e\" -F \"resume=@path/to/file.pdf\" http://localhost:5000/applications/\u003cjobId\u003e/apply\n    ```\n\n- **GET** `/applications/:jobId/applications`: Get all applications for a specific job (Protected: Manager).\n\n  - **Authorization**: JWT token with `role: \"manager\"` required.\n\n- **PUT** `/applications/:applicationId/status`: Update the status of an application (Protected: Manager).\n  - **Request Body**:\n    ```json\n    {\n      \"status\": \"accepted\"\n    }\n    ```\n  - **Authorization**: JWT token with `role: \"manager\"` required.\n\n### User Routes\n\n- **POST** `/users/register`: Register a new user.\n\n  - **Request Body**:\n    ```json\n    {\n      \"name\": \"John Doe\",\n      \"email\": \"john@example.com\",\n      \"password\": \"yourpassword\"\n    }\n    ```\n\n- **POST** `/users/login`: Log in a user.\n\n  - **Request Body**:\n    ```json\n    {\n      \"email\": \"john@example.com\",\n      \"password\": \"yourpassword\"\n    }\n    ```\n\n- **GET** `/users/profile`: Get the logged-in user's profile (Protected).\n\n  - **Authorization**: JWT token required.\n\n- **PUT** `/users/profile`: Update the user's profile (Protected).\n  - **Request Body**:\n    ```json\n    {\n      \"name\": \"Updated Name\",\n      \"password\": \"newpassword\"\n    }\n    ```\n\n## Cloudinary Integration for Resume Upload\n\n- Resumes are uploaded to Cloudinary when a user applies for a job.\n- The Cloudinary configuration is stored in the `.env` file with the following keys:\n\n  ```bash\n  CLOUDINARY_CLOUD_NAME=\u003cyour-cloudinary-cloud-name\u003e\n  CLOUDINARY_API_KEY=\u003cyour-cloudinary-api-key\u003e\n  CLOUDINARY_API_SECRET=\u003cyour-cloudinary-api-secret\u003e\n  ```\n\n- After successful upload, resumes are stored in the `resume` folder on Cloudinary.\n\n### Example of Upload Functionality:\n\n```javascript\nconst cloudinaryUpload = async (req) =\u003e {\n  const result = await cloudinary.uploader.upload(req.file.path, {\n    folder: \"resume\",\n    resource_type: \"raw\",\n  });\n  return result.secure_url;\n};\n```\n\n## Middleware\n\n### Authentication Middleware\n\n- The `authMiddleware` checks for the JWT in the request's `Authorization` header and verifies the token.\n- If the token is invalid or absent, a `401 Unauthorized` response is sent.\n\n### Role Verification Middleware\n\n- The `verifyRole` middleware ensures that only users with the required role (e.g., `manager`) can access specific routes.\n\n### Multer for File Uploads\n\n- `Multer` is used for handling file uploads. Resume files are stored temporarily on the server, then uploaded to Cloudinary, after which the local file is deleted.\n\n## Running Tests\n\nTo run tests for the application:\n\n```bash\nnpm run test\n```\n\n## Deployment\n\n### Backend\n\nThe backend can be deployed to services like Heroku or DigitalOcean. Ensure that you properly set your environment variables on the production server.\n\n### Frontend\n\nThe frontend can be deployed using services like Vercel or Netlify. Update the `VITE_BASE_URL` in the `.env` file to point to your production API URL.\n\n// mongodb query\n\n```bash\n db.jobs.aggregate([\n{\n$match:{\n       $or:[\n            {title:{$regex:\"Front\",$options:\"i\"}}\n           ]\n    }\n },\n  {\n    $lookup:{\n          from:\"users\",\n          localField:\"postedBy\",\n          foreignField:\"_id\",\n          as:\"postedBy\"\n    }\n  },\n  {\n    $unwind:\"$postedBy\"\n},\n{\n$facet: {\n    jobs:[\n      {$sort:{[\"updatedAt\"]:1}},\n{$skip: (2-1)*2},\n      {$limit: Number(2)},\n{$project:{\n               title:1,\n               location:1,\n               jobTypw:1,\n               postedBy:{\n                   name: \"$postedBy.name\",\nemail: \"$postedBy.email\",\n                },\n               createdAt: 1,\n        },\n      },\n    ],\n    totalJobs: [{$count:\"count\"}],\n},\n},\n],\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr7800%2Fhiring_managment_system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgr7800%2Fhiring_managment_system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr7800%2Fhiring_managment_system/lists"}