A Domain Driven Design example application in Rust.

Overview

Rust Domain Driven Design Example

rust-ddd

Rust Domain-Driven-Design (DDD)

Summery

This repository is used to present how I find implementing DDD in Rust projects works out

Framework

Running

  1. Clone the repository locally
https://github.com/behrouz-rfa/rust-ddd.git
  1. Execute the bin/dotenv script to create a .env file or copy the contents of the .env.sample file into a new file with the name .env

  2. Run the Docker

docker compose up -d
  1. Install dependencies and execute the server
cargo run

Examples

  1. For insert or registration
curl --location --request POST 'localhost:8082/api/users/insert' \
--header 'Content-Type: application/json' \
--data-raw '{
"username":"behrouz.r.fa",
"email":"[email protected]'\''",
"password":"pass@123"
}'
  1. for login
curl --location --request POST 'localhost:8082/api/users/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email":"[email protected]'\''",
"password":"pass@123"
}'
  1. update user
curl --location --request PUT 'localhost:8082/api/user' \
--header 'Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzMzMTY3OTUsImlkIjoyOCwidXNlcm5hbWUiOiJ0ZXN0MTEyMjIifQ._N82DPNiw27gVdBFuEPv2Tps_TbUH6wXgq-wBIxUQfc' \
--header 'Content-Type: application/json' \
--data-raw '{
"email":"[email protected]'\''",
"username":"master@123",
"bio": "this test for bio"
}'

TODO

  • integration test
  • fix db pool
  • unit test
  • Better error handling
You might also like...
Complete code for the larger example programs from the book.

Code Examples for Programming Rust This repository contains complete code for the larger example programs from the book “Programming Rust”, by Jim Bla

A sample Rust application modeled after Spring PetClinic.

Rust PetClinic Sample Application A sample Rust application modeled after Spring PetClinic. Overview This application uses axum and SeaORM on the serv

A relatively simple puzzle generator application written in Rust and used via Javascript
A relatively simple puzzle generator application written in Rust and used via Javascript

Puzzlip Basic Overview This is a relatively simple puzzle generator application written in Rust and used via Javascript in https://puzzlip.com. If you

This experiment shows connecting wasm-bindgen generated code to a good-web-game application.

GWG + wasm-bindgen example This experiment shows connecting wasm-bindgen generated code to a good-web-game application. It uses simple_logger crate to

A tray application for Windows that gives you push notifications and instant downloads of new posts, messages and stories posted by models you subscribe to on Onlyfans.

OF-notifier A tray application for Windows that gives you push notifications and instant downloads of new posts, messages and stories posted by models

A mobile application platform for tertiary students to communicate, collaborate and share ideas with each other

Qreeket (pronounced "cricket") A mobile application platform for tertiary students to communicate, collaborate and share ideas with each other. As the

Leetcode Solutions in Rust, Advent of Code Solutions in Rust and more

RUST GYM Rust Solutions Leetcode Solutions in Rust AdventOfCode Solutions in Rust This project demostrates how to create Data Structures and to implem

Simple autoclicker written in Rust, to learn the Rust language.

RClicker is an autoclicker written in Rust, written to learn more about the Rust programming language. RClicker was was written by me to learn more ab

Rust programs written entirely in Rust

mustang Programs written entirely in Rust Mustang is a system for building programs built entirely in Rust, meaning they do not depend on any part of

Owner
Behrouz R.Farsi
Rust & Golang Developer
Behrouz R.Farsi
Elemental System Designs is an open source project to document system architecture design of popular apps and open source projects that we want to study

Elemental System Designs is an open source project to document system architecture design of popular apps and open source projects that we want to study

Jason Shin 9 Apr 10, 2022
ARM TrustZone-M example application in Rust, both secure world side and non-secure world side

ARM TrustZone-M example application in Rust, both secure world side and non-secure world side; projects are modified from generated result of cortex-m-quickstart.

null 44 Dec 4, 2022
Now, the Host is Mine! - Super Fast Sub-domain Takeover Detection!

NtH1M - Super Fast Sub-domain Takeover Detection Notice This is a sad notice that our Internet Hero (@TheBinitGhimire) had recent demise on 26th of Ju

Captain Nick Lucifer* 5 Nov 5, 2022
A domain-specific language for Infrastructure as Code

Skyr A domain-specific language for Infrastructure As Code, with a phased execution model, allowing for expressive and highly dynamic IaC solutions. D

Emil Broman 4 Mar 11, 2023
Domain modeling. Event sourcing. CQRS.

f(model) - Functional Domain Modeling with Rust Publicly available at crates.io and docs.rs When you’re developing an information system to automate t

Fraktalio 12 Oct 7, 2023
Rust library to facilitate event-driven programming.

Squeak Squeak is a zero-dependency Rust library to facilitate event-driven programming. Examples use squeak::{Delegate, Response}; let on_damage_rece

Antoine Gersant 58 Dec 31, 2022
Simple Event-Driven Microservice Architecture in Rust

Simple Event-Driven Microservice Architecture in Rust is an open-source project showcasing the simplicity and efficiency of building microservices in Rust. This minimalistic project demonstrates an e-commerce backend system, featuring just two microservices: Catalog and Order.

James Mallon 4 Dec 19, 2023
Um Web Scrapper para extrair as soluções dos exercícios do Driven HUB com seus respectivos enunciados

hub_scrapper Um Web Scrapper para extrair as soluções dos exercícios do Driven HUB com seus respectivos enunciados, convertendo-os para Markdown. ⚠️ A

Davi Feliciano 4 Oct 7, 2023
An example of a Kubernetes operator implemented in Rust

Rust Kubernetes operator example A Kubernetes operator built on top of kube-rs project. There is an explanatory article available. Steps to run on Lin

Pavel Pscheidl 91 Jan 1, 2023
Example (with solution) for the Rust Fundamentals Workshop

Workshop Repo: Rust Fundamentals NOTE: This is Work-In-Progress! Please check for updates a day before the workshop. This Github repository contains a

Stefan Baumgartner 5 Jan 31, 2023