RESTful Todo API with Actix-web and SeaORM. Documented by swagger-ui

Overview

RESTful Todo

RESTful Todo API with Actix and SeaORM. Documented by swagger-ui

Prerequisites

Usage

Clone the repository and run the following commands:

cargo run

Just like that, you have a RESTful API running on your machine.

Documentation

Environment variables

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

Soon

  • Swagger UI for API documentation
  • Rate limiting
  • CI with Github Actions
  • Unit tests
  • Dockerize the server
  • Makefile for easy setup, useing cargo-make

License

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

You might also like...
Code template for a production Web Application using Axum: The AwesomeApp Blueprint for Professional Web Development.

AwesomeApp rust-web-app More info at: https://awesomeapp.dev/rust-web-app/ rust-web-app YouTube episodes: Episode 01 - Rust Web App - Course to Produc

A highly customizable, full scale web backend for web-rwkv, built on axum with websocket protocol.

web-rwkv-axum A axum web backend for web-rwkv, built on websocket. Supports BNF-constrained grammar, CFG sampling, etc., all streamed over network. St

A secure and efficient gateway for interacting with OpenAI's API, featuring load balancing, user request handling without individual API keys, and global access control.

OpenAI Hub OpenAI Hub is a comprehensive and robust tool designed to streamline and enhance your interaction with OpenAI's API. It features an innovat

Rust implementation of the `URLPattern` web API

urlpattern This crate implements the URLPattern web API in Rust. We aim to follow the specification as closely as possible. Contributing We appreciate

A pure Rust implementation of the Web Local Storage API, for use in non-browser contexts

Rust Web Local Storage API A Rust implementation of the Web LocalStorage API, for use in non-browser contexts About the Web Local Storage API MDN docs

An tiny web API for @QuarryProtocol

Warlock Warlock is a tiny web API layer around Quarry Protocol and has endpoints to deserialize Quarry accounts like quarries, miners, and rewarders t

REST API server that abstracts the need to write CRUD methods by exposing a standardized API to interact with a Postgres database
REST API server that abstracts the need to write CRUD methods by exposing a standardized API to interact with a Postgres database

Basiliq Exposing a Postgres database via a REST API that follows the JSON:API specs. All in all, a tasty API. What is Basiliq Quickstart Ready to use

A Google-like web search engine that provides the user with the most relevant websites in accordance to his/her query, using crawled and indexed textual data and PageRank.
A Google-like web search engine that provides the user with the most relevant websites in accordance to his/her query, using crawled and indexed textual data and PageRank.

Mini Google Course project for the Architecture of Computer Systems course. Overview: Architecture: We are working on multiple components of the web c

Ergonomic and modular web framework built with Tokio, Tower, and Hyper

axum axum is a web application framework that focuses on ergonomics and modularity. More information about this crate can be found in the crate docume

Comments
  • Tests of phase one

    Tests of phase one

    This tests of phase one endpoints #5. This PR cannot be merge before end #7 and #9. After #9 will reduce tests with one command, and after #7 fix this

    https://github.com/TheAwiteb/restful_todo/blob/f12103111860387d84539f55008755f02b9122a9/src/tests/register.rs#L21-L24

    opened by TheAwiteb 0
  • API Roadmap

    API Roadmap

    The API Roadmap.

    Phase 1

    Authentication

    • [X] Auth register. /api/auth/register POST
      • [ ] Test.
      • [X] Docs.
    • [X] Auth login. /api/auth/login POST
      • [ ] Test.
      • [X] Docs.
    • [X] Auth token revoke. /api/auth/revoke PATCH
      • [ ] Test.
      • [X] Docs.

    Phase 2

    Todos

    • [ ] Todo create /api/todos POST
      • [ ] Test.
      • [ ] Docs.
    • [ ] Todo get by id /api/todos/{id} GET
      • [ ] Test.
      • [ ] Docs.
    • [ ] Todo list (for user) (With skip and limit) /api/todos GET
      • [ ] Test.
      • [ ] Docs.
    • [ ] Todo delete by id /api/todos/{id} DELETE
      • [ ] Test.
      • [ ] Docs.

    Phase 3

    Utilities

    • [ ] Todo clear (Delete all) /api/todos DELETE
      • [ ] Test.
      • [ ] Docs.
    • [ ] Todo search by title /api/todos/search GET
      • [ ] Test.
      • [ ] Docs.
    • [ ] Sort todos (by dates and id) /api/todos/search GET
      • [ ] Test.
      • [ ] Docs.
    • [ ] Create sub todos /api/todos/{id}/sub POST
      • [ ] Test.
      • [ ] Docs.
    • [ ] List sub todos /api/todos/{id}/sub GET
      • [ ] Test.
      • [ ] Docs.
    • [ ] Delete all sub todos /api/todos/{id}/sub DELETE
      • [ ] Test.
      • [ ] Docs.
    • [ ] Delete sub todos by id /api/todos/{id}/sub/{sub_id} DELETE
      • [ ] Test.
      • [ ] Docs.

    Phase 4

    Tags

    • [ ] Todo tag create /api/tags POST
      • [ ] Test.
      • [ ] Docs.
    • [ ] Delete tag by id /api/tags/{id} DELETE
      • [ ] Test.
      • [ ] Docs.
    • [ ] Delete tag from todo /api/todos/{id}/tags/{tag_id} DELETE
      • [ ] Test.
      • [ ] Docs.
    • [ ] Add tag to todo /api/todos/{id}/tags/{tag_id} POST
      • [ ] Test.
      • [ ] Docs.
    • [ ] Rename tag /api/tags/{id} PATCH
      • [ ] Test.
      • [ ] Docs.
    • [ ] List all tags /api/tags GET
      • [ ] Test.
      • [ ] Docs.
    • [ ] List all tags for todo /api/todos/{id}/tags GET
      • [ ] Test.
      • [ ] Docs.
    • [ ] List all todos for tag /api/tags/{id}/todos GET
      • [ ] Test.
      • [ ] Docs.
    enhancement 
    opened by TheAwiteb 0
Owner
Awiteb
Some(Programmer { langs: vec!['🦀','🐍'] })
Awiteb
Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix 16.2k Jan 2, 2023
Implementation of the RealWorld backend API spec in Actix, Rust's powerful actor system and most fun web framework.

Actix codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API. ❗ (2021/05/13) This cod

Allen 475 Jan 2, 2023
An API project using Rust, Actix Web and JWT. *WIP*

Actix-web REST API with JWT (WIP) A simple CRUD backend app using Actix-web, Diesel and JWT Require Rust Stable Postgres Or using Docker How to run Ma

Akhil Sharma 4 Sep 21, 2023
A simple authentication flow using Rust and Actix-web, with a PostgreSQL database and a sveltekit frontend.

Rust-auth-example This repository aims to represent a simple authentication flow using Rust and Actix-web, with a PostgreSQL database and a sveltekit

Kival Mahadew 4 Feb 19, 2023
A newsletter with actix-web and sqlx-postgres

Newsletter backend Health check: production Pre-requisites You'll need to install: Rust Docker There are also some OS-specific requirements. Windows c

Nadeem Bhati 4 Dec 10, 2022
Web Application with using Rust(Actix, Diesel and etc)

Santa Service App Used technology stack Web Server with using Rust (Actix, Actix-web, Diesel) Data base (Postgres) Console Application (Tokio) Tasks o

null 3 Jan 8, 2023
A (flash) message framework for actix-web. A port to Rust of Django's message framework.

actix-web-flash-messages Flash messages for actix-web Web applications sometimes need to show a one-time notification to the user - e.g. an error mess

Luca Palmieri 31 Dec 29, 2022
TODO pass transform struct instead of trying to modify particles everywhere.

Sparticles RS TODO pass transform struct instead of trying to modify particles everywhere. Roadmap add animations. move particle away if on top of eac

Joris Willems 1 Aug 25, 2022
Sauron is an html web framework for building web-apps. It is heavily inspired by elm.

sauron Guide Sauron is an web framework for creating fast and interactive client side web application, as well as server-side rendering for back-end w

Jovansonlee Cesar 1.7k Dec 26, 2022
Hot reload static web server for deploying mutiple static web site with version control.

SPA-SERVER It is to provide a static web http server with cache and hot reload. 中文 README Feature Built with Hyper and Warp, fast and small! SSL with

null 7 Dec 18, 2022