This project contatins a rust and dart grpc servers and clients. Emphasis on rust server, and dart client. This was adapted from https://github.com/hyperium/tonic/blob/master/examples/routeguide-tutorial.md
as a self contained project. Note the appendix for customizing proto building, only necessary if .proto files will be kept outside of this repo.
rustup component add rustfmt
cargo-watch
is usefull for auto-compiling:
cargo install cargo-watch
apt-get install libpq-dev
cargo install diesel_cli --no-default-features --features postgres
protoc
to compile dart files easily:
PROTOC_ZIP=protoc-3.12.3-linux-x86_64.zip
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP
may also need to run: pub global activate protoc_plugin
The proto files are found inside the base proto
folder. Anytime there is a change to any .proto
files these commands must be executed to update the generated code
Execute the gen_protos.sh
script
Execute cargo run
in the protobuild
directory.
Server needs a database, and assumes that there is one by default see -h
if you try running the server. For local development simply enter the docker folder and use the script dc-dev.sh up
which runs the development version of the setup. Add -d
to it in order to run it in the background.
./dc-dev.sh up -d
diesel migration run
to generate the needed database tables for the first timeEnter the directory sy-server
when running these commands:
cargo run --bin sy-server
cargo watch -x 'run --bin sy-server'
This is a dart client. Enter the directory sy-client
dart bin/manageusers-cli.dart
TODO: