Module Map
Use this map to decide where a change belongs before adding routes, server logic, UI, or persistence.
On this page
Top-level ownership
| Folder | Primary job | Scale rule |
|---|---|---|
| app | Route entrypoints, layouts, API route files, route-local loading and error states. | Keep route files thin. Move reusable UI and domain logic into features or shared components. |
| features/account | Profile, notification preferences, security settings, and account deletion. | Keep user-owned account mutations authenticated on the server boundary. |
| features/analytics | Platform metrics, revenue charts, billing signals, and activity summaries. | Batch reads, filter server-side, and avoid provider calls in chart loops. |
| features/billing | Provider config, checkout, portal, webhooks, finance records, pricing UI, and customer billing views. | Treat billing as high-scrutiny: validate provider signatures, make webhook writes idempotent, and test duplicate delivery. |
| features/branding | Brand identity, logos, favicon, appearance mode, and public brand settings. | Keep public branding reads separate from admin mutation paths. |
| features/compliance | Security overview data, RBAC reporting, audit log views, and data retention work. | Keep admin-only access fail-closed and preserve useful audit context. |
| features/contact | Contact messages, lead capture, and customer-facing support entrypoints. | Rate-limit public writes and keep recipient routing server-owned. |
| features/customers | Customer lists, provider customer detail, billing history, and customer search. | Read selectively and paginate before the customer table grows. |
| features/notifications | Outbox delivery, templates, settings, recipient resolution, webhooks, and send logs. | Queue external delivery work and preserve failure context across retries. |
| features/posts | Editor.js content, posts, pages, FAQ, changelog, case studies, team content, SEO, and public rendering. | Keep editor state, validation, rendering, and persistence in separate files as the content model grows. |
| features/settings | Website, SEO, waitlist, billing, and app settings. | Validate env and database-backed settings near the boundary where they are used. |
| features/team | Staff invites, roles, public team directory, and access management. | Use canonical roles and fail closed on admin routes. |
| features/waitlist | Waitlist signup, confirmation, exports, conversion hooks, and admin operations. | Protect public signup against spam and exports against unauthorized access. |