Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
フロントエンドのディレクトリ設計思想
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
teppeita
October 16, 2023
Programming
37k
26
Share
フロントエンドのディレクトリ設計思想
teppeita
October 16, 2023
More Decks by teppeita
See All by teppeita
React Nativeで運用しているアプリにExpoを導入する - 計画編 -
teppeita
0
210
GraphQLの社内ドキュメントを作った話
teppeita
0
330
Other Decks in Programming
See All in Programming
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
430
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
490
Ruby and LLM Ecosystem 2nd
koic
1
1.5k
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
690
20260320登壇資料
pharct
0
160
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
210
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
290
AI Assistants for YourAngular Solutions @Angular Graz, March 2026
manfredsteyer
PRO
0
150
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
140
iOS機能開発のAI環境と起きた変化
ryunakayama
0
140
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
130
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
170
GraphQLとの向き合い方2022年版
quramy
50
14k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
880
Technical Leadership for Architectural Decision Making
baasie
3
310
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
470
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
110
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
GitHub's CSS Performance
jonrohan
1032
470k
How to Talk to Developers About Accessibility
jct
2
170
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Transcript
フロントエンドのディレクトリ設計思想 2023-10-11 ハッカー鮨 竹尾哲平(@_teppeita)
自己紹介 Index 1 ディレクトリについて 2 設計思想 3 マイベストの方針 4 まとめ
5
竹尾 哲平(@_teppeita) takeo teppei フロントエンドエンジニア デザインシステムとGraphQLに関心が有ります。 画像 自己紹介
ディレクトリ構成 どうしていますか? 画像 https://tabelog.com/tokyo/A1302/A130204/13018162/
ディレクトリ構成 どう考えるのが良いと思いますか? 画像 https://tabelog.com/tokyo/A1302/A130204/13018162/
どれを選びますか? フロントエンド界隈を見ると 世の中にはいろんなパターンが出回っています Atomic Design Features Directory App Directory Clean
Architecture Container / Presenter
アーキテクチャ全般の話から考えてみましょう 概念的な話として 設計思想:どう分けるか
どう分けるか、を キャッチーに命名 Layer型 Feature型
MVCとかも分類できますが、割愛します 先ほどあげた よくあるパターンを分類 Layer型 Feature型 Atomic Design Features Directory App
Directory Clean Architecture Container / Presenter (Micro Frontends)
よくあるパターンの導入理由や失敗事例を見ると分かりやすいです 分類ごとの Pros / Cons Layer型 Feature型 Pros ・処理の共通化がしや すい
Cons ・階層分けが難しい ・依存の管理が難しい Pros ・ドメインごとに疎結合 & 高凝集にできる Cons ・境界の定義が難しい ・処理の重複が発生
少し視点を変えて
Layer型・Feature型と似てますね 組織で考えてみると 機能別組織と事業部制組織が有ります
つまり、組み合わせて構成する 組織の場合 組織の構造は、ハイブリッドに帰結する 「共通の事業目的を持つすべての大組織は、最後にはハイブリッド組織形態に落ち着くことになる」 アンドリュー・S・グローブ. 『ハイアウトプットマネジメント』 .日経BP.2017
コンウェイの法則に従えば、 システムもハイブリッドが良い? →組み合わせ方を考える。
先ほどの Pros / Cons を再確認 Layer型 Feature型 Pros ・処理の共通化がしや すい
Cons ・階層分けが難しい ・依存の管理が難しい Pros ・ドメインごとに疎結合 & 高凝集にできる Cons ・境界の定義が難しい ・処理の重複が発生
どう組み合わせるか マイベストの方針 Layer型 Feature型 Pros ・処理の共通化がしや すい →Componentsに適用 Pros ・ドメインごとに疎結合・
高凝集にできる →Pagesに適用
Layer型を適用 Componentsディレクトリ Layer型 Pros ・処理の共通化がしや すい →Componentsに適用 ・デザインシステム構築中 ・Atomic Designをベースに議論して、独
自にカスタマイズした階層 (詳細話したいですが、今回は割愛) ・処理を共通化して複数箇所で扱いや すい
Feature型を適用 Pagesディレクトリ Feature型 Pros ・ドメインごとに疎結合・ 高凝集にできる →Pagesに適用 ・Next.jsのルーティングに合わせて機 能をまとめる ・App
Directoryに倣ってコロケーショ ン (pageExtensions optionを利用) ・境界の定義が明確で迷わない
※分かりやすさのために実際よりも簡略化しています マイベストの ディレクトリ全体像
まとめ ディレクトリ設計思想は 01 Layer型とFeature型 に分類できそう 02 2つの型の 組み合わせ を考える 03
マイベストでは componentsと pagesで組み合わせ