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
teppeita
October 16, 2023
Programming
26
36k
フロントエンドのディレクトリ設計思想
teppeita
October 16, 2023
Tweet
Share
More Decks by teppeita
See All by teppeita
React Nativeで運用しているアプリにExpoを導入する - 計画編 -
teppeita
0
170
GraphQLの社内ドキュメントを作った話
teppeita
0
300
Other Decks in Programming
See All in Programming
SUZURIの規約違反チェックにおけるクリエイタフィードバックの試⾏錯誤/Trial and Error in Creator Feedback for SUZURI's Terms of Service Violation Checks
ae14watanabe
1
150
ノーコードからの脱出 -地獄のデスロード- / Escape from Base44
keisuke69
0
730
JJUG CCC 2025 Fall: Virtual Thread Deep Dive
ternbusty
3
450
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
「10分以内に機能を消せる状態」 の実現のためにやっていること
togishima
1
510
PHPライセンス変更の議論を通じて学ぶOSSライセンスの基礎
matsuo_atsushi
0
160
Herb to ReActionView: A New Foundation for the View Layer @ San Francisco Ruby Conference 2025
marcoroth
0
120
Claude Code on the Web を超える!? Codex Cloud の実践テク5選
sunagaku
0
560
組織もソフトウェアも難しく考えない、もっとシンプルな考え方で設計する #phpconfuk
o0h
PRO
10
4.5k
Web エンジニアが JavaScript で AI Agent を作る / JSConf JP 2025 sponsor session
izumin5210
4
1.8k
What’s Fair is FAIR: A Decentralised Future for WordPress Distribution
rmccue
0
190
早すぎ?超先読み Go 1.26 Draft - Preview the contents of the Go 1.26 Draft Release Notes
tomtwinkle
0
320
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
980
Done Done
chrislema
186
16k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
Facilitating Awesome Meetings
lara
57
6.6k
Agile that works and the tools we love
rasmusluckow
331
21k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Bash Introduction
62gerente
615
210k
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で組み合わせ