Skip to content

Commit 22cefc8

Browse files
committed
docs(adr): record domain-first modular monolith
1 parent e580cf0 commit 22cefc8

16 files changed

Lines changed: 193 additions & 120 deletions

AGENTS.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
- 현재 MDX 파이프라인을 보존한다. MDX는 `next.config.mjs``@mdx-js/loader`
77
기반 커스텀 webpack rule에 남겨둔다. 전체 콘텐츠 파이프라인을 의도적으로
88
마이그레이션하지 않는 한 Next.js 내장 MDX로 바꾸지 않는다.
9-
- 시각화 중심 UI는 `src/components/visualization/`에 둔다. 명확한
10-
아키텍처 이유 없이 다른 폴더로 옮기지 않는다.
9+
- 시각화 중심 UI는 `shared/visualization/`에 둔다. 블로그 MDX가 재사용하는
10+
시각화 컴포넌트는 도메인 코드가 아니라 shared 시각화 모듈로 관리한다.
1111
- `any`를 사용하지 않는다. 구체 타입을 쓰거나 `unknown`과 narrowing을
1212
사용한다.
1313
- `p-[13px]` 같은 arbitrary Tailwind value를 사용하지 않는다. 표준 utility,
1414
shared token, 기존 스타일 패턴을 사용한다.
15-
- feature-first 구조를 flat shared folder 구조로 바꾸지 않는다.
16-
`src/features/`, `src/shared/`, `src/domains/`를 책임별로 유지한다.
15+
- DDD의 전략적 설계 개념을 차용한 domain-first modular monolith 구조를
16+
유지한다. 주요 도메인은 `src`와 같은 최상위 모듈로 분리하고, `src/app`
17+
Next.js route adapter로 제한한다.
1718
- 블로그 콘텐츠 구조는 `posts/**/index.mdx`와 주변 `meta.json`으로 유지한다.
1819
중첩된 series 디렉터리도 보존한다.
1920
- 변경이 아래 ADR 작성 조건에 걸리면 반드시 ADR을 작성하거나 갱신한다.
@@ -38,16 +39,20 @@ ADR 작성 기준:
3839

3940
## 프로젝트 구조
4041

41-
- `src/app/`: Next.js App Router 페이지, 레이아웃, 핸들러
42-
- `src/core/`: 앱 수준 provider와 설정 조합
43-
- `src/domains/`: feature 사이에서 공유되는 계약과 스키마
44-
- `src/features/`: blog, home, resume, search 같은 feature 모듈
45-
- `src/shared/`: 재사용 가능한 UI, layout, analytics, SEO, provider
46-
- `src/components/visualization/`: animation과 시각화 중심 컴포넌트
47-
- `src/styles/`: design token과 global style
42+
- `src/app/`: Next.js App Router route adapter, route handler, metadata entry
43+
- `blog/`: 글 도메인. post schema, repository, publication policy, series,
44+
blog UI, view-count use case
45+
- `resume/`: 이력서 도메인. resume data, ordering, resume UI
46+
- `search/`: 검색 도메인. command palette, search action, recommendation
47+
- `site/`: 도메인 조합 layer. home, AppShell, navigation, provider, site config
48+
- `platform/`: 외부/런타임 인프라. Supabase, Umami analytics, SEO helper,
49+
devtool integration
50+
- `shared/`: 도메인 지식 없는 UI primitive, motion helper, testing helper,
51+
visualization widget
52+
- `styles/`: design token과 global style
4853
- `posts/`: 중첩 가능한 `index.mdx``meta.json` 기반 블로그 콘텐츠
4954
- `tests/`: Playwright E2E 테스트
50-
- `internal/`: script와 tool configuration
55+
- `tooling/`: script와 tool configuration
5156

5257
## 개발 명령
5358

ARCHITECTURE.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ARCHITECTURE
22

3-
Last updated: 2026-05-06
3+
Last updated: 2026-05-07
44

55
## System Summary
66

@@ -21,7 +21,7 @@ Last updated: 2026-05-06
2121
- Rendering mix:
2222
- Static prerendered route params via `generateStaticParams` for post pages.
2323
- Server route handlers for feed and OG image.
24-
- Server actions for view counting.
24+
- Domain-owned server actions for view counting.
2525

2626
### Edge Runtime
2727

@@ -40,12 +40,12 @@ Last updated: 2026-05-06
4040
- Route handlers:
4141
- `/feed.xml` (`src/app/feed.xml/route.ts`)
4242
- `/api/og` (`src/app/api/og/route.tsx`)
43-
- Server action:
44-
- `src/app/actions/view.ts` for increment/read view count.
43+
- `src/app` imports page adapters from top-level domain modules and does not own
44+
domain policy.
4545

46-
### Content Layer (`posts/**` + `src/features/blog/services`)
46+
### Content Layer (`posts/**` + `blog/services`)
4747

48-
- `src/features/blog/services/post-repository.ts` recursively discovers valid post folders (`index.mdx` + `meta.json`).
48+
- `blog/services/post-repository.ts` recursively discovers valid post folders (`index.mdx` + `meta.json`).
4949
- `meta.json` is validated with Zod (`FeedFrontmatterSchema`).
5050
- MDX is loaded by dynamic import per folder path.
5151
- Reading time is auto-derived from MDX when metadata omits it.
@@ -57,31 +57,32 @@ Last updated: 2026-05-06
5757
- `remark-gfm`
5858
- `rehype-slug`
5959
- `rehype-pretty-code`
60-
- `src/features/blog/services/markdown-parser.ts` parses MDX headings for TOC data.
61-
- `src/features/blog/ui/mdx/components.tsx` maps MDX nodes to UI components and interactive visualization widgets.
60+
- `blog/services/markdown-parser.ts` parses MDX headings for TOC data.
61+
- `blog/ui/mdx/components.tsx` maps MDX nodes to UI components and interactive visualization widgets.
6262

63-
### Feature/Shared Layer (`src/features` + `src/shared` + `src/styles`)
63+
### Domain-first Modular Monolith
6464

65-
- Feature-first organization:
66-
- `src/features/blog`, `src/features/resume`, `src/features/search`, `src/features/home`
67-
- `src/shared/analytics`, `src/shared/layout`, `src/shared/ui`, `src/shared/providers`, `src/shared/seo`
68-
- `src/components/visualization` is intentionally preserved for heavy visualization widgets.
69-
- Design tokens in `src/styles/tokens.css`.
70-
- Global base styles and typography in `src/styles/globals.css`.
71-
- Theming via `next-themes` provider.
65+
- `blog/`: post schema, repository, publication policy, series, blog UI, view-count use case.
66+
- `resume/`: resume data, ordering, resume UI.
67+
- `search/`: command palette, search action, search recommendation.
68+
- `site/`: home composition, AppShell, navigation, providers, site config.
69+
- `platform/`: Supabase integration, Umami analytics, SEO helper, devtools.
70+
- `shared/`: domain-agnostic UI, layout primitive, motion helper, testing helper, visualization widget.
71+
- `styles/`: design tokens, global base styles, local font CSS.
72+
- Theming via `next-themes` provider in `site/providers`.
7273

7374
### Data and Integrations
7475

75-
- Supabase client setup in `src/shared/integrations/supabase.ts`.
76+
- Supabase client setup in `platform/integrations/supabase.ts`.
7677
- View count data model:
7778
- table: `public.views`
7879
- rpc: `increment_view(slug_input text) -> bigint`
7980
- SQL provisioning script: `docs/database/supabase-view-count.sql`.
8081

8182
### Analytics and SEO
8283

83-
- Umami event helpers in `src/shared/analytics/lib/analytics.ts`.
84-
- Trackers in `src/shared/analytics/components/*`.
84+
- Umami event helpers in `platform/analytics/lib/analytics.ts`.
85+
- Trackers in `platform/analytics/components/*`.
8586
- Structured data via `JsonLd` component in layout and post page.
8687

8788
## Request/Data Flows
@@ -92,7 +93,7 @@ Last updated: 2026-05-06
9293
2. Request to `/blog/[slug]` resolves post via `getFeedData(slug)`.
9394
3. MDX source is parsed for heading structure (TOC).
9495
4. MDX component renders with mapped custom components.
95-
5. Client tracker records post view; server action can persist counter in Supabase.
96+
5. Client tracker records post view; `blog/api/view.ts` can persist counter in Supabase.
9697

9798
### Feed Flow
9899

@@ -109,19 +110,20 @@ Last updated: 2026-05-06
109110

110111
## Testing and Quality
111112

112-
- Unit/component tests: Vitest + Testing Library (`src/**/*.test.ts(x)`).
113+
- Unit/component tests: Vitest + Testing Library across top-level modules and `src/app`.
113114
- E2E tests: Playwright mobile-focused projects (`tests/e2e/**/*.spec.ts`).
114115
- Linting/formatting: ESLint, Prettier, markdownlint, cspell.
115-
- Coverage focus includes `src/features`, `src/shared`, `src/styles`, and selected route domains.
116+
- Coverage focus includes `blog`, `resume`, `search`, `site`, `platform`,
117+
`shared`, `styles`, and selected route adapters.
116118

117119
## Current Architecture Risks
118120

119121
1. Docs/runtime drift:
120122
- AGENTS and README mention older stack assumptions; package versions are newer.
121123
2. Provider boundary drift:
122124
- Route/layout changes can reintroduce duplicated tracker mounts if `AppProviders` is bypassed.
123-
3. Content/animation docs drift:
124-
- Documented `src/components/animations` path does not exist in current tree.
125+
3. Boundary enforcement drift:
126+
- Module boundaries are physical and documented, but lint-level enforcement is not yet configured.
125127
4. SEO endpoint mismatch risk:
126128
- Post JSON-LD image URL differs from the actual OG route path/domain conventions.
127129

@@ -134,3 +136,4 @@ Last updated: 2026-05-06
134136
3. Keep token-first styling and avoid one-off visual constants where possible.
135137
4. Keep route-level separation for feed, OG, and view-count concerns.
136138
5. Keep Umami analytics separate from Supabase-backed public view counts.
139+
6. Keep top-level domain modules as documented in ADR 0011.

README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,19 @@
7575
```text
7676
eunu.log/
7777
├── 📁 src/
78-
│ ├── 📁 app/ # 라우트 엔트리 전용 (Next App Router)
79-
│ ├── 📁 core/ # 앱 전역 설정/프로바이더 조합
80-
│ ├── 📁 domains/ # 도메인 계약/타입/스키마
81-
│ ├── 📁 features/ # 기능 모듈(ui/model/services)
82-
│ │ ├── 📁 blog/
83-
│ │ ├── 📁 resume/
84-
│ │ ├── 📁 search/
85-
│ │ └── 📁 home/
86-
│ ├── 📁 shared/ # 공용 모듈(analytics/integrations/layout/seo/testing/ui/types)
87-
│ ├── 📁 components/
88-
│ │ └── 📁 visualization/ # 인터랙티브 알고리즘 시각화 전용
89-
│ └── 📁 styles/ # 전역 스타일과 토큰
78+
│ └── 📁 app/ # Next.js route adapter
79+
├── 📁 blog/ # 글 도메인
80+
├── 📁 resume/ # 이력서 도메인
81+
├── 📁 search/ # 검색 도메인
82+
├── 📁 site/ # 홈, AppShell, provider, site config
83+
├── 📁 platform/ # Supabase, Umami, SEO, devtool integration
84+
├── 📁 shared/ # 도메인 지식 없는 UI/모션/테스트/시각화
85+
├── 📁 styles/ # 전역 스타일과 토큰
9086
├── 📁 tests/
9187
│ └── 📁 e2e/ # Playwright E2E 테스트
92-
├── 📁 internal/
93-
│ ├── 📁 config/ # 내부 lint/spell 설정
94-
│ └── 📁 scripts/ # 내부 자동화/유틸 스크립트
88+
├── 📁 tooling/
89+
│ ├── 📁 config/ # lint/spell 설정
90+
│ └── 📁 scripts/ # 자동화/유틸 스크립트
9591
├── 📁 posts/ # 블로그 글(MDX + 메타데이터)
9692
│ └── 📁 [slug]/ # 글 단위 폴더
9793
│ ├── index.mdx # 글 본문

docs/DESIGN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# DESIGN
22

3-
Last updated: 2026-02-26
3+
Last updated: 2026-05-07
44

55
## Source of Truth
66

7-
1. Tokens: `src/styles/tokens.css`
8-
2. Global style behavior: `src/styles/globals.css`
9-
3. Reusable component patterns: `src/shared/ui/**`, `src/shared/layout/**`
7+
1. Tokens: `styles/tokens.css`
8+
2. Global style behavior: `styles/globals.css`
9+
3. Reusable component patterns: `shared/ui/**`, `shared/layout/**`
1010

1111
## Design Guardrails
1212

docs/FRONTEND.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FRONTEND
22

3-
Last updated: 2026-02-27
3+
Last updated: 2026-05-07
44

55
## Stack
66

@@ -11,17 +11,19 @@ Last updated: 2026-02-27
1111

1212
## Frontend Architecture
1313

14-
1. Route layer: `src/app/**`
15-
2. Feature layer: `src/features/**`
16-
3. Shared layer: `src/shared/**` (+ visualization: `src/components/visualization/**`)
17-
4. Styles/tokens: `src/styles/**`
14+
1. Route adapter layer: `src/app/**`
15+
2. Domain modules: `blog/**`, `resume/**`, `search/**`
16+
3. Composition layer: `site/**`
17+
4. Runtime/integration layer: `platform/**`
18+
5. Domain-agnostic primitives: `shared/**`
19+
6. Styles/tokens: `styles/**`
1820

1921
## Frontend Rules
2022

21-
1. Keep boundaries clear between feature modules (`blog`, `resume`, `search`, `home`) and shared modules (`layout`, `ui`, `analytics`, `providers`, `seo`).
23+
1. Keep boundaries clear between domain modules (`blog`, `resume`, `search`) and composition/infrastructure modules (`site`, `platform`, `shared`).
2224
2. Avoid duplicated global trackers/providers in root layout.
23-
3. Use typed contracts from `src/domains/**/model/types.ts` and `src/shared/types/*`.
24-
4. Keep MDX custom component mappings centralized in `src/features/blog/ui/mdx/components.tsx`.
25+
3. Keep domain contracts inside the owning domain module, for example `blog/model/types.ts`.
26+
4. Keep MDX custom component mappings centralized in `blog/ui/mdx/components.tsx`.
2527

2628
## Test Expectations
2729

docs/README.md

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Docs Index
22

3-
Last updated: 2026-04-17
3+
Last updated: 2026-05-07
44

5-
This index tracks the active documentation that should stay aligned with the
6-
current codebase. If a document is missing here, add it when the document
7-
becomes part of the maintained workflow.
5+
This index tracks the smallest set of documentation that must stay aligned with
6+
the current codebase. It is not a full file inventory.
7+
8+
Prefer updating an existing ADR, guide, exec plan, or README before adding a new
9+
standalone document.
810

911
## Repository-Level Docs
1012

@@ -13,33 +15,19 @@ becomes part of the maintained workflow.
1315

1416
## Active Documentation
1517

16-
- Engineering baseline:
17-
- `docs/FRONTEND.md`
18-
- `docs/DESIGN.md`
19-
- `docs/RELIABILITY.md`
20-
- `docs/SECURITY.md`
21-
- `docs/QUALITY_SCORE.md`
22-
- `docs/blog-quality-guide.md`
23-
- Delivery/process:
18+
- Decisions:
2419
- `docs/adr/README.md`
20+
- `docs/adr/*.md`
21+
- Planning:
2522
- `docs/PLANS.md`
2623
- `docs/exec-plans/active/README.md`
27-
- `docs/exec-plans/completed/README.md`
2824
- `docs/exec-plans/tech-debt-tracker.md`
29-
- `docs/guides/agentation-workflow.md`
30-
- `docs/guides/pr-workflow.md`
31-
- `docs/guides/testing-guide.md`
32-
- `docs/guides/ui-components-guide.md`
33-
- Product/domain:
34-
- `docs/PRODUCT_SENSE.md`
35-
- `docs/product-specs/index.md`
36-
- `docs/product-specs/new-user-onboarding.md`
37-
- `docs/design-docs/index.md`
38-
- `docs/design-docs/core-beliefs.md`
39-
- Data/analytics:
40-
- `docs/analytics/analytics-kpi-weekly-template.md`
41-
- `docs/database/db-schema.md`
42-
- `docs/database/supabase-view-count.sql`
25+
- Maintained guides:
26+
- `docs/guides/**`
27+
- Domain references:
28+
- `docs/database/**`
29+
- `docs/product-specs/**`
30+
- `docs/design-docs/**`
4331

4432
## Reference / Research
4533

@@ -56,6 +44,7 @@ becomes part of the maintained workflow.
5644

5745
1. Use repository-relative paths only in docs (no absolute local paths).
5846
2. Update `Last updated` when editing policy/process docs.
59-
3. Move stale auto-generated reports to `docs/archive/` instead of deleting context.
60-
4. Keep commands copy-pastable from repository root.
61-
5. Remove or replace stale links when a referenced file no longer exists.
47+
3. Treat this file as a maintained-doc boundary, not a complete docs inventory.
48+
4. Move stale auto-generated reports to `docs/archive/` instead of deleting context.
49+
5. Keep commands copy-pastable from repository root.
50+
6. Remove or replace stale links when a referenced file no longer exists.

docs/adr/0004-preserve-feature-first-source-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 0004. Feature-first 소스 구조를 유지한다
22

33
Date: 2026-02-28
4-
Status: Accepted
4+
Status: Superseded by [0011](0011-adopt-frontend-modular-monolith.md)
55

66
## 배경
77

docs/adr/0005-use-token-first-tailwind-styling.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# 0005. Token-first Tailwind 스타일링을 사용한다
22

33
Date: 2026-01-27
4-
Status: Accepted
4+
Status: Accepted, path amended by [0011](0011-adopt-frontend-modular-monolith.md)
5+
6+
Note: ADR 0011 moves the physical style path from `src/styles/**` to `styles/**`
7+
while preserving the token-first styling decision.
58

69
## 배경
710

docs/adr/0006-isolate-visualization-heavy-components.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# 0006. 시각화 중심 컴포넌트를 격리한다
22

33
Date: 2026-01-28
4-
Status: Accepted
4+
Status: Accepted, path amended by [0011](0011-adopt-frontend-modular-monolith.md)
5+
6+
Note: ADR 0011 moves the physical visualization path from
7+
`src/components/visualization/**` to `shared/visualization/**` while preserving
8+
the isolation decision.
59

610
## 배경
711

docs/adr/0009-use-app-shell-for-primary-navigation.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# 0009. 주요 탐색에 AppShell을 사용한다
22

33
Date: 2026-04-21
4-
Status: Accepted
4+
Status: Accepted, path amended by [0011](0011-adopt-frontend-modular-monolith.md)
5+
6+
Note: ADR 0011 moves AppShell from `src/shared/layout/AppShell/**` to
7+
`site/shell/AppShell/**` while preserving the single app-shell navigation
8+
decision.
59

610
## 배경
711

0 commit comments

Comments
 (0)