Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade/clean arch #21

Merged
merged 59 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
5b1cc5b
refactor: move routes
snamiki1212 Jun 11, 2023
82ce3d7
refactor: move middlewares to drivers
snamiki1212 Jun 11, 2023
5f01bbc
refactor: move profile modules to v2
snamiki1212 Jun 11, 2023
b7cfc2a
refactor: add profile-repository tmp
snamiki1212 Jun 11, 2023
89003be
refactor: add profile repo/usecase/presenter
snamiki1212 Jun 11, 2023
e73d4ea
refactor: remove unused modules
snamiki1212 Jun 11, 2023
973303a
refactor: update follow on profile features
snamiki1212 Jun 11, 2023
24c119a
fix: update profile_usecase
snamiki1212 Jun 11, 2023
f3e0295
refactor: update unfollow on profile
snamiki1212 Jun 11, 2023
026ca7a
feat: create di container
snamiki1212 Jun 11, 2023
932d126
fix: replace with di-container
snamiki1212 Jun 11, 2023
c398021
refactor: update presenter
snamiki1212 Jun 11, 2023
7be6f4c
refactor: organize dir on profile
snamiki1212 Jun 11, 2023
3176080
refactor: organize user/profile dir
snamiki1212 Jun 11, 2023
b9e8648
refactor: move user to v2
snamiki1212 Jun 11, 2023
432b299
refactor: follow clean-arch for signin on user
snamiki1212 Jun 11, 2023
8115124
refactor: follow clean-arch for signup on user
snamiki1212 Jun 11, 2023
eb005ee
refactor: follow clean-arch for me on user
snamiki1212 Jun 11, 2023
6f72830
refactor: follow clean-arch for user-update on user
snamiki1212 Jun 11, 2023
3100613
refactor: move favorite to v2
snamiki1212 Jun 11, 2023
5d74c2a
refactor: follow clean-arch for favorite
snamiki1212 Jun 11, 2023
0e7edfc
refactor: update controllers res way
snamiki1212 Jun 11, 2023
496d0c5
refactor: update unfavorite
snamiki1212 Jun 11, 2023
b614941
refactor: update healthcheck
snamiki1212 Jun 11, 2023
b7de226
refactor: update follow
snamiki1212 Jun 11, 2023
85c1ffb
refactor: update tag feature
snamiki1212 Jun 11, 2023
ccf1a7f
refactor: update tag list
snamiki1212 Jun 11, 2023
46c0e90
refactor: update article feature
snamiki1212 Jun 11, 2023
de4e1e9
refactor: update article list
snamiki1212 Jun 11, 2023
4a0db63
refactor: update article show feature
snamiki1212 Jun 11, 2023
9035584
refactor: update create-article feature
snamiki1212 Jun 12, 2023
4c9f12f
refactor: update delete article feature
snamiki1212 Jun 12, 2023
e33a238
refactor: update update-article feature
snamiki1212 Jun 12, 2023
ef30553
refactor: remove create-tag-list on services
snamiki1212 Jun 12, 2023
ac559e0
refactor: remove fetch-articles-by-slug on service
snamiki1212 Jun 12, 2023
b546752
refactor: remove fetch-article on service
snamiki1212 Jun 12, 2023
2d3163b
refactor: remove services
snamiki1212 Jun 12, 2023
b407a03
refactor: move service fn to repo
snamiki1212 Jun 12, 2023
4bec1f4
refactor: remove article service
snamiki1212 Jun 12, 2023
9c4880f
refactor: move comment to clean-arch
snamiki1212 Jun 12, 2023
202df62
refactor: move comment to clean-arch
snamiki1212 Jun 12, 2023
fc6cc46
refactor: update comment delete feature
snamiki1212 Jun 12, 2023
f589a66
refactor: update comment list feature
snamiki1212 Jun 12, 2023
c48639b
refactor: remove comment service
snamiki1212 Jun 12, 2023
af60251
refactor: remove profile service
snamiki1212 Jun 12, 2023
744ad88
fix: implement dyn constructor-injection on user repo
snamiki1212 Jun 13, 2023
20ed3a1
fix: implement dyn constructor-injection on profile repo
snamiki1212 Jun 13, 2023
d265c7f
fix: implement dyn constructor-injection on favorite repo
snamiki1212 Jun 13, 2023
64c2649
fix: implement dyn constructor-injection on article repo
snamiki1212 Jun 13, 2023
1a0bf25
fix: implement dyn constructor-injection on tag repo
snamiki1212 Jun 13, 2023
034a066
fix: implement dyn constructor-injection on comment repo
snamiki1212 Jun 13, 2023
6b64242
fix: implement dyn constructor-injection on user presenter
snamiki1212 Jun 13, 2023
a76dbaa
fix: implement dyn constructor-injection on profile presenter
snamiki1212 Jun 13, 2023
8aa5429
fix: implement dyn constructor-injection on favorite presenter
snamiki1212 Jun 13, 2023
332738e
fix: implement dyn constructor-injection on article presenter
snamiki1212 Jun 13, 2023
16b6b49
fix: implement dyn constructor-injection on tag presenter
snamiki1212 Jun 13, 2023
051dc7b
fix: implement dyn constructor-injection on comment presenter
snamiki1212 Jun 13, 2023
504aac9
refactor: rename appv2 to app
snamiki1212 Jun 13, 2023
fd7bc0e
fix: update architecture section on readme
snamiki1212 Jun 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,35 @@ $ APIURL=http://localhost:8080/api zsh e2e/run-api-tests.sh

## Architecture

### Flow from Request to Response
- Clean Architecture
- 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
153 changes: 0 additions & 153 deletions src/app/article/api.rs

This file was deleted.

5 changes: 0 additions & 5 deletions src/app/article/mod.rs

This file was deleted.

Loading
Loading