OLTP API for the insertion and analysis of company employees, departments, and jobs
![Azure](https://camo.githubusercontent.com/4a7c0b29478c7038b8cf53c72b63a5ccfa2308a04555f339f465e00547713163/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6963726f736f6674253230617a7572652d3030383944363f7374796c653d666f722d7468652d6261646765266c6f676f3d6d6963726f736f66742d617a757265266c6f676f436f6c6f723d7768697465)
- 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 |