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
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
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
190
Road to RubyKaigi: Play Hard(ware)
makicamel
1
380
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
0
400
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
240
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
210
Running Swift without an OS
kishikawakatsumi
0
850
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
210
Angular Signal Forms
debug_mode
0
110
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
170
Agentic Elixir
whatyouhide
0
380
NakouPAY説明用
annouim0
0
250
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
450
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
900
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
110
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
540
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
110
The Cult of Friendly URLs
andyhume
79
6.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
How to train your dragon (web standard)
notwaldorf
97
6.6k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
890
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
380
Build your cross-platform service in a week with App Engine
jlugia
234
18k
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で組み合わせ