Skip to content

create a simple project of create product following Clean Code (Hexagonal) with Actix-web

Notifications You must be signed in to change notification settings

edgardespinoza/rust_clean_code_product

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Architecture hexagonal - Clean Code

vertical slicing and screaming

├── app
│   └── src
│       ├── application
│       │   ├── add_product.rs
│       │   ├── openapi.rs
│       │   └── router.rs
│       ├── domain
│       │   ├── model
│       │   │   ├── product.rs
│       │   │   └── value_object.rs
│       │   ├── repository.rs
│       │   └── use_case
│       │       └── add_product.rs
│       ├── infrastructure
│       │   ├── model.rs
│       │   └── postgres_repository.rs
│       ├── lib.rs
│       ├── main.rs
│       └── state.rs
├── config
│   └── src
│       └── lib.rs
├── error
│   └── src
│       └── lib.rs
└── sql
    └── database.sql

try use this

  1. change la variable in the file .env DATABASE_URL
  2. cargo run
  3. use the curl command
    curl -i -X 'POST' \
    'http://127.0.0.1:8080/api/product' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
        "name": "product_1",
        "price": 2.0,
        "stock": 3}'
    

About

create a simple project of create product following Clean Code (Hexagonal) with Actix-web

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages