Coder Social home page Coder Social logo

katayama8000 / axum-ddd-rust Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 151 KB

Home Page: https://zenn.dev/doctormate/articles/rust-ddd-7353b79179

Dockerfile 0.33% Rust 94.26% Markdown 1.19% SQL 2.71% Makefile 0.65% YAML 0.80% Shell 0.06%
api-rest axum ddd-architecture rust

axum-ddd-rust's Introduction

This is a Management Circle App for University

Stack

  • Rust
  • axum
  • tokio
  • Docker

Design Pattern

  • Domain Driven Design

How to run

You need to run the devcontainer first.

Then you can run the following command to start the server.

cargo run

or you can run the following command to start the server with watch mode.

./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}

axum-ddd-rust's People

Contributors

katayama8000 avatar dependabot[bot] avatar bouzuya avatar

Stargazers

zhaochong avatar Suhut avatar  avatar  avatar Balogun Malik O avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

bouzuya

axum-ddd-rust's Issues

Question: Read from mysql database

Hi guys,

really enjoyed this projects still learning....with a few questions:
i connected to the mysql db locally (not using docker) and added the database, tables and rows.
When i want to get the first row of the circle it is telling me: circle not found -> expected was circle 101.

When i created a new circle it is successfully created and i can get the responding data back and when i ask for the newly created row
i also get the data back.
But looking in my local mysql database i actually dont see the newly added row i only see the circle rows with id: 101, 102
which i expecting to see and the newly inserted row.... am i missing something here ???

Greetz,
Dewinder

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.