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
92932 . Request to ` /blog/[slug] ` resolves post via ` getFeedData(slug) ` .
93943 . MDX source is parsed for heading structure (TOC).
94954 . 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
1191211 . Docs/runtime drift:
120122 - AGENTS and README mention older stack assumptions; package versions are newer.
1211232 . 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 .
1251274 . 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
1341363 . Keep token-first styling and avoid one-off visual constants where possible.
1351374 . Keep route-level separation for feed, OG, and view-count concerns.
1361385 . Keep Umami analytics separate from Supabase-backed public view counts.
139+ 6 . Keep top-level domain modules as documented in ADR 0011.
0 commit comments