Realworld App using Rust
, actix-web
, and diesel
.
Docker
# ready
$ sh ./scripts/copy-env.sh
$ docker compose up -d
$ curl http://localhost:8080/api/healthcheck
# => OK
Local
# ready
$ sh ./scripts/copy-env.sh
# start postgres
$ brew services start postgres
# start app
$ diesel setup
$ cargo watch
$ curl http://localhost:8080/api/healthcheck
# => OK
Running E2E tests using POSTMAN scripts on CI
# run e2e
$ APIURL=http://localhost:8080/api zsh e2e/run-api-tests.sh
- Rust Edition 2021
- ActixWeb 4.x
- Diesel 1.4.x
sequenceDiagram
actor Client
participant Middleware as Middleware<br>/middleware/*
participant Controller as Controller<br>/[feature]/api.rs
participant Service as Service<br>/[feature]/service.rs
participant DB
Client ->> Middleware: request
Middleware ->> Controller: -
Controller ->> Controller: Assign to Request Object<br>(/[feature]/request.rs)
Controller ->> Service: -
Service ->> DB: -
DB ->> Service: -
Service ->> Controller: -
Controller ->> Controller: Convert into Response Object<br>(/[feature]/response.rs)
Controller ->> Client: response
MIT