Skip to content

Commit 3005a24

Browse files
committed
fix: solve diagram workflow run setup
1 parent 6aacf29 commit 3005a24

3 files changed

Lines changed: 280 additions & 7 deletions

File tree

README.md

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,46 @@ graph TB
260260
DashStats[Statistics Service]
261261
end
262262
263+
subgraph "Players Module"
264+
PlayersController[Players Controller]
265+
PlayerModel[Player Model]
266+
ChampionPoolModel[Champion Pool Model]
267+
end
268+
269+
subgraph "Scouting Module"
270+
ScoutingController[Scouting Controller]
271+
ScoutingTargetModel[Scouting Target Model]
272+
Watchlist[Watchlist Service]
273+
end
274+
263275
subgraph "Analytics Module"
264276
AnalyticsController[Analytics Controller]
265277
PerformanceService[Performance Service]
266278
KDAService[KDA Trend Service]
267279
end
268280
281+
subgraph "Matches Module"
282+
MatchesController[Matches Controller]
283+
MatchModel[Match Model]
284+
PlayerMatchStatModel[Player Match Stat Model]
285+
end
286+
287+
subgraph "Schedules Module"
288+
SchedulesController[Schedules Controller]
289+
ScheduleModel[Schedule Model]
290+
end
291+
292+
subgraph "VOD Reviews Module"
293+
VODController[VOD Reviews Controller]
294+
VodReviewModel[VOD Review Model]
295+
VodTimestampModel[VOD Timestamp Model]
296+
end
297+
298+
subgraph "Team Goals Module"
299+
GoalsController[Team Goals Controller]
300+
TeamGoalModel[Team Goal Model]
301+
end
302+
269303
subgraph "Riot Integration Module"
270304
RiotService[Riot API Service]
271305
RiotSync[Sync Service]
@@ -283,6 +317,20 @@ graph TB
283317
OpponentTeamsController[Opponent Teams Controller]
284318
ScrimAnalytics[Scrim Analytics Service]
285319
end
320+
321+
subgraph "Strategy Module"
322+
DraftPlansController[Draft Plans Controller]
323+
TacticalBoardsController[Tactical Boards Controller]
324+
DraftAnalysisService[Draft Analysis Service]
325+
end
326+
327+
subgraph "Support Module"
328+
SupportTicketsController[Support Tickets Controller]
329+
SupportFaqsController[Support FAQs Controller]
330+
SupportStaffController[Support Staff Controller]
331+
SupportTicketModel[Support Ticket Model]
332+
SupportFaqModel[Support FAQ Model]
333+
end
286334
end
287335
288336
subgraph "Data Layer"
@@ -305,25 +353,50 @@ graph TB
305353
RateLimit --> Auth
306354
Auth --> Router
307355
308-
Router --> AnalyticsController
356+
Router --> GoalsController
309357
Router --> CompetitiveController
310358
Router --> ProMatchesController
311359
Router --> ScrimsController
312360
Router --> OpponentTeamsController
361+
Router --> DraftPlansController
362+
Router --> TacticalBoardsController
363+
Router --> SupportTicketsController
364+
Router --> SupportFaqsController
365+
Router --> SupportStaffController
313366
AuthController --> JWTService
314367
AuthController --> UserModel
368+
PlayersController --> PlayerModel
369+
PlayerModel --> ChampionPoolModel
370+
ScoutingController --> ScoutingTargetModel
371+
ScoutingController --> Watchlist
372+
Watchlist --> PostgreSQL
373+
MatchesController --> MatchModel
374+
MatchModel --> PlayerMatchStatModel
375+
SchedulesController --> ScheduleModel
376+
VODController --> VodReviewModel
377+
VodReviewModel --> VodTimestampModel
378+
GoalsController --> TeamGoalModel
315379
AnalyticsController --> PerformanceService
316380
AnalyticsController --> KDAService
317381
CompetitiveController --> PandaScoreService
318382
CompetitiveController --> DraftAnalyzer
319383
ScrimsController --> ScrimAnalytics
320384
ScrimAnalytics --> PostgreSQL
385+
DraftPlansController --> DraftAnalysisService
386+
SupportTicketsController --> SupportTicketModel
387+
SupportFaqsController --> SupportFaqModel
388+
SupportStaffController --> UserModel
321389
AuditLogModel[AuditLog Model] --> PostgreSQL
390+
CompetitiveMatchModel[CompetitiveMatch Model] --> PostgreSQL
322391
CurrentModel[Current Model] --> PostgreSQL
392+
FantasyWaitlistModel[FantasyWaitlist Model] --> PostgreSQL
393+
MessageModel[Message Model] --> PostgreSQL
394+
NotificationModel[Notification Model] --> PostgreSQL
323395
OrganizationModel[Organization Model] --> PostgreSQL
324396
PasswordResetTokenModel[PasswordResetToken Model] --> PostgreSQL
397+
SavedBuildModel[SavedBuild Model] --> PostgreSQL
398+
ScoutingWatchlistModel[ScoutingWatchlist Model] --> PostgreSQL
325399
TokenBlacklistModel[TokenBlacklist Model] --> PostgreSQL
326-
UserModel[User Model] --> PostgreSQL
327400
JWTService --> Redis
328401
DashStats --> Redis
329402
PerformanceService --> Redis

diagram.mmd

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
graph TB
2+
subgraph "Client Layer"
3+
Client[Frontend Application]
4+
end
5+
6+
subgraph "API Gateway"
7+
Router[Rails Router]
8+
CORS[CORS Middleware]
9+
RateLimit[Rate Limiting]
10+
Auth[Authentication Middleware]
11+
end
12+
13+
subgraph "Application Layer - Modular Monolith"
14+
subgraph "Authentication Module"
15+
AuthController[Auth Controller]
16+
JWTService[JWT Service]
17+
UserModel[User Model]
18+
end
19+
20+
subgraph "Dashboard Module"
21+
DashboardController[Dashboard Controller]
22+
DashStats[Statistics Service]
23+
end
24+
25+
subgraph "Players Module"
26+
PlayersController[Players Controller]
27+
PlayerModel[Player Model]
28+
ChampionPoolModel[Champion Pool Model]
29+
end
30+
31+
subgraph "Scouting Module"
32+
ScoutingController[Scouting Controller]
33+
ScoutingTargetModel[Scouting Target Model]
34+
Watchlist[Watchlist Service]
35+
end
36+
37+
subgraph "Analytics Module"
38+
AnalyticsController[Analytics Controller]
39+
PerformanceService[Performance Service]
40+
KDAService[KDA Trend Service]
41+
end
42+
43+
subgraph "Matches Module"
44+
MatchesController[Matches Controller]
45+
MatchModel[Match Model]
46+
PlayerMatchStatModel[Player Match Stat Model]
47+
end
48+
49+
subgraph "Schedules Module"
50+
SchedulesController[Schedules Controller]
51+
ScheduleModel[Schedule Model]
52+
end
53+
54+
subgraph "VOD Reviews Module"
55+
VODController[VOD Reviews Controller]
56+
VodReviewModel[VOD Review Model]
57+
VodTimestampModel[VOD Timestamp Model]
58+
end
59+
60+
subgraph "Team Goals Module"
61+
GoalsController[Team Goals Controller]
62+
TeamGoalModel[Team Goal Model]
63+
end
64+
65+
subgraph "Riot Integration Module"
66+
RiotService[Riot API Service]
67+
RiotSync[Sync Service]
68+
end
69+
70+
subgraph "Competitive Module"
71+
CompetitiveController[Competitive Controller]
72+
ProMatchesController[Pro Matches Controller]
73+
PandaScoreService[PandaScore Service]
74+
DraftAnalyzer[Draft Analyzer]
75+
end
76+
77+
subgraph "Scrims Module"
78+
ScrimsController[Scrims Controller]
79+
OpponentTeamsController[Opponent Teams Controller]
80+
ScrimAnalytics[Scrim Analytics Service]
81+
end
82+
83+
subgraph "Strategy Module"
84+
DraftPlansController[Draft Plans Controller]
85+
TacticalBoardsController[Tactical Boards Controller]
86+
DraftAnalysisService[Draft Analysis Service]
87+
end
88+
89+
subgraph "Support Module"
90+
SupportTicketsController[Support Tickets Controller]
91+
SupportFaqsController[Support FAQs Controller]
92+
SupportStaffController[Support Staff Controller]
93+
SupportTicketModel[Support Ticket Model]
94+
SupportFaqModel[Support FAQ Model]
95+
end
96+
end
97+
98+
subgraph "Data Layer"
99+
PostgreSQL[(PostgreSQL Database)]
100+
Redis[(Redis Cache)]
101+
end
102+
103+
subgraph "Background Jobs"
104+
Sidekiq[Sidekiq Workers]
105+
JobQueue[Job Queue]
106+
end
107+
108+
subgraph "External Services"
109+
RiotAPI[Riot Games API]
110+
PandaScoreAPI[PandaScore API]
111+
end
112+
113+
Client -->|HTTP/JSON| CORS
114+
CORS --> RateLimit
115+
RateLimit --> Auth
116+
Auth --> Router
117+
118+
Router --> GoalsController
119+
Router --> CompetitiveController
120+
Router --> ProMatchesController
121+
Router --> ScrimsController
122+
Router --> OpponentTeamsController
123+
Router --> DraftPlansController
124+
Router --> TacticalBoardsController
125+
Router --> SupportTicketsController
126+
Router --> SupportFaqsController
127+
Router --> SupportStaffController
128+
AuthController --> JWTService
129+
AuthController --> UserModel
130+
PlayersController --> PlayerModel
131+
PlayerModel --> ChampionPoolModel
132+
ScoutingController --> ScoutingTargetModel
133+
ScoutingController --> Watchlist
134+
Watchlist --> PostgreSQL
135+
MatchesController --> MatchModel
136+
MatchModel --> PlayerMatchStatModel
137+
SchedulesController --> ScheduleModel
138+
VODController --> VodReviewModel
139+
VodReviewModel --> VodTimestampModel
140+
GoalsController --> TeamGoalModel
141+
AnalyticsController --> PerformanceService
142+
AnalyticsController --> KDAService
143+
CompetitiveController --> PandaScoreService
144+
CompetitiveController --> DraftAnalyzer
145+
ScrimsController --> ScrimAnalytics
146+
ScrimAnalytics --> PostgreSQL
147+
DraftPlansController --> DraftAnalysisService
148+
SupportTicketsController --> SupportTicketModel
149+
SupportFaqsController --> SupportFaqModel
150+
SupportStaffController --> UserModel
151+
AuditLogModel[AuditLog Model] --> PostgreSQL
152+
CompetitiveMatchModel[CompetitiveMatch Model] --> PostgreSQL
153+
CurrentModel[Current Model] --> PostgreSQL
154+
FantasyWaitlistModel[FantasyWaitlist Model] --> PostgreSQL
155+
MessageModel[Message Model] --> PostgreSQL
156+
NotificationModel[Notification Model] --> PostgreSQL
157+
OrganizationModel[Organization Model] --> PostgreSQL
158+
PasswordResetTokenModel[PasswordResetToken Model] --> PostgreSQL
159+
SavedBuildModel[SavedBuild Model] --> PostgreSQL
160+
ScoutingWatchlistModel[ScoutingWatchlist Model] --> PostgreSQL
161+
TokenBlacklistModel[TokenBlacklist Model] --> PostgreSQL
162+
JWTService --> Redis
163+
DashStats --> Redis
164+
PerformanceService --> Redis
165+
PlayersController --> RiotService
166+
MatchesController --> RiotService
167+
ScoutingController --> RiotService
168+
RiotService --> RiotSync
169+
RiotService --> RiotAPI
170+
171+
RiotService --> Sidekiq
172+
PandaScoreService --> PandaScoreAPI[PandaScore API]
173+
Sidekiq -- Uses --> Redis
174+
175+
style Client fill:#e1f5ff
176+
style PostgreSQL fill:#336791
177+
style Redis fill:#d82c20
178+
style RiotAPI fill:#eb0029
179+
style PandaScoreAPI fill:#ff6b35
180+
style Sidekiq fill:#b1003e

scripts/update_architecture_diagram.rb

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,25 @@ def discover_modules
3939
end
4040

4141
def discover_models
42+
models = []
43+
44+
# Discover models in app/models
4245
models_path = RAILS_ROOT.join('app', 'models')
43-
return [] unless models_path.exist?
46+
if models_path.exist?
47+
models += Dir.glob(models_path.join('*.rb')).map do |file|
48+
File.basename(file, '.rb')
49+
end
50+
end
4451

45-
Dir.glob(models_path.join('*.rb')).map do |file|
46-
File.basename(file, '.rb')
47-
end.reject { |m| m == 'application_record' }.sort
52+
# Discover models in app/modules/*/models
53+
modules_path = RAILS_ROOT.join('app', 'modules')
54+
if modules_path.exist?
55+
models += Dir.glob(modules_path.join('*', 'models', '*.rb')).map do |file|
56+
File.basename(file, '.rb')
57+
end
58+
end
59+
60+
models.reject { |m| m == 'application_record' }.uniq.sort
4861
end
4962

5063
def discover_controllers
@@ -449,7 +462,14 @@ def module_data_connections
449462
end
450463

451464
def database_model_connections
452-
@models.map do |model|
465+
# Models already defined in subgraphs should not be redefined
466+
models_in_modules = %w[
467+
user player champion_pool scouting_target match player_match_stat
468+
schedule vod_review vod_timestamp team_goal support_ticket support_faq
469+
draft_plan tactical_board scrim opponent_team support_ticket_message
470+
]
471+
472+
@models.reject { |model| models_in_modules.include?(model) }.map do |model|
453473
model_name = model.split('_').map(&:capitalize).join
454474
" #{model_name}Model[#{model_name} Model] --> PostgreSQL"
455475
end

0 commit comments

Comments
 (0)