An API that keeps track of different job opportunities and applicants
Ensure you have the following installed:
- Python (version 3.6 or higher)
- pip (Python package installer)
- PostgreSQL Database (and optionally, PgAdmin)
-
Open a terminal or command prompt.
-
Navigate to the project directory:
cd /path/to/your/project
-
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
-
Ensure the virtual environment is activated.
-
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
-
Create a database in PostgreSQL with the name 'ajiri'
-
Create a .env file in the root directory of the project and set the following variables:
DBUSER=your-database -username DBPASSWORD=-your-users-password
-
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
-
To execute the project, run:
python manage.py runserver 8000
This database schema was used for the exercise
The following resource contains a published collection of the API Endpoints for Ajiri API:
-
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
The uploaded file is stored in the media folder in your project's directory, specifically in
media/applicant_resumes
directoryThe files are stored in the mentioned directory while their paths are stored in the database
The above are important for copmanies and individuals to view applications that are specific to them
- An applicant can only apply for a specific job once
- Only job applications with the status 'Under Review' or 'Applied' can be updated
-
To execute the project tests, run:
python manage.py test