Skip to content

An API that keeps track of different job opportunities and applicants

Notifications You must be signed in to change notification settings

Murigi-Nganga/ajiri_api

Repository files navigation

Ajiri API

An API that keeps track of different job opportunities and applicants

Getting Started

Prerequisites

Ensure you have the following installed:

  • Python (version 3.6 or higher)
  • pip (Python package installer)
  • PostgreSQL Database (and optionally, PgAdmin)

Create a virtual environment

  1. Open a terminal or command prompt.

  2. Navigate to the project directory:

     cd /path/to/your/project
  3. Create a virtual environment

     python -m venv venv

If you are you are on a Linux machine, use python3, instead

4.Activate the virtual environment:

  • On Windows:

    venv\Scripts\activate
  • On macOS/Linux:

        source venv/bin/activate

Once activated, your terminal prompt should change to indicate the virtual environment

Installing Dependencies

  1. Ensure the virtual environment is activated.

  2. Install the project dependencies using pip and the requirements.txt file:

        pip install -r requirements.txt

If you are you are on a Linux machine, use pip3, instead

Before running the project

  1. Create a database in PostgreSQL with the name 'ajiri'

  2. Create a .env file in the root directory of the project and set the following variables:

        DBUSER=your-database -username
        DBPASSWORD=-your-users-password
  3. In your terminal, navigate to your project directory and run:

        python manage.py makemigrations

    then:

        python manage.py migrate

This last command creates the required tables in the ajiri database

Running the project

  • To execute the project, run:

        python manage.py runserver 8000

Database Schema

This database schema was used for the exercise

Database Schema Image

Postman collection

The following resource contains a published collection of the API Endpoints for Ajiri API:

Ajiri Postman Collection

Exercise approach

  1. Adding a List of jobs

  2. Taking the names of applicants, job applied and resumes and adding them to a DB.

    Since the database tables had relationships, I followed the following process:

    When creating an applicant, ensure you use form-data because you will be making a multi-part request

    Create applicant

    The uploaded file is stored in the media folder in your project's directory, specifically in media/applicant_resumes directory

    Resume storage

    The files are stored in the mentioned directory while their paths are stored in the database

  3. Returning applicant details and jobs applied

Additional functionality attempted

  1. Filtering job applications by company
  2. Filtering job applications by applicant

The above are important for copmanies and individuals to view applications that are specific to them

Careful considerations

  1. An applicant can only apply for a specific job once
  2. Only job applications with the status 'Under Review' or 'Applied' can be updated

Running project tests

  • To execute the project tests, run:

        python manage.py test

About

An API that keeps track of different job opportunities and applicants

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages