Create .env file
HOST=0.0.0.0
DATABASE_URL=postgres://postgres:P@[email protected]/postgres
DAPR_URL=http://localhost:42573 #your Dapr product port on local, type <dapr list> to get it
DAPR_PRODUCT_APP=productapi
dapr run \
--app-id productapi \
--app-port 5001 \
--resources-path components \
--config components/daprConfig.yaml \
-- cargo run --bin product_api
dapr run \
--app-id counterapi \
--app-port 5002 \
--resources-path components \
--config components/daprConfig.yaml \
-- cargo run --bin counter_api
dapr run \
--app-id baristaapi \
--app-port 5003 \
--resources-path components \
--config components/daprConfig.yaml \
-- cargo run --bin barista_api
dapr run \
--app-id kitchenapi \
--app-port 5004 \
--resources-path components \
--config components/daprConfig.yaml \
-- cargo run --bin kitchen_api
Before docker compose up
, pls remember to run sudo rm -rf postgres-data
sea-orm-cli generate entity -l -s order -o crates/counter_entity/src
sea-orm-cli generate entity -l -s barista -o crates/barista_entity/src
sea-orm-cli generate entity -l -s kitchen -o crates/kitchen_entity/src
- SeaQL/sea-orm/axum_example
- vietnam-devs/coolstore-microservices
- fermyon/spin
- AxumCourse/axum-with-seaorm
- solidiquis/knodis
- https://carlosmv.hashnode.dev/adding-logging-and-tracing-to-an-axum-app-rust
- https://www.thorsten-hans.com/working-with-environment-variables-in-rust/
- https://chrismcg.com/2019/04/30/deserializing-optional-datetimes-with-serde/
- https://github.com/programatik29/axum-tutorial/blob/master/tutorial/04-generate-random-number.md