1
0
Fork 0
Go to file
Torma Kristóf 9d0cc3ecc0
continuous-integration/drone/push Build is passing Details
add longhorn note
2022-02-14 00:27:58 +01:00
helmchart finish helm 2022-02-14 00:08:25 +01:00
mealapi non unique memes 2022-02-13 23:01:47 +01:00
.dockerignore use docker compose 2022-02-13 20:46:47 +01:00
.drone.yml remove fancy stuff 2022-02-13 23:43:23 +01:00
.gitignore use docker compose 2022-02-13 20:46:47 +01:00
Dockerfile use different port 2022-02-13 21:10:02 +01:00
LoadExampleData.postman_collection.json better postman memes 2022-02-13 23:31:02 +01:00
MealHomeWork.postman_collection.json better postman memes 2022-02-13 23:31:02 +01:00
README.md add longhorn note 2022-02-14 00:27:58 +01:00
docker-compose.yml add longhorn note 2022-02-14 00:27:58 +01:00
requirements.txt some stuff donnerino 2022-02-13 20:38:02 +01:00

README.md

MealsAPI

This is a simple solution for a job application homework.

Assignment

We have meals which has name, price, ingredients, spicy, vegan, gluten free, description, kcal, (optionally picture is nice to have). Please create a rest API service running in Kubernetes for CRUD operations executed on meals. Authentication is nice to have, not mandatory. HA solution is also nice to have. We need a helm chart, source (in tgz or zip), readme.md how to start this service, some example curl calls. Please implement also unit tests, so we can see that the provided solution works. Please use Postgresql to store meals. Please fill the database with your favorite meals. Concentrate on to provide a working solution. Implementation language can be either python, go or java.

Running

In order to test or try out MealsAPI you first need to run it. It can be as simple as installing it's dependencies in a Python virtual environment.

python3 -m venv venv
source venv/bin/activate

pip3 install -r requirements.txt

After installing every dependency the app may be started inside the source directory (mealapi).

python3 app.py

An alternative is using the provided Docker Compose manifest.

docker-compose up

Testing

Testing may be done with Postman or newman.

There are two collections provided in the root folder of this project. The HOST environment variable needs to be set correctly in order to run the collections.

Populating the application with example data may be with the LoadExampleData collection. This may be ran with the following newman command.

newman run --env-var "HOST=127.0.0.1:8080" LoadExampleData.postman_collection.json

Testing the behaviour of the application can be done with the MealHomeWork collection. This may be ran with the following newman command.

newman run --env-var "HOST=127.0.0.1:8080" MealHomeWork.postman_collection.json

Helm chart

The helm chart part of the assignment is in the helmchart foler. It can be installed with the following command.

helm install mealapi ./helmchart

This commands should be ran from the root folder of this project. The Postgres deployment requires a storage provider backend (such as Longhorn)