wanderindev / hr-rest-api

RESTful API for Human Resources Database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RESTful API for our Human Resources Database πŸ•˜ - πŸ•”

Documentation Maintenance Coverage License: MIT Twitter: JavierFeliuA

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.

How to use in development

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.

Running tests

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.

Testing with Postman

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.

Deployment

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

Author

πŸ‘€ Javier Feliu

Show your support

Give a ⭐️ if this project helped you!

πŸ“ License

Copyright Β© 2019 Javier Feliu.

This project is MIT licensed.


I based this README on a template generated with ❀️ by readme-md-generator

About

RESTful API for Human Resources Database

License:MIT License


Languages

Language:Python 99.7%Language:Dockerfile 0.3%