Shipflash logoDocs

Architecture

The app uses thin App Router entrypoints, feature-owned domains, shared infrastructure boundaries, and explicit server/client separation.

On this page

Architecture source map

Route entrypoints

App Router files should wire metadata, request/response behavior, and delegation only.

  • src/app/docs/page.tsx
  • src/app/api/billing/checkout/route.ts
  • src/app/api/webhooks/stripe/billing/route.ts

Feature modules

Product behavior lives under feature folders with server, UI, shared, persistence, schemas, and services as needed.

  • src/features/billing/server/checkout/service.ts
  • src/features/notifications/server/outbox/services/worker.ts

Infrastructure boundaries

Auth, Supabase, navigation, rate limits, SEO, logging, and uploads stay in lib when multiple domains use them.

  • src/lib/auth/rbac/nav-config.ts
  • src/lib/supabase/server.ts
  • src/lib/security/rate-limit/policy.ts

Server and client boundary rule

  1. 1

    Route receives the request

    Route files collect framework-specific inputs and pass stable app-owned parameters to server services.

    • src/app/api/billing/checkout/route.ts
  2. 2

    Server service owns behavior

    Services validate input, enforce auth or policy, call persistence, invoke providers, and return app-owned results.

    • src/features/billing/server/checkout/service.ts
  3. 3

    Persistence owns data access

    Database reads and writes stay in feature-owned persistence or query files so UI and routes do not assemble PostgREST behavior directly.

    • src/features/settings/server/persistence/settings.ts
  4. 4

    UI owns presentation

    Feature UI renders state and actions without importing server-only provider logic.

    • src/features/settings/ui/website-form.tsx