Oxide Todo

February 17, 2023 ยท View on GitHub

Oxide Todo

Oxide Todo is RESTful API built with Actix and SeaORM. Documented by swagger-ui. Authenticated by JWT. Rate limited by actix_extensible_rate_limit. Tested by rstest. Have fun! ๐Ÿ˜

CI

Prerequisites

  • Rust (Minimum Supported Rust Version: 1.65.0)

Usage

Clone the repository and run the following commands:

cargo run

Just like that, you have a RESTful API running on your machine. If you want to see the logs, you can run the following command:

RUST_LOG=debug cargo run

Documentation

Environment variables

Rename the .env.example file to .env and change the values to your needs. Empty default means that the variable is required.

NameDescriptionDefault
DATABASE_URLThe database urlsqlite://db.sqlite3
SECRET_KEYThe secret key for JWT
HOSTThe host to bindlocalhost
PORTThe port to run the server8080
RATE_LIMIT_BURST_SIZEThe burst size for rate limiter30
RATE_LIMIT_PER_SECONDThe time to reset the burst60
API_CONTACT_NAMEThe name of the API contact
API_CONTACT_URLThe url of the API contact
API_CONTACT_EMAILThe email of the API contact
API_TITLEThe title of the APIRESTful Todo API documentation

Testing

Prerequisites

just tests

Development

For development you need to install just and dotenv-cli. With just you can run all needed commands with one command, type just folloing by the command you want to run.
Available commands:

  • just build to build the RESTful API
  • just ci to run the CI
  • just fmt to format everything
  • just fmt-check to check the format of everything
  • just linter to run Rust linter (clippy)
  • just tests to run the tests

Soon

  • Swagger UI for API documentation
  • Rate limiting
  • CI with Github Actions
  • Unit tests
  • Dockerize the server
  • JustFile for easy setup, useing just

License

This project is licensed under the MIT License - see the LICENSE file for details