https://github.com/schneidersteve/buckpal-rust
Rust Example Implementation of a Hexagonal/Onion/Clean Architecture
https://github.com/schneidersteve/buckpal-rust
clean-architecture dependency-injection hexagonal-architecture inversion-of-control mockall onion-architecture rust rust-analyzer rust-async salvo sqlx
Last synced: 9 months ago
JSON representation
Rust Example Implementation of a Hexagonal/Onion/Clean Architecture
- Host: GitHub
- URL: https://github.com/schneidersteve/buckpal-rust
- Owner: schneidersteve
- License: agpl-3.0
- Created: 2022-11-19T15:55:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-29T15:35:51.000Z (about 1 year ago)
- Last Synced: 2025-05-29T15:59:25.329Z (about 1 year ago)
- Topics: clean-architecture, dependency-injection, hexagonal-architecture, inversion-of-control, mockall, onion-architecture, rust, rust-analyzer, rust-async, salvo, sqlx
- Language: Rust
- Homepage:
- Size: 280 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rust Example Implementation of a Hexagonal/Onion/Clean Architecture
Inspired by https://github.com/thombergs/buckpal
- Kotlin Version: https://github.com/schneidersteve/buckpal-kotlin
- Dart Version: https://github.com/schneidersteve/buckpal-dart
## Tech Stack
* [Rust](https://www.rust-lang.org)
* [Rust Async](https://rust-lang.github.io/async-book/)
* [Mockall](https://github.com/asomers/mockall)
* [Salvo](https://salvo.rs)
* [openssl](https://docs.rs/openssl/latest/openssl/)
* [SQLx](https://github.com/launchbadge/sqlx)
* [rust-analyzer](https://rust-analyzer.github.io)
* [Visual Studio Code](https://code.visualstudio.com)
* [Visual Studio Code Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume)
## Layers and Dependency Inversion

## Send Money Use Case
```gherkin
Feature: Send Money
Scenario: Transaction succeeds
Given a source account
And a target account
When money is send
Then send money succeeds
And source account is locked
And source account withdrawal will succeed
And source account is released
And target account is locked
And target account deposit will succeed
And target account is released
And accounts have been updated
```
# Cargo Examples
> cargo clean
> cargo build
> cargo test
> cargo run
> cargo update
> cargo install cargo-watch
> cargo watch --clear -x "run"
> cargo watch --clear -x "test"
> cargo watch --clear -x "test -- --show-output"