A microservices example using Dapr
This project uses the Dapr runtime to create a distributed calculator. The services are written in multiple languages including Go, Python, TS/JS, C#, and WAT. Frameworks used include Deno, Gorilla/mux, Flask, .NET, Rocket and React.
flowchart TD
A{React Frontend} -- Addition --> B[Flask] --> C[Wasmer wasm module];
A{React Frontend} -- Subtraction --> D[Deno];
A{React Frontend} -- Multiplication --> E[Gorilla/mux];
A{React Frontend} -- Division --> F[ASP.NET];
A{React Frontend} -- POW --> G[Rocket.rs];
- Install required packages:
pip3 install wheel python-dotenv flask_cors flask wasmer wasmer_compiler_cranelift
- Run dapr using the command:
dapr run --app-id addapp --app-port 5555 --dapr-http-port 3501 -- flask run
- Run dapr using the command:
dapr run --app-id subtractapp --app-port 1447 --dapr-http-port 3502 -- deno run --allow-net app.ts
- install dependencies:
go mod tidy
- Build the app
go build multiply.go
- Run dapr using the command:
dapr run --app-id multiplyapp --app-port 7286 --dapr-http-port 3503 -- ./multiply
- Build the app. Run:
dotnet build
- Start Dapr using the following command:
dapr run --app-id divideapp --app-port 8889 --dapr-http-port 3509 -- dotnet bin/Debug/net6.0/csharp.dll
- Build the app. Run:
cargo build --release
- Start dapr using the command:
dapr run --app-id exponentapp --app-port 8008 --dapr-http-port 3505 -- ./target/release/rust
- Install the required modules
npm install
npm run buildclient
- Start Dapr using the command below
dapr run --app-id frontendapp --app-port 8080 --dapr-http-port 3500 -- node server.js
Lastly, open a browser window and go to http://localhost:8080/.