Food and fy
Instructions on how to setup a local development environment and start developing! 👨💻👩💻
The easiest way to have a docker demon running and to set up a local kubernetes cluster is by using docker desktop. You can find installation instructions at their website.
Remember to enable the kubernetes addon once docker desktop is installed.
Garden is a tool used for managing our cluster. It also allows for rapid local prototyping. Please see their docs on how to install.
You don't need Rust in order to get things running. But its highly recommended that you have it installed in order to ease debugging and development. The recommended way is to install rust though the tool rustup.
Rustup will automatically install the latest stable release ✨
Note: Due to restrictions on how Helm a Kubernetes works, the CRDs for prometheus needs to be deployed first. You can do that with this command:
kubectl apply -f tools/crd/prometheus.yaml
You only have to do this once when you have a fresh cluster.
All you need to do is to run the command below and garden will do all the setup for you
garden dev
This command will automatically discover your local kubernetes cluster and then deploy all our resources on it, cool huh! Once everything is running (might take a while on first run) you can access the graphql playground at http://foodify.local.app.garden/, and grafana at http://foodify.local.app.garden/grafana. Garden will track your files and rebuild your services when needed.
A bad thing right now is that you will have no data at all in our cluster. But worry, Le Chef to the rescue. He is a five star master chef powered by AI. Just run the command bellow and watch him do his thing.
cargo run --bin le_chef
You can verify that all our rust code builds with this simple command:
cargo build
You can test the rust code with this command:
cargo test
The error:
Updating git repository `https://github.com/graphql-rust/juniper`
... [output omitted]
Caused by:
failed to authenticate when downloading repository
attempted ssh-agent authentication, but none of the usernames `git` succeeded
Caused by:
no authentication available
The fix:
CARGO_NET_GIT_FETCH_WITH_CLI=true cargo build
Reference: rust-lang/cargo#2078