This commit is contained in:
parent
c66c4113a0
commit
9d0cc3ecc0
65
README.md
65
README.md
@ -0,0 +1,65 @@
|
||||
# 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.
|
||||
|
||||
```bash
|
||||
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).
|
||||
|
||||
```bash
|
||||
python3 app.py
|
||||
```
|
||||
|
||||
An alternative is using the provided Docker Compose manifest.
|
||||
|
||||
```bash
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
Testing may be done with [Postman](https://www.postman.com) or [newman](https://www.npmjs.com/package/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.
|
||||
|
||||
```bash
|
||||
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.
|
||||
|
||||
```bash
|
||||
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.
|
||||
|
||||
```bash
|
||||
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](https://longhorn.io))
|
@ -11,7 +11,7 @@ services:
|
||||
POSTGRES_DB: mealsdb
|
||||
|
||||
mealsapi:
|
||||
image: registry.kmlabz.com/tormakris/meal_homework
|
||||
image: tormachris/meal_homework
|
||||
restart: always
|
||||
depends_on:
|
||||
- db
|
||||
|
Loading…
Reference in New Issue
Block a user