katayama8000 / axum-ddd-rust

https://medium.com/@tattu.0310/building-an-api-server-with-rust-and-ddd-86a276890a36
13 stars 2 forks source link
api-rest axum ddd-architecture rust

Management Circle App for University

Tech Stack

Design Pattern

How to run

  1. First, start the database container. Refer to the docs for more details.
  2. Next, run the devcontainer.
  3. Finally, start the server with the following command:
cargo run

Alternatively, you can start the server in watch mode with:

./watch.sh

create

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
        "circle_name": "music club",
        "capacity": 10,
        "owner_name": "John Lennon",
        "owner_age": 21,
        "owner_grade": 3,
        "owner_major": "Music"
      }' \
  http://127.0.0.1:3000/circle

find

curl -X GET http://127.0.0.1:3000/circle/{circle_id}

update

curl -X PUT \
  -H "Content-Type: application/json" \
  -d '{
        "circle_name": "football club",
        "capacity": 15
      }' \
  http://127.0.0.1:3000/circle/{circle_id}