Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
458 commits
Select commit Hold shift + click to select a range
bb7938f
refactor
yuki-takei Sep 4, 2025
1d021ed
refactor
yuki-takei Sep 4, 2025
e6b8b69
refactor
yuki-takei Sep 4, 2025
c4bd2af
reorganize serena memories
yuki-takei Sep 4, 2025
5dd091f
bugfix for page title
yuki-takei Sep 4, 2025
23bba58
bugfix
yuki-takei Sep 4, 2025
7308c93
refactor redirectFrom
yuki-takei Sep 4, 2025
0a86350
bugfix
yuki-takei Sep 4, 2025
7ff18eb
refactor
yuki-takei Sep 5, 2025
57b1632
refactor
yuki-takei Sep 5, 2025
df32208
update serena memories for jotai migration
yuki-takei Sep 5, 2025
61c998c
migrate useSelectedGrant and usePageControlsX
yuki-takei Sep 5, 2025
2f92596
BugFix
yuki-takei Sep 5, 2025
da31fa4
update serena data
yuki-takei Sep 5, 2025
f31e1c0
clean code
yuki-takei Sep 5, 2025
06401cd
WIP: migrate hooks for modal
yuki-takei Sep 5, 2025
6798c01
clean code
yuki-takei Sep 5, 2025
6b9566c
update serena memories
yuki-takei Sep 5, 2025
642112d
clean code
yuki-takei Sep 5, 2025
15f6696
remove obsolete code and migrate correctly
yuki-takei Sep 5, 2025
81f3efb
WIP: migrate hooks for modal
yuki-takei Sep 5, 2025
3fd189e
bugfix
yuki-takei Sep 5, 2025
57d5367
WIP: migrate hooks for modal
yuki-takei Sep 5, 2025
9513615
refactor
yuki-takei Sep 5, 2025
46744d2
BugFix
yuki-takei Sep 5, 2025
7377613
WIP: migrate hooks for modal
yuki-takei Sep 5, 2025
f0faf19
update serena memories
yuki-takei Sep 5, 2025
5896a09
WIP: migrate hooks for modal
yuki-takei Sep 5, 2025
18b4585
WIP: migrate hooks for modal
yuki-takei Sep 5, 2025
9714e86
WIP: migrate hooks for modal
yuki-takei Sep 5, 2025
65b68d4
refactor modal components for performance
yuki-takei Sep 5, 2025
ec55e13
WIP: migrate hooks for modal
yuki-takei Sep 5, 2025
c181dc2
WIP: migrate hooks for modal
yuki-takei Sep 5, 2025
30e32a2
update serena memories
yuki-takei Sep 5, 2025
2010a0a
optimize custom hooks
yuki-takei Sep 8, 2025
7ee9653
optimize custom hook
yuki-takei Sep 8, 2025
39c921d
set `preloadAllLang: true`
yuki-takei Sep 8, 2025
1d72f66
fix test
yuki-takei Sep 8, 2025
94fb9f9
refactor
yuki-takei Sep 8, 2025
12f6129
refactor
yuki-takei Sep 9, 2025
511f6ae
refactor useIsNotCreatable
yuki-takei Sep 9, 2025
a961154
WIP: refactor isNotFound and isForbidden handling
yuki-takei Sep 10, 2025
5c2df44
Merge remote-tracking branch 'origin/master' into support/use-jotai
yuki-takei Sep 10, 2025
f86223b
improve custom axios module
yuki-takei Sep 10, 2025
c40f64a
improve types
yuki-takei Sep 10, 2025
9a26853
support not found and forbidden by metadata
yuki-takei Sep 10, 2025
5de835c
optimize SearchModal
yuki-takei Sep 11, 2025
8338490
optimize PageBulkExportSelectModal
yuki-takei Sep 11, 2025
9740342
clean code
yuki-takei Sep 11, 2025
0dae44b
optimize PageSelectModal
yuki-takei Sep 11, 2025
a328106
optimize TemplateModal
yuki-takei Sep 11, 2025
e8ba7e6
migrate states for PageStatusAlert
yuki-takei Sep 11, 2025
db7caae
optimize modals
yuki-takei Sep 11, 2025
555ce82
optimize UserGroupModal
yuki-takei Sep 11, 2025
aadce42
optimize TagEditModal
yuki-takei Sep 11, 2025
79200b0
optimize DrawioModal
yuki-takei Sep 11, 2025
929b4ac
optimize AiAssistantManagementModal
yuki-takei Sep 11, 2025
9ae0a77
update serena memories
yuki-takei Sep 11, 2025
5524796
migrate useDevice* hooks
yuki-takei Sep 11, 2025
c1ef74b
refactor useSidebarScrollerElem
yuki-takei Sep 11, 2025
f05a260
refactor toc
yuki-takei Sep 11, 2025
5de27d8
update serena memory
yuki-takei Sep 11, 2025
d020692
WIP: optimize PageDeleteModal
yuki-takei Sep 11, 2025
29e761e
optimize PageDeleteModal
yuki-takei Sep 11, 2025
4f73d94
migrate useIsUntitledPage
yuki-takei Sep 11, 2025
4b91d58
update serena memories
yuki-takei Sep 11, 2025
7d8cd65
Merge branch 'support/use-jotai-migration' into support/use-jotai
yuki-takei Sep 11, 2025
ed7bdff
deactivate addActivity line temporarily
yuki-takei Sep 11, 2025
7f3b609
refactor custom axios
yuki-takei Sep 11, 2025
1aeb80d
Merge remote-tracking branch 'origin/master' into support/use-jotai
yuki-takei Sep 11, 2025
362bd1c
BugFix
yuki-takei Sep 11, 2025
eba4d01
refactor useFetchCurrentPage
yuki-takei Sep 11, 2025
74f592f
refactor test for useFetchCurrentPage
yuki-takei Sep 11, 2025
d6e7424
Merge master into support/use-jotai
yuki-takei Sep 12, 2025
74117ae
Merge branch 'master' into support/use-jotai
yuki-takei Sep 24, 2025
41355d8
rename serena memory
yuki-takei Sep 24, 2025
b3c0a17
add serena memory for modal performance optimization
yuki-takei Sep 24, 2025
cd2f2bd
Merge branch 'master' into support/use-jotai
yuki-takei Sep 25, 2025
0bdb1a5
migrate usePageTreeDescCountMap
yuki-takei Sep 25, 2025
0f132f4
refactor useUnsavedWarning
yuki-takei Sep 25, 2025
cf28913
refactor hooks for page abilities
yuki-takei Sep 25, 2025
623dbcf
fix biome errors
yuki-takei Sep 25, 2025
3a85535
update serena memory
yuki-takei Sep 25, 2025
8c1f892
migrate rest context swr hooks
yuki-takei Sep 25, 2025
1c6ccf2
remove .local.json
yuki-takei Sep 25, 2025
70f3952
ignore .claude
yuki-takei Sep 25, 2025
9f1baa0
disable eslint 'space-before-function-paren'
yuki-takei Sep 25, 2025
eed9b8e
tidy up serena memories
yuki-takei Sep 25, 2025
85ac5a9
migrate editor package hooks
yuki-takei Sep 25, 2025
6cbc26a
migrate swr hooks for editor
yuki-takei Sep 25, 2025
b2e9e6a
tidy up editor states
yuki-takei Sep 25, 2025
4c6a114
update serena memory
yuki-takei Sep 26, 2025
b03c3f8
migrate useAcceptedUploadFileType
yuki-takei Sep 26, 2025
1de25d2
update biome organizeImports settings
yuki-takei Sep 26, 2025
879efd8
refactor search hooks and components
yuki-takei Sep 26, 2025
5996687
format
yuki-takei Sep 26, 2025
df1210f
migrate PluginDeleteModal and refactor
yuki-takei Sep 26, 2025
b7f47d7
refactor: migrate useEditingClients to new state management and updat…
yuki-takei Sep 26, 2025
1e5b0b8
refactor: migrate to new state management for AiAssistant components
yuki-takei Sep 26, 2025
d66d1ae
organize imports
yuki-takei Sep 26, 2025
2737ab3
format with biome
yuki-takei Sep 26, 2025
d66b150
update serena memory
yuki-takei Sep 26, 2025
7c30f8c
Merge remote-tracking branch 'origin/master' into support/use-jotai
yuki-takei Oct 2, 2025
319602a
refactor: consolidate editor hooks and add reserved next caret line m…
yuki-takei Oct 2, 2025
9567272
feat: implement Slack notification state management with custom hook
yuki-takei Oct 2, 2025
4c52ce9
update serena memory
yuki-takei Oct 2, 2025
7cd014c
fix PageEditor re-rendering problem
yuki-takei Oct 2, 2025
0caf402
clean useResolvedTheme
yuki-takei Oct 2, 2025
4605a66
pnpm dedupe
yuki-takei Oct 2, 2025
06fab41
refactor: replace useAiAssistantSidebar with useAiAssistantSidebarSta…
yuki-takei Oct 2, 2025
2ccf441
refactor: migrate from useKeywordManager to useSetSearchKeyword for i…
yuki-takei Oct 2, 2025
406bebd
fix PrivateLegacyPages searching
yuki-takei Oct 3, 2025
03f51a9
Merge remote-tracking branch 'origin/master' into support/use-jotai
yuki-takei Oct 6, 2025
4b2a636
fix import line
yuki-takei Oct 6, 2025
cf2922f
fix biome errors
yuki-takei Oct 6, 2025
cfc3240
bugfix
yuki-takei Oct 6, 2025
b0cf804
refactor yjs hooks
yuki-takei Oct 6, 2025
dfe3bd8
tidy up serena memories
yuki-takei Oct 6, 2025
fe71c1c
refactor: update maintenance mode hooks and restructure imports
yuki-takei Oct 6, 2025
b1986f2
update serena memories
yuki-takei Oct 6, 2025
9ff1fc5
refactor: implement WebSocket connection management in Playground
yuki-takei Oct 6, 2025
412e3b9
refactor: replace useAdminSocket import path and simplify socket usag…
yuki-takei Oct 6, 2025
dcd29d0
fix merge mistake for ElasticsearchManagement
yuki-takei Oct 6, 2025
3944d6e
Refactor WebSocket implementation: Replace useSWRStatic with Jotai-ba…
yuki-takei Oct 6, 2025
59e34bb
WIP: refactor SWR hooks for PersonalSettings
yuki-takei Oct 6, 2025
0ca9bdd
remove useSWRStatic
yuki-takei Oct 7, 2025
50606d3
remove memories
yuki-takei Oct 7, 2025
45f4f55
fix test
yuki-takei Oct 7, 2025
3de6953
add changesets
yuki-takei Oct 7, 2025
918c89c
Merge branch 'master' into support/use-jotai
yuki-takei Oct 7, 2025
4a6e0d4
format with biome
yuki-takei Oct 7, 2025
0fb4ce4
fix custom axios
yuki-takei Oct 7, 2025
2662826
add test for custom axios
yuki-takei Oct 7, 2025
0b97d67
Merge remote-tracking branch 'origin/master' into support/use-jotai
yuki-takei Oct 7, 2025
d634c49
fix biome errors
yuki-takei Oct 7, 2025
aadf89e
transplant findByIdAndViewer and add countByIdAndViewer
yuki-takei Oct 7, 2025
59ed1d3
BugFix
yuki-takei Oct 7, 2025
e55a529
WIP: bugfix for empty page
yuki-takei Oct 7, 2025
d62a64e
update forbidden atom always
yuki-takei Oct 8, 2025
4fda942
refactor findPageAndMetaDataByViewer
yuki-takei Oct 8, 2025
f852295
improve types for search
yuki-takei Oct 8, 2025
e2a4aa3
optimize PageCreateModal and PageRenameModal
yuki-takei Oct 8, 2025
8dd2ed2
refactor PageDuplicateModal
yuki-takei Oct 14, 2025
02e10e7
refactor PageRenameModal
yuki-takei Oct 14, 2025
e965aaf
refactor ConflictDiffModal
yuki-takei Oct 14, 2025
48de962
refactor LinkEditModal
yuki-takei Oct 14, 2025
80033e0
refactor PagePresentationModal
yuki-takei Oct 14, 2025
589f867
update serena memory
yuki-takei Oct 14, 2025
59e35e1
refactor some modals
yuki-takei Oct 14, 2025
2a89ba1
update serena memory
yuki-takei Oct 14, 2025
80dfe74
refactor some modals
yuki-takei Oct 14, 2025
3d89721
refactor some modals
yuki-takei Oct 14, 2025
92d4260
refactor PutbackPageModal
yuki-takei Oct 14, 2025
58a5017
update serena memories
yuki-takei Oct 14, 2025
2e2c263
refactor some modal to fix early return problem
yuki-takei Oct 14, 2025
7b0b479
refactor ConflictDiffModal
yuki-takei Oct 14, 2025
554136b
refactor some modal to fix early return problem
yuki-takei Oct 14, 2025
c571402
refactor some modal to fix early return problem
yuki-takei Oct 14, 2025
b62730b
add serena memory
yuki-takei Oct 14, 2025
dca2afd
refactor some modals
yuki-takei Oct 15, 2025
eb19df6
refactor some modals
yuki-takei Oct 15, 2025
33acdcd
update serena memories
yuki-takei Oct 15, 2025
68c2c6e
fix import order
yuki-takei Oct 15, 2025
11d6a8b
Merge pull request #10391 from growilabs/imprv/modal-optimization
yuki-takei Oct 15, 2025
6fec300
Merge branch 'master' into support/use-jotai
yuki-takei Oct 15, 2025
02eee47
fix the problem when merge
yuki-takei Oct 15, 2025
6bdee28
typescriptize
yuki-takei Oct 15, 2025
ecc7bcb
fix props
yuki-takei Oct 15, 2025
c181f0a
update serena memory
yuki-takei Oct 15, 2025
5ce9ca2
update serena memory
yuki-takei Oct 15, 2025
64598c0
improve useLazyLoader
yuki-takei Oct 15, 2025
1eeadd4
refactor PageAccessoriesModal loadable dynamically
yuki-takei Oct 15, 2025
9445098
add ShortcutsModal and dynamic loading support
yuki-takei Oct 15, 2025
c6e10d1
update serena memories
yuki-takei Oct 15, 2025
b30d95c
rename
yuki-takei Oct 15, 2025
b4d9fc3
update serena memories
yuki-takei Oct 15, 2025
ffacc54
relocate memory
yuki-takei Oct 16, 2025
ee939b8
optimize some modals
yuki-takei Oct 16, 2025
4d80160
optimize some modals
yuki-takei Oct 16, 2025
35fe8fa
update serena memories
yuki-takei Oct 16, 2025
2e4fa42
Merge branch 'master' into support/use-jotai
yuki-takei Oct 16, 2025
68d6177
fix merge mistakes
yuki-takei Oct 16, 2025
e8c8886
fix biome errors
yuki-takei Oct 16, 2025
45dc371
Merge remote-tracking branch 'origin/master' into support/use-jotai
yuki-takei Oct 17, 2025
2f55035
Merge branch 'support/use-jotai' into imprv/optimize-modal-dynamic-lo…
yuki-takei Oct 17, 2025
0a79c15
fix biome organizeImports settings
yuki-takei Oct 17, 2025
0d8ce8f
Merge branch 'master' into support/use-jotai
yuki-takei Oct 17, 2025
f2b9f8f
fix merging mistakes
yuki-takei Oct 17, 2025
04385d1
Merge branch 'support/use-jotai' into imprv/optimize-modal-dynamic-lo…
yuki-takei Oct 17, 2025
bf380fb
optimize some modals
yuki-takei Oct 17, 2025
b3716ad
format with biome
yuki-takei Oct 17, 2025
4fdfc5f
bugfix
yuki-takei Oct 17, 2025
a66afa5
Merge branch 'support/use-jotai' into imprv/optimize-modal-dynamic-lo…
yuki-takei Oct 17, 2025
f64c425
optimize some modals
yuki-takei Oct 17, 2025
a131eb4
typescriptize
yuki-takei Oct 17, 2025
211f1de
optimize some modals
yuki-takei Oct 17, 2025
f2c4e16
optimize DeleteCommentModal
yuki-takei Oct 17, 2025
b85af1c
update serena memories
yuki-takei Oct 17, 2025
2d91016
optimize SearchOptionModal
yuki-takei Oct 17, 2025
b0b38ba
optimize DeleteAiAssistantModal
yuki-takei Oct 17, 2025
ad8715c
optimize PageAlerts
yuki-takei Oct 17, 2025
ea9bafd
refactor FullTextSearchNotCoverAlert
yuki-takei Oct 20, 2025
0e1f158
refactor FixPageGrantAlert
yuki-takei Oct 20, 2025
30d5a40
refactor TrashPageAlert
yuki-takei Oct 20, 2025
8c19559
refactor PageRedirectedAlert
yuki-takei Oct 20, 2025
82ec1a3
optimize AiAssistantSidebar
yuki-takei Oct 20, 2025
8115b6c
improve lazy loading components
yuki-takei Oct 20, 2025
5109093
fix lint errors
yuki-takei Oct 20, 2025
f939a0a
fix lint error
yuki-takei Oct 20, 2025
cefb9df
ignore apps/pdf-converter/specs
yuki-takei Oct 20, 2025
eebbbba
fix lint errors
yuki-takei Oct 20, 2025
945ca9f
fix lint errors
yuki-takei Oct 20, 2025
d66fcec
fix lint errors
yuki-takei Oct 20, 2025
4a32829
fix lint errors
yuki-takei Oct 20, 2025
bad663d
fix lint errors
yuki-takei Oct 20, 2025
dca3b32
fix test
yuki-takei Oct 20, 2025
a491f90
fix test
yuki-takei Oct 20, 2025
920e5c6
fix test
yuki-takei Oct 20, 2025
8fc940d
Merge pull request #10403 from growilabs/imprv/optimize-modal-dynamic…
yuki-takei Oct 20, 2025
967b68a
reorganize serena memories
yuki-takei Oct 20, 2025
2b6c469
Merge remote-tracking branch 'origin/master' into support/use-jotai
yuki-takei Oct 20, 2025
3c81bd4
Merge branch 'master' into support/use-jotai
yuki-takei Oct 20, 2025
340d41a
fix patterns
yuki-takei Oct 21, 2025
e288b0f
tidy up module
yuki-takei Oct 21, 2025
a154a90
suppress biome errors
yuki-takei Oct 21, 2025
8999082
fix getPageApiErrorHandler
yuki-takei Oct 21, 2025
e0487c6
fix not found logic
yuki-takei Oct 21, 2025
9042e58
fix not found and forbidden logic for API
yuki-takei Oct 21, 2025
d4a1225
fix transition to the editor mode
yuki-takei Oct 21, 2025
c4aeef5
fix height of sub navigation
yuki-takei Oct 21, 2025
240d202
fix useIsNotCreatable
yuki-takei Oct 24, 2025
c04434d
add `force: true` option
yuki-takei Oct 24, 2025
cd95e9b
Merge branch 'master' into support/use-jotai
yuki-takei Oct 28, 2025
70ec108
feat: enhance page fetching logic to prevent unnecessary re-fetching …
yuki-takei Oct 28, 2025
8f34782
remove unnecessary atom
yuki-takei Oct 28, 2025
954cec9
Merge branch 'master' into support/use-jotai
yuki-takei Oct 30, 2025
5e8499b
Merge branch 'master' into support/use-jotai
yuki-takei Oct 30, 2025
d5c6fb9
add plan document
yuki-takei Oct 31, 2025
b906c22
add latestRevisionId to IPageInfoForEntity
yuki-takei Oct 31, 2025
8eb91cb
re-implement useIsLatestRevisionId
yuki-takei Oct 31, 2025
e3b69eb
omit remoteRevisionIdAtom and refactor useIsRevisionOutdated
yuki-takei Oct 31, 2025
db7ab9e
update serena memories
yuki-takei Oct 31, 2025
6ee9ce6
mutate PageInfo
yuki-takei Oct 31, 2025
1768aa2
fix lint errors
yuki-takei Nov 5, 2025
abf0e8c
fix test
yuki-takei Nov 5, 2025
15e9f9c
refactor: sync URL revisionId to atom
yuki-takei Nov 5, 2025
dbb1fdf
fix lint error
yuki-takei Nov 5, 2025
0a4c1a8
Merge branch 'dev/7.4.x' into support/use-jotai
yuki-takei Nov 5, 2025
02328cd
Merge branch 'support/use-jotai' into imprv/latest-revision-data-hand…
yuki-takei Nov 5, 2025
b5073f8
Merge pull request #10459 from growilabs/imprv/latest-revision-data-h…
yuki-takei Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/healthy-pianos-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@growi/core': major
---

Remove global socket management and useSWRStatic
5 changes: 5 additions & 0 deletions .changeset/lazy-penguins-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@growi/core': major
---

Update IPage interfaces family
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ yarn-error.log*

# IDE, dev #
.idea
.claude
*.orig
*.code-workspace
*.timestamp-*.mjs

# turborepo
.turbo
Expand Down
104 changes: 104 additions & 0 deletions .serena/memories/apps-app-detailed-architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# apps/app アーキテクチャ詳細ガイド

## 概要
`apps/app` は GROWI のメインアプリケーションで、Next.js ベースのフルスタック Web アプリケーションです。

## エントリーポイント
- **サーバーサイド**: `server/app.ts` - OpenTelemetry 初期化と Crowi サーバー起動を担当
- **クライアントサイド**: `pages/_app.page.tsx` - Next.js アプリのルートコンポーネント

## ディレクトリ構成の方針

### フィーチャーベース(新しい方針)
`features/` ディレクトリは機能ごとに整理され、各フィーチャーは以下の構造を持つ:
- `interfaces/` - TypeScript 型定義
- `server/` - サーバーサイドロジック(models, routes, services)
- `client/` - クライアントサイドロジック(components, stores, services)
- `utils/` - 共通ユーティリティ

#### 主要フィーチャー
- `openai/` - AI アシスタント機能(OpenAI 統合)
- `external-user-group/` - 外部ユーザーグループ管理
- `page-bulk-export/` - ページ一括エクスポート
- `growi-plugin/` - プラグインシステム
- `search/` - 検索機能
- `mermaid/` - Mermaid 図表レンダリング
- `plantuml/` - PlantUML 図表レンダリング
- `callout/` - コールアウト(注意書き)機能
- `comment/` - コメント機能
- `templates/` - テンプレート機能
- `rate-limiter/` - レート制限
- `opentelemetry/` - テレメトリ・監視

### レガシー構造(段階的移行予定)

#### ユニバーサル(サーバー・クライアント共通)
- `components/` - React コンポーネント(ページレベル、レイアウト、共通)
- `interfaces/` - TypeScript インターフェース
- `models/` - データモデル定義
- `services/` - ビジネスロジック(レンダラーなど)
- `stores-universal/` - ユニバーサル状態管理(SWR コンテキスト等)

#### サーバーサイド専用
- `server/` - サーバーサイドコード
- `models/` - Mongoose モデル
- `routes/` - Express ルート(API v3含む)
- `service/` - サーバーサイドサービス
- `middlewares/` - Express ミドルウェア
- `util/` - サーバーサイドユーティリティ
- `events/` - イベントエミッター
- `crowi/` - アプリケーション初期化

#### クライアントサイド専用
- `client/` - クライアントサイドコード
- `components/` - React コンポーネント
- `services/` - クライアントサイドサービス
- `util/` - クライアントサイドユーティリティ
- `interfaces/` - クライアント固有の型定義
- `models/` - クライアントサイドモデル

#### Next.js Pages Router
- `pages/` - Next.js ページルート
- `admin/` - 管理画面ページ
- `me/` - ユーザー設定ページ
- `[[...path]]/` - 動的ページルート(Catch-all)
- `share/` - 共有ページ
- `login/` - ログインページ

#### 状態管理・UI
- `states/` - Jotai 状態管理(ページ、UI、サーバー設定)
- `stores/` - レガシー状態管理(段階的に states/ に移行)
- `styles/` - SCSS スタイル

#### その他
- `utils/` - 汎用ユーティリティ
- `migrations/` - データベースマイグレーション
- `@types/` - TypeScript 型拡張

## 開発指針

### 新機能開発
新しい機能は `features/` ディレクトリにフィーチャーベースで実装し、以下を含める:
1. インターフェース定義
2. サーバーサイド実装(必要に応じて)
3. クライアントサイド実装(必要に応じて)
4. 共通ユーティリティ

### 既存機能の改修
既存のレガシー構造は段階的に features/ に移行することが推奨される。

### 重要な技術スタック
- **フレームワーク**: Next.js (Pages Router)
- **状態管理**: Jotai (新), SWR (データフェッチング)
- **スタイル**: SCSS, CSS Modules
- **サーバー**: Express.js
- **データベース**: MongoDB (Mongoose)
- **型システム**: TypeScript
- **監視**: OpenTelemetry

## 特記事項
- AI 統合機能(OpenAI)は最も複雑なフィーチャーの一つ
- プラグインシステムにより機能拡張可能
- 多言語対応(i18next)
- 複数の認証方式サポート
- レート制限・セキュリティ機能内蔵
163 changes: 163 additions & 0 deletions .serena/memories/apps-app-development-patterns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# apps/app 開発ワークフロー・パターン集

## よくある開発パターン

### 新しいページ作成
1. `pages/` にページファイル作成(`.page.tsx`)
2. 必要に応じてレイアウト定義
3. サーバーサイドプロパティ設定 (`getServerSideProps`)
4. 状態管理セットアップ
5. スタイル追加

### 新しい API エンドポイント
1. `server/routes/apiv3/` にルートファイル作成
2. バリデーション定義
3. サービス層実装
4. レスポンス形式定義
5. OpenAPI 仕様更新

### 新しいフィーチャー実装
1. `features/新機能名/` ディレクトリ作成
2. `interfaces/` で型定義
3. `server/` でバックエンド実装
4. `client/` でフロントエンド実装
5. `utils/` で共通ロジック

### コンポーネント作成
1. 適切なディレクトリに配置
2. TypeScript プロパティ定義
3. CSS Modules でスタイル
4. JSDoc コメント追加
5. テストファイル作成

## 重要な設計パターン

### SWR データフェッチング
```typescript
const { data, error, mutate } = useSWR('/api/v3/pages', fetcher);
```

### Jotai 状態管理
```typescript
const pageAtom = atom(initialPageState);
const [page, setPage] = useAtom(pageAtom);
```

### CSS Modules スタイリング
```scss
.componentName {
@extend %some-placeholder;
@include some-mixin;
}
```

### API ルート実装
```typescript
export const getPageHandler = async(req: NextApiRequest, res: NextApiResponse) => {
// バリデーション
// ビジネスロジック
// レスポンス
};
```

## ファイル構成のベストプラクティス

### フィーチャーディレクトリ例
```
features/my-feature/
├── interfaces/
│ └── my-feature.ts
├── server/
│ ├── models/
│ ├── routes/
│ └── services/
├── client/
│ ├── components/
│ ├── stores/
│ └── services/
└── utils/
└── common-logic.ts
```

### コンポーネントディレクトリ例
```
components/MyComponent/
├── MyComponent.tsx
├── MyComponent.module.scss
├── MyComponent.spec.tsx
├── index.ts
└── sub-components/
```

## 開発時のチェックリスト

### コード品質
- [ ] TypeScript エラーなし
- [ ] ESLint ルール準拠
- [ ] テストケース作成
- [ ] 型安全性確保
- [ ] パフォーマンス影響確認

### 機能要件
- [ ] 国際化対応(i18n)
- [ ] セキュリティチェック
- [ ] アクセシビリティ対応
- [ ] レスポンシブデザイン
- [ ] エラーハンドリング

### API 設計
- [ ] RESTful 設計原則
- [ ] 適切な HTTP ステータスコード
- [ ] バリデーション実装
- [ ] レート制限対応
- [ ] ドキュメント更新

## デバッグ・トラブルシューティング

### よくある問題
1. **型エラー**: tsconfig.json 設定確認
2. **スタイル適用されない**: CSS Modules インポート確認
3. **API エラー**: ミドルウェア順序確認
4. **状態同期問題**: SWR キー重複確認
5. **ビルドエラー**: 依存関係バージョン確認

### デバッグツール
- Next.js Dev Tools
- React Developer Tools
- Network タブ(API 監視)
- Console ログ
- Lighthouse(パフォーマンス)

## パフォーマンス最適化

### フロントエンド
- コンポーネント lazy loading
- 画像最適化
- Bundle サイズ監視
- メモ化(useMemo, useCallback)

### バックエンド
- データベースクエリ最適化
- キャッシュ戦略
- 非同期処理
- リソース使用量監視

## セキュリティ考慮事項

### 実装時の注意
- 入力サニタイゼーション
- CSRF 対策
- XSS 防止
- 認証・認可チェック
- 機密情報の適切な取り扱い

## デプロイ・運用

### 環境設定
- 環境変数管理
- データベース接続
- 外部サービス連携
- ログ設定
- 監視設定

このガイドは apps/app の開発を効率的に進めるための包括的な情報源として活用してください。
Loading
Loading