Skip to content

BAGOMBEKA-JOB-DEV/JOB_PORTAL-APIs-

Repository files navigation

🏒 SIMPLE JOB PORTAL LARAVEL API

πŸš€ Features

  • βœ… Register, Login & Logout
  • πŸ“‹ Job Listing CRUD ( Authorization token required!)
  • πŸ“Œ Filter job listing according to salary, category, location and job title. ( Authorization token required!)
  • ✍️ Apply to a job ( Authorization token required!)
  • Job applications CRUD ( Authorization token required!)

βš™οΈ Usage

πŸ“¦ Install Composer Dependencies

composer install

πŸ“ Add .env Variables

Rename .env.example to .env and configure your database:

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

Generate APP Key

php artisan key:generate

πŸ“‚ Run Migrations

php artisan migrate

πŸš€ Run Server

php artisan serve

🎨 Run Vite (For Front-End (Only Register and Login))

php artisan serve

Open http://localhost:8000 or the provided URL.


πŸ“‘ API Endpoints

πŸ“ Register (POST)

POST http://127.0.0.1:8000/api/register

Request Body:

{
    "name": "BAGOMBEKA JOB",
    "email": "[email protected]",
    "password": "hellomama256"
}

Response:

{
    "message": "User Created Successfully"
}

πŸ”‘ Login (POST)

POST http://127.0.0.1:8000/api/login

Request Body:

{
    "email": "[email protected]",
    "password": "hellomama256"
}

Response:

{
    "token": "11|ccuMPCbuWLkNia2xYR0vurPNFwuMSebqNZvzbsGLf621b5e8"
}

πŸ“Œ Job Creation (POST) (Auth Required)

POST http://127.0.0.1:8000/api/job-listings

Request Body:

{
    "title": "Accountant",
    "description": "We are looking for a skilled accountant to join our team and work on cutting-edge projects.",
    "company": "SMSONE.",
    "location": "Kampala, Uganda",
    "salary": "700000",
    "category": "Accounting"
}

Response:

{
    "title": "Accountant",
    "description": "We are looking for a skilled accountant to join our team and work on cutting-edge projects.",
    "company": "SMSONE.",
    "location": "Kampala, Uganda",
    "salary": "700000",
    "category": "Accounting",
    "updated_at": "2025-02-25T11:08:48.000000Z",
    "created_at": "2025-02-25T11:08:48.000000Z",
    "id": 3
}

πŸ“‹ List All Jobs (GET)

GET http://127.0.0.1:8000/api/job-listings

Response:

[
    {
        "id": 1,
        "title": "Software Engineer",
        "description": "We are looking for a skilled software engineer to join our team and work on cutting-edge projects.",
        "company": "Tech Innovations Ltd.",
        "location": "Kampala, Uganda",
        "salary": 50000,
        "category": "Software Development",
        "created_at": "2025-02-25T08:35:32.000000Z",
        "updated_at": "2025-02-25T08:35:32.000000Z"
    },
    {
        "id": 2,
        "title": "Software Engineer",
        "description": "We are looking for a skilled software engineer to join our team and work on cutting-edge projects.",
        "company": "Tech Innovations Ltd.",
        "location": "Kampala, Uganda",
        "salary": 50000,
        "category": "Software Development",
        "created_at": "2025-02-25T08:35:37.000000Z",
        "updated_at": "2025-02-25T08:35:37.000000Z"
    },
    {
        "id": 3,
        "title": "Accountant",
        "description": "We are looking for a skilled accountant to join our team and work on cutting-edge projects.",
        "company": "SMSONE.",
        "location": "Kampala, Uganda",
        "salary": 700000,
        "category": "Accountanting",
        "created_at": "2025-02-25T11:08:48.000000Z",
        "updated_at": "2025-02-25T11:08:48.000000Z"
    }
]

πŸ“© Apply to a Job (POST) (Auth Required)

POST http://127.0.0.1:8000/api/apply

Request Body:

{
    "job_id": "3",
    "user_id": "4",
    "cover_letter": "Hello there, I am applying for the role of accountant at your company! Thanks"
}

Response:

{
    "job_id": "3",
    "user_id": "4",
    "cover_letter": "Hello there, I am applying for the role of accountant at your company! Thanks",
    "updated_at": "2025-02-25T11:20:25.000000Z",
    "created_at": "2025-02-25T11:20:25.000000Z",
    "id": 2
}

πŸ“œ List All Applications (GET)

GET http://127.0.0.1:8000/api/applications

Response :

[
    {
        "id": 1,
        "user_id": 2,
        "job_id": 2,
        "cover_letter": "hello there....",
        "status": "pending",
        "created_at": "2025-02-25T09:46:32.000000Z",
        "updated_at": "2025-02-25T09:46:32.000000Z"
    },
    {
        "id": 2,
        "user_id": 4,
        "job_id": 3,
        "cover_letter": "Hello there, am applying for the role of accountant at your company! Thanks",
        "status": "pending",
        "created_at": "2025-02-25T11:20:25.000000Z",
        "updated_at": "2025-02-25T11:20:25.000000Z"
    }
]

πŸ” Filters

  • Filter by Category: GET http://127.0.0.1:8000/api/job-listings?category=Accounting
  • Filter by Salary: GET http://127.0.0.1:8000/api/job-listings?salary=70000
  • Filter by Location: GET http://127.0.0.1:8000/api/job-listings?location=Kampala
  • Filter by job title: GET http://127.0.0.1:8000/api/job-listings?title=Accountant

Happy Coding!!!!. Please ensure to give me credit in case you clone or fork this project. You didn't code it, I did!!!!!!

Releases

No releases published

Packages

No packages published

Languages