跳至内容 / Skip
Back to insights
中文
Web & Engineering

Sharing App Router is not sharing product boundaries

KSX Studio · 可上线9 min read

Teams jam marketing, docs, and authenticated product into one App Router repo—then releases freeze behind auth. The question is release cadence, cache, and failure domains—not monorepo purity. We isolate brand sites (SSG/ISR + CMS) from product with package boundaries. Use the decision tree in discovery, not the night before launch. Fold this into KSX Studio discover→design→build→launch: named owner, Definition of Done, staging proof, and rollback so verbal alignment does not drift.

Failure modes differ

Marketing fails via bad canonicals, slow LCP, blocked editors. Product fails via session leaks, auth bugs, API timeouts. One pipeline makes SEO hotfixes wait on product regression. List risks before folders. Fold this into KSX discover→design→build→launch checks on staging so verbal alignment does not drop the requirement.

Rendering: SSG/ISR vs session pages

Prefer static/ISR for marketing; reserve dynamic for dashboards. Whole-app dynamic kills performance and cost. Set segment config deliberately. Fold this into KSX discover→design→build→launch checks on staging so verbal alignment does not drop the requirement. Fold this into KSX Studio discover→design→build→launch: named owner, Definition of Done, staging proof, and rollback so verbal alignment does not drift.

Where to draw the auth boundary

Hard-split unauthenticated marketing from authenticated product in routes and middleware. Share UI carefully around session domains. Document SameSite, callbacks, logout. Fold this into KSX discover→design→build→launch checks on staging so verbal alignment does not drop the requirement. Fold this into KSX Studio discover→design→build→launch: named owner, Definition of Done, staging proof, and rollback so verbal alignment does not drift.

Do not mix CMS and product data

Marketing rides headless CMS with preview; product entities ride business APIs. Case studies in the product DB force editors through deploys. Name a content-model owner early. Fold this into KSX discover→design→build→launch checks on staging so verbal alignment does not drop the requirement.

When monorepo still makes sense

Monorepos shine for design systems and tooling—split app entrypoints with path-filtered CI. Share token pipelines; do not share the release button. Fold this into KSX discover→design→build→launch checks on staging so verbal alignment does not drop the requirement. Fold this into KSX Studio discover→design→build→launch: named owner, Definition of Done, staging proof, and rollback so verbal alignment does not drift.

SEO is owned by the marketing tree

Generate sitemaps, hreflang, JSON-LD in marketing; noindex private product pages. Use path conventions on one domain. Scope SEO audits to marketing. Fold this into KSX discover→design→build→launch checks on staging so verbal alignment does not drop the requirement. Fold this into KSX Studio discover→design→build→launch: named owner, Definition of Done, staging proof, and rollback so verbal alignment does not drift.

Migration: partition before split

If mixed, partition routes/packages, env, and CI before physical split. Give marketing independent staging and rollback while product keeps cadence. Fold this into KSX discover→design→build→launch checks on staging so verbal alignment does not drop the requirement. Fold this into KSX Studio discover→design→build→launch: named owner, Definition of Done, staging proof, and rollback so verbal alignment does not drift.

Checklist

  1. 1List failure modes and ship frequency
  2. 2Declare static/ISR/dynamic per segment
  3. 3Isolate auth tree from public tree
  4. 4Separate CMS preview from product APIs
  5. 5Path-filter CI deploys per app

Key takeaways

  • Architecture serves release cadence and failure domains.
  • Marketing leans static/SEO; product leans session/auth.
  • Monorepo is fine if independent deploys and ownership stay clear.

FAQ

Must we use two domains?
No. Path partitioning, middleware, and independent deploys often suffice. Split domains for brand, cookie, or compliance.
Where do docs live?
Usually marketing. If auth and versioned APIs dominate, lean product and watch indexation.
Can one App Router app do all?
Early-stage yes with partitions. Split deploy units when cadences diverge.

Related services

Keep reading