Skip to content

Commit

Permalink
fix: update architecture section on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
snamiki1212 committed Jun 13, 2023
1 parent 504aac9 commit fd7bc0e
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,35 @@ $ APIURL=http://localhost:8080/api zsh e2e/run-api-tests.sh

## Architecture

TODO:

- Clean Architecture
- drivers
- adapters
- domains
- entities
- usecases

### Flow from Request to Response
- DI container using Constructor Injection with dynamic dispatch (`/src/di.rs`)

```mermaid
sequenceDiagram
actor Client
participant Middleware as Middleware<br>/middleware/*
participant Controller as Controller<br>/[feature]/api.rs
participant Service as Service<br>/[feature]/service.rs
autonumber
participant Route as Middleware + Route <br><br>/src/app/drivers/{middlewares, routes}
participant Controller as Controller<br><br>/src/app/features/[feature]/controllers.rs
participant Presenter as Presenter<br><br>/src/app/features/[feature]/presenters.rs
participant Usecase as Usecase<br><br>/src/app/features/[feature]/usecases.rs
participant Repository as Repository<br><br>/src/app/features/[feature]/repositories.rs
participant Entity as Entity<br><br>/src/app/features/[feature]/entities.rs
participant DB
Client ->> Middleware: request
Middleware ->> Controller: -
Controller ->> Controller: Assign to Request Object<br>(/[feature]/request.rs)
Controller ->> Service: -
Service ->> DB: -
DB ->> Service: -
Service ->> Controller: -
Controller ->> Controller: Convert into Response Object<br>(/[feature]/response.rs)
Controller ->> Client: response
%% left to right
Client -->> Route: Request
Route ->> Controller: <br>
Controller ->> Usecase: <br>
Usecase ->> Repository: <br>
Repository ->> Entity: <br>
Entity ->> DB: <br>
%% right to left
DB ->> Entity: <br>
Entity ->> Repository: <br>
Repository ->> Usecase: <br>
Usecase ->> Presenter: <br>
Presenter -->> Client: Response
```

## LICENSE
Expand Down

0 comments on commit fd7bc0e

Please sign in to comment.