A rust crud rest api poc using:
- axum
- diesel
- envconfig
- tracing
- postgres
Build using cargo build --release
.
Run using ./target/release/animals-api
.
Bring the postgres docker container up by docker-compose up -d database
.
Check Diesel documentation for installing the diesel cli
and libmq
.
For local development it makes sense to use cargo-watch
.
Get it using cargo install cargo-watch
and start the
application using cargo watch -x run
to enjoy file watching and reloading.
To add a new migration please use diesel migration generate <migration_name>
.
To run migrations manually use diesel migration run
.
To rollback migrations use diesel migration redo
.
The migrations are run automatically on application startup.
To build the docker image use docker build -t animals-api .
.
- CRUD requests
- Connect to a database
- Externalise configuration/properties
- Dockerise
- Logging/Tracing
- Global and local api error handling
- Add JWT security
- Release process
✓ Axum
✓ Diesel
✓ Tracing