How it works
The architecture in ten minutes — where things live and why. · Updated 2026-10-01
citepath-rehearsal is a Next.js app (App Router) backed by Postgres. The codebase is organized so that routes stay thin and features own their logic.
One config file
src/app.config.ts is the single source of truth for the product's identity — name, tagline, plans and prices, nav, footer, support email. The landing page, pricing, sitemap, llms.txt and JSON-LD all render from it, so a rebrand or a price change is one edit.
Features, not layers
Each capability lives in src/features/<name>/ — its components, server logic and tests together. Routes under src/app/ import features and never hold business logic. Server-only modules start with import "server-only" so secrets can't leak to the client.
Billing and entitlements
Plans are data in app.config.ts. Stripe checkout links and price ids arrive as env vars at provisioning time; when they're unset the pricing page still renders and its CTAs fall back to signup. Every plan carries numeric limits that features check before consuming a resource — 14-day trials included.
The growth loop
GROWTH.md is a work queue for a marketing loop — assets kit, SEO/GEO baseline, directory submissions — with the same conventions as QUEUE.md. The comparison pages (/vs/, /alternatives/) render from app.config.ts's comparisons array, which that loop fills.