Skip to main content

Capstone — SaaS architecture and platform engineering

Design a multi-tenant B2B SaaS product with authentication, workspaces, permissions, analytics, large tables, editable workflows, notifications, billing/settings, live updates, SSR/RSC-capable infrastructure, and several frontend teams shipping independently.

The deliverable is an architecture proposal plus a thin vertical slice that proves the design.

Start with domains, not folders​

The application is composed from owned domains
App shell
routing · session · navigation · platform concerns
Identity
authentication/session facade
Workspace
tenant context
Dashboard
analytics
Operations
core workflow
Billing
commercial domain
Settings/Notifications
supporting domains

Each domain owns its components, local state, types, data adapters, mutation logic, tests, and intentional public exports. Consumers should use feature entry points rather than deep imports into internals.

State architecture matrix​

CategoryExampleOwner
Local UIdropdown open statecomponent
Feature stateselected operationfeature boundary
URL statefilters/page/sortrouter/URL
Server staterecords/permissionsserver/data layer
External statelive connectionexternal store
App-shell statetheme/workspace facadenarrow provider/store
Derived statevisible totalsrender calculation
Should this go into one global store?
It has a clearer local/URL/server/form/external ownerNo — keep the real source of truth
Cross-feature client workflow genuinely needs one ownerMaybe — document scope, lifetime, writes, subscriptions
Reason is only that the application is largeNo — size does not imply centralization

Multi-tenant trust boundary​

Tenant identity must participate in every privileged server boundary
Client workspace selection
workspaceId is caller-controlled input
Server policy
authenticated user + tenant membership + resource authorization
Tenant data
DB/cache/job/search keys include correct scope

UI hiding improves UX; it never replaces server authorization.

Permission model​

Prefer a domain policy such as:

can(currentUser, 'operation:update', operation)

over scattered role-string checks. The client model can keep UI consistent, while the server remains authoritative.

Server/Client architecture​

Default server-friendly regions to server execution; add interaction deliberately
DashboardPage — Server
workspace/data-aware composition
SummaryCards
server/read-only
OperationsWorkspace
client island for filters/table/details
BillingSummary
server/read-only when possible

Justify boundaries using execution, data access, serialization, interactivity, bundle cost, and framework/runtime constraints.

Data access direction​

Components depend on application contracts, not every transport detail
1UI intent/read
2Feature controller/hook
3Data adapter
4HTTP/RSC/Server Function
5Backend/domain

This lets transport evolve without rewriting every component.

Mutation architecture​

1Intent
2Client UX validation
3Server authorization + validation
4Transaction/idempotency
5Canonical result
6Cache/live reconciliation

Document retries, duplicate submissions, stale/conflicting edits, optimistic rollback, and live-event convergence.

Failure and reveal maps​

Error boundaries should follow independent recovery units
Root boundary
whole-app initialization
App shell
stable platform frame
Dashboard
feature recovery
Billing
independent domain failure
Settings
independent domain failure

Expected mutation errors remain normal UI state. Unexpected rendering failures use Error Boundaries.

Suspense boundaries should preserve the stable shell and reveal content in groups aligned with user tasks.

Design system as platform infrastructure​

Shared primitive contract
semantics · focus · keyboard · variants · tokens · refs · composition · form/error relationships
Domain feature
business state · tenant rules · workflow policy

Shared primitives require tests, versioning, deprecation policy, migration guidance, and ownership.

Performance budgets​

Budgets make performance an owned system property
Load
critical route JS · network count · hydration
Interaction
response latency · non-urgent scheduling
Scale
table/render/list strategy

For high-cost features ask whether work can stay server-side, update scope can shrink, lists can be paginated/windowed, code can split, waterfalls can disappear, or non-urgent work can defer. Add manual memoization only after measurement.

Observability standard​

Every team should emit interoperable production context
Errors
caught · uncaught · recoverable · mutation/data failures
Performance
route · interaction · long task · server/mutation latency
Correlation
release · feature · sanitized tenant/user ID · trace ID

Track outcomes, not sensitive payloads.

Team ownership and dependency direction​

Platform provides paved roads; product domains retain business ownership
Platform / design system
shell · auth primitives · telemetry · build/test conventions
Domain features
business workflows + owned data/state
Routes/product journeys
user-facing integration

Use CODEOWNERS/package ownership/ADRs so shared changes have visible responsibility and migration paths.

CI and rollout quality gates​

1Type/lint
2Unit/integration
3Accessibility/security
4Build/performance budgets
5E2E critical journeys
6Staged rollout + telemetry

Capstone evidence​

A strong submission includes a domain/ownership map, state matrix, server/client/trust boundaries, mutation contract, error/Suspense map, design-system contract, performance budget, testing strategy, observability model, ADRs, and a rollback/migration plan.

The staff-level skill is not drawing the most boxes. It is designing boundaries that let multiple teams change a production system safely.