RESTful API for performing CRUD operations in our Human Resources database. The API was coded in Python using Flask, Flask-RESTful, SQLAlchemy, and Flask-JWT. For testing, I used UnitTest.
Clone the repository:
git clone https://github.com/wanderindev/hr-rest-api.git
cd hr-rest-api
Start the application with docker-compose:
docker-compose up --build
This will create a database container, a RESTful API container, a backend network, and a volume mapping the ./rest directory in the repository with the working directory in the container.
From PyCharm, right-click in the tests/system
or tests/unit
directory and select
"Run tests with Coverage" to run either system or unit tests.
Clone the postman-hr-rest-api repository:
git clone https://github.com/wanderindev/postman-hr-rest-api.git
Open Postman and import hr-rest-api.json
and hr-rest-api-environment.json
.
Click on Runner.
In the window that pops open, select the hr-rest-api
collection and the hr-rest-api
environment.
Click on Run.
Modify rest/Dockerfile_prod
, adding the correct values for the environment variables.
Build the container image and push to Docker Hub:
cd rest
docker build -t wanderindev/hr-rest -f Dockerfile_prod .
docker push wanderindev/hr-rest
Go to the do-managed-kubernetes repository and re-deploy the pod.
kubectl delete deployment hr-rest
kubectl apply -f ./sites/hr-rest.yml
👤 Javier Feliu
- Twitter: @JavierFeliuA
- Github: @wanderindev
Give a ⭐️ if this project helped you!
Copyright © 2019 Javier Feliu.
This project is MIT licensed.
I based this README on a template generated with ❤️ by readme-md-generator