- Install Docker and Docker-Compose: https://docs.docker.com/get-docker/.
- Build the container:
docker-compose build
- Install
grpcurl
: https://github.com/fullstorydev/grpcurl - Run (to seed the local DB):
bin/docker_run go run cmd/seed/main.go --seed_file=config/seed.csv
- Run:
docker-compose up
- In a separate terminal, run:
cd frontend/ npm install npm run dev
- Go to:
http://localhost:3000
Seed a recipe:
grpcurl -plaintext -d @ localhost:50051 mealfriend.Mealfriend/Scrape <<EOM
{
"url": "https://cafedelites.com/best-churros-recipe/"
}
Plan meals:
grpcurl -plaintext -d @ localhost:50051 mealfriend.Mealfriend/GetMealPlan <<EOM
{
"requirements": {
"beef": 1,
"poultry": 1,
"fish": 2,
"unspecified": 1
}
}
EOM
unspecified
acts as a "filler" for any recipe (i.e. no requirement).
- Run:
To store the recipe, use the
bin/docker_run go run cmd/scrape/main.go --input_url=RECIPE_URL
--store=1
option:bin/docker_run go run cmd/scrape/main.go --store=1 --input_url=RECIPE_URL
- Run:
docker-compose up
- Go to: http://localhost:7474/browser/
- Connect to:
bolt://localhost:7687
, grab the username and password from docker-compose.yml
- Connect to:
- Install
protobuf
andprotoc-gen-grpc-web
:brew install protobuf brew install protoc-gen-grpc-web npm i -g ts-protoc-gen
- Run:
protoc --go_out=. --go_opt=paths=source_relative \ --go-grpc_out=. --go-grpc_opt=paths=source_relative \ --js_out=import_style=commonjs,binary:./frontend/src \ --ts_out=service=grpc-web:./frontend/src \ protos/mealfriend.proto
- Start the container:
docker-compose up
- In a separate console, run:
cd frontend/ npm run dev
- Go to:
localhost:3000
, and open the console. You should see successful requests to the gRPC server.
- Run:
e.g.
bin/docker_run dlv debug PACKAGE_NAME -- -arg1=val1
bin/docker_run dlv debug github.com/oliver-hohn/mealfriend/cmd/seed -- -seed_file=config/seed.csv