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

アーキテクチャの図をmermaidに #591

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
186 changes: 0 additions & 186 deletions docs/architecture.drawio.svg

This file was deleted.

75 changes: 74 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# パッケージ構成
# アーキテクチャ

クリーンアーキテクチャを参考に構成

## パッケージ構成

```bash
.
├── bin # makeでコンパイルしたバイナリが入る
Expand Down Expand Up @@ -40,3 +42,74 @@
│ └── random # テストで用いる乱数生成パッケージ
└── main.go
```

## 依存関係

ユーザー周りに限って紹介

```mermaid
classDiagram
class User["domain.User"] {
ID uuid.UUID
Name string
realName string
Check bool
}

class IUS["usecases.service.UserService"] {
<<interface>>
GetUsers(...) ([]*domain.User, error)
...
}
class US["usecases.service.userService"] {
user repository.UserRepository
event repository.EventRepository
}

class IUR["usecases.repository.UserRepository"] {
<<interface>>
GetUsers(...) ([]*domain.User, error)
...
}

IUS --> User
IUR --> User
US --|> IUS
US --> IUR

class API["interfaces.handler.API"] {
Ping *PingHandler
User *UserHandler
...
}
class UH["interfaces.handler.UserHandler"] {
s service.UserService
}

API --> UH
UH --> IUS

class UR["infrastructure.repository.UserRepository"] {
h *gorm.DB
portal external.PortalAPI
traQ external.TraQAPI
}

class IPortalAPI["infrastructure.external.PortalAPI"] {
<<interface>>
...
}
class PortalAPI["infrastructure.external.portalAPI"]

class ITraQAPI["infrastructure.external.TraQAPI"] {
<<interface>>
...
}
class TraQAPI["infrastructure.external.traQAPI"]

UR --|> IUR
PortalAPI --|> IPortalAPI
TraQAPI --|> ITraQAPI
UR --> IPortalAPI
UR --> ITraQAPI
```
Loading