refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조

에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게
[공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류.
문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인).

- Topic_Programming → Domain_Programming (내부 구조 보존)
- Topic_Graphic → Domain_Design
- Topic_Business → Domain_Product
- Topic_General → Domain_General
- _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning),
  Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing)
- 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서)
- 빈 폴더 정리 (memory/procedures)
- 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Antigravity Agent
2026-07-11 11:05:56 +09:00
parent 6549ead309
commit c24165b8bc
6193 changed files with 1717 additions and 31 deletions
@@ -0,0 +1,235 @@
---
id: wiki-2026-0508-대규모-콘텐츠-기반-애플리케이션-및-전자상거래-플랫폼-구축
title: 대규모 콘텐츠 기반 애플리케이션 및 전자상거래 플랫폼 구축
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [E-commerce Platform, Content Platform, Headless Commerce]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [frontend, ecommerce, content, nextjs, headless]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: typescript
framework: nextjs
---
# 대규모 콘텐츠 기반 애플리케이션 및 전자상거래 플랫폼 구축
## 매 한 줄
> **"매 SEO + 속도 + 개인화 의 trilemma"**. 백만 SKU + CMS 콘텐츠 + 개인화 추천 을 동시에 빠르게 보여줘야 한다. 2026 답: Next.js 15 PPR + ISR + Edge runtime + headless CMS (Sanity/Contentful) + Stripe/Shopify Hydrogen.
## 매 핵심
### 매 대규모 commerce 의 도전
- **카탈로그**: 100k-1M SKU — search/filter 빠르게.
- **SEO**: PDP (product detail page) 가 organic traffic 핵심 — SSR/ISR 필수.
- **개인화**: 추천, cart, region pricing — per-user dynamic.
- **트래픽 spike**: BFCM (Black Friday) 10-100× 평소.
- **글로벌**: i18n, currency, tax, shipping zone.
### 매 architecture 패턴
- **Headless commerce**: storefront (Next.js) + commerce engine (Shopify/Commerce Layer/Saleor) 분리.
- **Composable**: CMS + commerce + search (Algolia) + reviews + auth — 매 best-of-breed.
- **Static + dynamic mix**: PDP는 ISR, cart/checkout 은 dynamic, 매 PPR 로 한 page 안에서 mix.
### 매 응용
1. Shopify storefront (custom Hydrogen).
2. Magazine + commerce hybrid.
3. B2B catalog (gated pricing).
4. Marketplace (multi-vendor).
## 💻 패턴
### Next.js 15 PPR (Partial Prerendering) for PDP
```tsx
// app/products/[slug]/page.tsx
export const experimental_ppr = true;
export default async function PDP({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = await params;
const product = await getProduct(slug); // 매 static (ISR)
return (
<>
<ProductGallery images={product.images} />
<ProductInfo product={product} />
<Suspense fallback={<PriceSkeleton />}>
<DynamicPrice productId={product.id} /> {/* 매 per-user / region */}
</Suspense>
<Suspense fallback={<RecsSkeleton />}>
<Recommendations productId={product.id} />
</Suspense>
</>
);
}
export async function generateStaticParams() {
const top = await getTopProducts(1000);
return top.map(p => ({ slug: p.slug }));
}
```
### ISR with on-demand revalidation
```ts
export const revalidate = 3600; // 매 1h auto-revalidate
// app/api/revalidate/route.ts — webhook from CMS
export async function POST(req: Request) {
const { slug, secret } = await req.json();
if (secret !== process.env.REVALIDATE_SECRET) return new Response('forbidden', { status: 403 });
revalidateTag(`product-${slug}`);
return Response.json({ revalidated: true });
}
// in fetch
fetch(`${API}/products/${slug}`, { next: { tags: [`product-${slug}`] } });
```
### Algolia search with InstantSearch
```tsx
import { InstantSearch, SearchBox, Hits, RefinementList } from 'react-instantsearch';
import { liteClient } from 'algoliasearch/lite';
const client = liteClient(APP_ID, SEARCH_KEY);
<InstantSearch searchClient={client} indexName="products">
<SearchBox />
<RefinementList attribute="brand" />
<RefinementList attribute="category" />
<Hits hitComponent={ProductCard} />
</InstantSearch>
```
### Headless CMS content (Sanity)
```ts
import { groq } from 'next-sanity';
const POST_QUERY = groq`*[_type == "post" && slug.current == $slug][0]{
title, body, "author": author->name, publishedAt
}`;
export async function getPost(slug: string) {
return client.fetch(POST_QUERY, { slug }, { next: { tags: [`post-${slug}`] } });
}
```
### Shopping cart (server actions + cookie)
```ts
'use server';
import { cookies } from 'next/headers';
export async function addToCart(variantId: string, qty: number) {
const cartId = (await cookies()).get('cart_id')?.value;
const cart = cartId
? await shopify.cart.add(cartId, variantId, qty)
: await shopify.cart.create(variantId, qty);
(await cookies()).set('cart_id', cart.id, { httpOnly: true, secure: true });
revalidateTag('cart');
}
```
### i18n with next-intl
```tsx
// app/[locale]/layout.tsx
import { NextIntlClientProvider } from 'next-intl';
import { getMessages } from 'next-intl/server';
export default async function Layout({ children, params }: { children: ReactNode, params: Promise<{ locale: string }> }) {
const { locale } = await params;
const messages = await getMessages();
return (
<html lang={locale}>
<body>
<NextIntlClientProvider messages={messages}>{children}</NextIntlClientProvider>
</body>
</html>
);
}
```
### Image optimization at scale
```tsx
import Image from 'next/image';
<Image
src={product.image}
alt={product.name}
width={800}
height={800}
sizes="(max-width: 768px) 100vw, 50vw"
priority={isAboveFold}
placeholder="blur"
blurDataURL={product.imageBlur}
/>
```
### Edge runtime for personalization
```ts
// middleware.ts
import { NextResponse } from 'next/server';
export function middleware(req: NextRequest) {
const country = req.geo?.country ?? 'US';
const res = NextResponse.next();
res.cookies.set('region', country);
return res;
}
```
### Web Vitals tracking
```tsx
'use client';
import { useReportWebVitals } from 'next/web-vitals';
export function Analytics() {
useReportWebVitals(metric => {
fetch('/api/vitals', { method: 'POST', body: JSON.stringify(metric) });
});
return null;
}
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| < 1k SKU | static-only + on-demand ISR. |
| 1k-100k SKU | ISR top-N + on-demand for tail. |
| 1M+ SKU | dynamic + heavy CDN cache. |
| Personalized price | PPR — static shell + dynamic price hole. |
| Search | Algolia / Meilisearch / Typesense. |
| BFCM-scale | edge cache + queue checkout. |
**기본값**: Next.js 15 + PPR + ISR + Algolia + Shopify Storefront API + Stripe.
## 🔗 Graph
- 부모: [[Large_Frontend_Projects|Frontend Architecture]] · [[Web Performance]]
- 변형: [[Headless Commerce]]
- 응용: [[Sanity]] · [[Algolia]]
- Adjacent: [[ISR]] · [[Edge Runtime]]
## 🤖 LLM 활용
**언제**: 콘텐츠 + 거래 동시 제공, SEO 핵심, 100+ pages.
**언제 X**: SPA dashboard, 매 small custom shop (Shopify default theme 으로 충분).
## ❌ 안티패턴
- **Full SSR for everything**: PDP 매 request 마다 DB hit → ISR + tag-based revalidate.
- **No CDN for images**: origin 직접 serve → Vercel Image / Cloudflare Images / imgix.
- **Client-side cart in localStorage only**: 매 device 간 sync 안 됨 → server cart + cookie id.
- **Synchronous 3rd-party scripts**: GTM, A/B → 매 next/script strategy="lazyOnload".
- **Hardcoded i18n strings**: 시작부터 namespace 분리.
- **No cache stampede protection**: revalidate 시 동시 1000 request → SWR / lock.
## 🧪 검증 / 중복
- Verified (Next.js 15 docs, Vercel commerce template, Shopify Hydrogen, web.dev/commerce).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — Next.js 15 PPR + headless commerce stack |