https://github.com/lloydmeta/todddo-openapi-rs
Survey of the Rust web scene in mid-2019, covering async/await, DDD-esque structure, testing, mocking, OpenAPI, and Actix
https://github.com/lloydmeta/todddo-openapi-rs
actix actix-web async async-await ddd-esque ddd-patterns futures openapi rust rust-web rustlang swagger
Last synced: about 2 months ago
JSON representation
Survey of the Rust web scene in mid-2019, covering async/await, DDD-esque structure, testing, mocking, OpenAPI, and Actix
- Host: GitHub
- URL: https://github.com/lloydmeta/todddo-openapi-rs
- Owner: lloydmeta
- Created: 2019-08-19T14:50:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-22T07:09:20.000Z (over 5 years ago)
- Last Synced: 2025-03-18T19:29:37.739Z (about 2 months ago)
- Topics: actix, actix-web, async, async-await, ddd-esque, ddd-patterns, futures, openapi, rust, rust-web, rustlang, swagger
- Language: Rust
- Homepage:
- Size: 526 KB
- Stars: 17
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## todddo-openapi-rs [](https://travis-ci.org/lloydmeta/todddo-openapi-rs) [](https://codecov.io/gh/lloydmeta/todddo-openapi-rs)
This project explores using using Rust in a DDD-esque fashion (cleanly separated `domain` and `infra`), along with
the current (as of writing) Rust web tools, such as `actix-web`, and generated-from-source OpenAPI spec.In specific:
- [actix-web](https://actix.rs/)
- Mixing Future 0.1 with async/await-ready Future 0.3
- Using `async/await` via nightly
- Using it with traits via [`async-trait`](https://github.com/dtolnay/async-trait)
- Using paperclip to generate [OpenAPI](https://paperclip.waffles.space/paperclip/) from source
- Using [`future_locks`](https://docs.rs/futures-locks/0.3.3/futures_locks/) for async mutexes
- Compiling static assets into the binary.
- DDD-esque project structuring using workspaces to keep dependencies pure
- Postponing of concrete types for interfaces (`trait`s) to maximise testabilityThis is spiritually the sister project to [the Go version](https://github.com/lloydmeta/todddo-openapi).
## Running
This project requires nightly, so you'll need to `rustup toolchain install nightly`, then run via
```shell
cargo +nightly run
```After that, go to [http://localhost:8080/swagger/index.html](http://localhost:8080/swagger/index.html) to play around
with the built-in Swagger spec + UI.
If, for some reason, nightly is borked, `nightly-2019-08-20-x86_64-apple-darwin` has been known to work; just install
the right toolchain (`nightly-2019-08-20-${your-architecture}`) and run with that instead.