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

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

example codes for CIS198 https://cis198-2016s.github.io/
example codes for CIS198 https://cis198-2016s.github.io/

CIS198: RUST 编程语言 学习背景 rust 和 c/c++/Java/Python/golang 不太一样 rust 学习曲线比较陡峭 rust 有很多颠覆认知的特性: 所有权,生命周期,借用检测 cargo 工具 函数式+命令式支持 视频讲解见 B站 课程大纲 Timeline Lec

The example anchor implementation for solana-swap

anchor-liquidity-pool This is the example anchor implementation for solana-swap. The curve is always ConstantProduct in this implementation. The fee r

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

TodoX is a sophisticated Rust-based application designed to facilitate seamless todo management.

Rust Todo List App is a command-line tool written in Rust that allows users to manage their tasks efficiently. Whether you need to add, mark as done, edit, or clear tasks from your todo list, this app provides essential functionalities to streamline your task management process. Additionally, I have integrated sqlite3 using the rusqlite crate. The database stores the data and will persist indefinitely until you manually delete it.

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

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
Parks-McClellan Remez FIR design algorithm

pm-remez: Parks-McClellan Remez FIR design algorithm pm-remez is a modern Rust implementation of the Parks-McClellan Remez exchange algorithm. It can

Maia SDR 10 Apr 14, 2024
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
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
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