This is an example on how to implement the Vertical Slice Architecture, plus a basic CQRS, using Rust language. It's a simplistic way to do it, only to provide a little directions on how you can do it and use it as a template to start a web api project.
You can add an RUST_LOG=debug
before the command to see more informations about the tests
Running integration tests:
cargo test --package backend-api --test tests --all-features
Running unit tests:
cargo test --package backend-api --lib --all-features
RUST_LOG=debug cargo run
sea-orm-cli migrate generate name_of_migration
...and then move the migration to a specific DB type folder
The migrations are automatically runned by the application at startup but you can use:
DATABASE_URL={connection_string} sea-orm-cli migrate up
DATABASE_URL={connection_string} sea-orm-cli migrate down
sea-orm-cli generate entity -s public -u {connection_string} -o ./entity/src -v
- server side securities
- removing legacy headers
- adding security headers
- JSON parser
- architecture
- CQRS
- ORM
- RESTful
- Logging -> Events, warnings, errors
- authentication
- login
- validate jwt
- refresh token
- users
- Create
- Read
- Update
- Delete
- gallery
- Create
- Read
- Update
- Delete
- Ordering
- photos
- Create
- Read
- Update
- Delete
- Ordering
- Docker
- Better custom errors
- Better error handling
- Middlewares (Error handling, Auth, Validations...)
- Separate C/Q validations from C/Q Handlers
- Documentation
- Try GraphQL
- Try some events
- Try some crosscutting (MQ, Storage, Functions...)
- Try scheduled tasks and recurrent jobs
- Try some cache (noSQL, Redis or something)