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! 😁
- Rust (Minimum Supported Rust Version: 1.65.0)
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
- The API documentation is available at
{HOST}:{PORT}/docs/swagger/
(default: http://localhost:8080/docs/swagger/) - The OpenAPI specification is available at
{HOST}:{PORT}/docs/openapi.json
(default: http://localhost:8080/docs/openapi.json)
Rename the .env.example
file to .env
and change the values to your needs. Empty default means that the variable is required.
Name | Description | Default |
---|---|---|
DATABASE_URL |
The database url | sqlite://db.sqlite3 |
SECRET_KEY |
The secret key for JWT | |
HOST |
The host to bind | localhost |
PORT |
The port to run the server | 8080 |
RATE_LIMIT_BURST_SIZE |
The burst size for rate limiter | 30 |
RATE_LIMIT_PER_SECOND |
The time to reset the burst | 60 |
API_CONTACT_NAME |
The name of the API contact | |
API_CONTACT_URL |
The url of the API contact | |
API_CONTACT_EMAIL |
The email of the API contact | |
API_TITLE |
The title of the API | RESTful Todo API documentation |
just tests
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 APIjust ci
to run the CIjust fmt
to format everythingjust fmt-check
to check the format of everythingjust linter
to run Rust linter (clippy)just tests
to run the tests
- Swagger UI for API documentation
- Rate limiting
- CI with Github Actions
- Unit tests
- Dockerize the server
- JustFile for easy setup, useing just
This project is licensed under the MIT License - see the LICENSE file for details