OLTP API for the insertion and analysis of company employees, departments, and jobs
- Install Python
- Install Docker Desktop
- Clone repository
- Open the terminal and go inside the project folder.
- Run the following command to run the containers 3 containers:
- Flask API (port 5000)
- MySQL (port 3306)
- phpMyAdmin (port 80)
- Start using the API ๐ค.
- (Optional) You can try the version hosted on Azure ๐ซก.
http://52.226.230.142:5000 # API
# or
http://52.226.230.142 # phpMyAdmin
If you have the containers up and running, follow the next steps to execute the test cases:
- Go inside the "jcompany" folder
- Create the virtual environment (venv) and install all the dependencies.
python -m venv venv
# Run "activate" script inside the "venv/Scripts" folder
pip install --upgrade pip
pip install -r requirements.txt
- Run the tests
URL |
Method |
Input |
Output |
.../departments |
GET |
- |
List of departments |
.../departments |
POST |
List of departments |
- |
.../departments/csv |
POST |
csv of departments |
- |
URL |
Method |
Input |
Output |
.../jobs |
GET |
- |
List of jobs |
.../jobs |
POST |
List of jobs |
- |
.../jobs/csv |
POST |
csv of jobs |
- |
URL |
Method |
Input |
Output |
.../employees |
GET |
- |
List of employees |
.../employees |
POST |
List of employees |
- |
.../employees/csv |
POST |
csv of employees |
- |
URL |
Method |
Input |
Output |
.../stats/a |
GET |
- |
Number of employees hired in 2021 for each job and department, divided by quarter |
.../stats/b |
GET |
- |
Department that hired more employees than the mean of employees hired in 2021 |