Skip to content
Snippets Groups Projects
Commit 5e848419 authored by Sercan Yesildal's avatar Sercan Yesildal
Browse files

added docs

parent 3d2595e4
No related branches found
No related tags found
No related merge requests found
...@@ -10,5 +10,12 @@ github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6Ni ...@@ -10,5 +10,12 @@ github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6Ni
github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
readme.md 0 → 100644
# MealPlanner2Go
MealPlanner2Go ist eine Schnittstelle zur Erstellung von Einkaufslisten innerhalb einer Gruppe oder für sich.
Hierzu werden vom Nutzenden Einkaufstage und Mahlzeiten festgelegt und die Applikation erstellt zugeschnittene Einkaufslisten für die jeweiligen Tage.
## Starten (mit Docker Compose)
### Services bauen und starten
Mit diesen Befehlen werden die Services der Applikation lokal gestartet.
```bash
docker compose build && docker compose up
```
### Services stoppen und entfernen
Mit diesem Befehl wird der Service entfernt. Volumes bleiben bestehen.
```bash
docker compose down
```
### Ungenutzte Volumes löschen
Mit diesem Befehl werden alle ungenutzten Volumes entfernt.
```bash
docker volume prune
```
## Nutzung der API
### Nutzerfunktionen
Nutzer erstellen
```bash
curl -H "Content-Type: application/json" -d '{"mail":"max.mustermann@gmail.com","firstName":"Max","lastName":"Mustermann"}' localhost:8000/user
```
Nutzer abrufen
```bash
curl localhost:8000/user/1
```
Nutzerliste abrufen
```bash
curl localhost:8000/user
```
Nutzer aktualisieren
```bash
curl -X PUT -H "Content-Type: application/json" -d ''{"mail":"max.mustermann@gmail.com","firstName":"Max","lastName":"Mustermann"}' localhost:8000/user/1
```
Nutzer entfernen
```bash
curl -X DELETE localhost:8000/user/1
```
Einkaufstage hinzufügen
```bash
curl -H "Content-Type: application/json" -d '{"userId":1,"date":"2023-07-12"}' localhost:8000/user/date
```
Einkaufstage entfernen
```bash
curl -X DELETE localhost:8000/user/date/1
```
Gericht hinzufügen
```bash
curl -H "Content-Type: application/json" -d '{"userId":1,"mealId":52992,"date":"2023-07-12"}' localhost:8000/user/meal
```
Gericht entfernen
```bash
curl -X DELETE localhost:8000/user/meal/1
```
Gericht favorisieren
```bash
curl -H "Content-Type: application/json" -d '{}' localhost:8000/user/1/52992
```
Gericht entfavorisieren
```bash
curl -X DELETE localhost:8000/user/1/52992
```
Einkaufsliste abrufen
```bash
curl localhost:8000/user/list/1
```
### Gruppenfunktionen
Gruppe erstellen
```bash
curl -H "Content-Type: application/json" -d '{"name":"Enterprise Development"}' localhost:8000/group
```
Gruppe abrufen
```bash
curl localhost:8000/group/1
```
Gruppenliste abrufen
```bash
curl localhost:8000/group
```
Gruppe entfernen
```bash
curl -X DELETE localhost:8000/group/1
```
Gericht hinzufügen
```bash
curl -H "Content-Type: application/json" -d '{"groupId":1,"mealId":52992,"date":"2023-07-12"}' localhost:8000/group/meal
```
Gericht entfernen
```bash
curl -X DELETE localhost:8000/group/meal/1
```
Nutzer hinzufügen
```bash
curl -H "Content-Type: application/json" -d '{}' localhost:8000/group/1/1
```
Nutzer entfernen
```bash
curl -X DELETE localhost:8000/group/1/1
```
### Gerichtfunktionalitäten (interne Kommunikation über gRPC)
Zufälliges Gericht abrufen
```bash
curl localhost:8000/meal/random
```
Bestimmtes Gericht abrufen
```bash
curl localhost:8000/meal/53043
```
Nach Gerichten suchen
```bash
curl localhost:8000/meal/search/eggplant
```
Kategorien einsehen
```bash
curl localhost:8000/meal/category
```
Nach Kategorien filtern
```bash
curl localhost:8000/meal/category/beef
```
Orte einsehen
```bash
curl localhost:8000/meal/area
```
Nach Orten filtern
```bash
curl localhost:8000/meal/area/american
```
Zutaten einsehen
```bash
curl localhost:8000/meal/ingredient
```
Nach Zutaten filtern
```bash
curl localhost:8000/meal/ingredient/chicken
```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment