Files
2nd/10_Wiki/Topic_Programming/Architecture/Modern-Website-Architecture.md
T
Antigravity Agent 9148c358d0 docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
2026-07-05 00:33:48 +09:00

5.6 KiB

id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title category status canonical_id aliases duplicate_of source_trust_level confidence_score verification_status tags raw_sources last_reinforced github_commit tech_stack
wiki-2026-0508-modern-website-architecture Modern Website Architecture 10_Wiki/Topics verified self
Web Architecture 2026
RSC Architecture
Islands Architecture
none A 0.9 applied
web
architecture
rsc
astro
nextjs
edge
2026-05-10 pending
language framework
typescript nextjs-astro

Modern Website Architecture

매 한 줄

"매 page = static shell + streamed server components + minimal islands". 2020 SPA → 2024 SSR → 2026 RSC + edge 의 진화. Next.js 16 / Astro 5 / Remix 의 매 default = server-first, JS 의 ship 매 minimum.

매 핵심

매 layer

  • Edge runtime: 매 request 의 region-local. Vercel/Cloudflare Workers, sub-50ms.
  • Server components: 매 default render = server. Zero JS 의 ship.
  • Client islands: 매 interactivity 의 hydrate 만.
  • CDN: 매 static asset + ISR cache.

매 trade-off

  • SSG: 매 build-time, fastest, stale data.
  • SSR: 매 request-time, fresh, slower TTFB.
  • ISR: 매 hybrid — stale-while-revalidate.
  • CSR: 매 SPA, JS-heavy, slow first paint.

매 응용

  1. Marketing site: SSG + Astro islands.
  2. Dashboard: RSC + streaming + Suspense.
  3. E-commerce: ISR + edge personalization.

💻 패턴

Next.js 16 RSC

// app/products/[id]/page.tsx — server component (default)
import { db } from "@/lib/db";
import { AddToCart } from "./add-to-cart"; // client island

export default async function Page({ params }: { params: { id: string } }) {
  const product = await db.product.findUnique({ where: { id: params.id } });
  if (!product) return <NotFound />;
  return (
    <article>
      <h1>{product.name}</h1>
      <p>{product.description}</p>
      <AddToCart productId={product.id} />
    </article>
  );
}

Client island

// app/products/[id]/add-to-cart.tsx
"use client";
import { useState } from "react";

export function AddToCart({ productId }: { productId: string }) {
  const [pending, setPending] = useState(false);
  return (
    <button
      disabled={pending}
      onClick={async () => {
        setPending(true);
        await fetch("/api/cart", { method: "POST", body: JSON.stringify({ productId }) });
        setPending(false);
      }}
    >Add</button>
  );
}

Streaming with Suspense

import { Suspense } from "react";

export default function Page() {
  return (
    <>
      <Header />
      <Suspense fallback={<Skeleton />}>
        <SlowProductList /> {/* awaits DB */}
      </Suspense>
      <Suspense fallback={<Skeleton />}>
        <SlowReviews />
      </Suspense>
    </>
  );
}

Astro islands

---
// src/pages/index.astro
import Counter from "../components/Counter.svelte";
const products = await fetch("https://api.shop/products").then(r => r.json());
---
<html>
  <body>
    {products.map(p => <article>{p.name}</article>)}
    <Counter client:visible />
  </body>
</html>

Edge middleware (Vercel)

// middleware.ts
import { NextResponse } from "next/server";
import { geolocation } from "@vercel/functions";

export function middleware(req: Request) {
  const { country } = geolocation(req);
  const res = NextResponse.next();
  res.cookies.set("country", country ?? "US");
  return res;
}

export const config = { matcher: "/((?!_next).*)" };

ISR + tag revalidation

// fetch with cache tags
const data = await fetch("https://api.shop/products", {
  next: { revalidate: 3600, tags: ["products"] },
});

// trigger revalidation on update
import { revalidateTag } from "next/cache";
revalidateTag("products");

Server actions

// app/contact/page.tsx
export default function Page() {
  async function submit(form: FormData) {
    "use server";
    await db.message.create({ data: { body: form.get("body") as string } });
  }
  return (
    <form action={submit}>
      <textarea name="body" />
      <button>Send</button>
    </form>
  );
}

View transitions

"use client";
import { unstable_ViewTransition as ViewTransition } from "react";

<ViewTransition><ProductCard /></ViewTransition>

매 결정 기준

상황 Approach
Content site (blog, docs) Astro SSG + minimal islands
App with auth Next.js RSC + server actions
Personalized e-commerce Next.js ISR + edge middleware
Realtime dashboard RSC + Suspense streaming + SSE

기본값: Next.js 16 RSC for apps, Astro 5 for content.

🔗 Graph

🤖 LLM 활용

언제: 매 server vs client component 의 split-suggest, Suspense boundary 의 propose, cache strategy 의 review. 언제 X: 매 design system, brand identity, accessibility audit (manual + tooling).

안티패턴

  • Everything client: 매 100KB JS 의 marketing page = 매 LCP regression.
  • No streaming: 매 await 의 block, blank screen 5s.
  • Cache everywhere: 매 personalized data 의 stale = 매 wrong-user bug.
  • Edge for DB-heavy: 매 cold start + DB latency = slower than serverful.

🧪 검증 / 중복

  • Verified (Next.js 16 docs, Astro 5 docs, Vercel architecture guides 2026).
  • 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — RSC + islands + edge web architecture