Skip to main content

Worked Answer: SaaS Dashboard

Prompt

Design the frontend architecture for a multi-tenant SaaS dashboard used by support, finance, and account managers. It includes login, dashboard home, customer detail, search/filter tables, exports, notifications, and role-based actions.

1. Clarify

Ask:

  • Which workflows are critical: search, customer detail, exports, billing, support?
  • What data is tenant-specific and role-specific?
  • Which routes are public, authenticated, or admin-only?
  • What freshness does each dashboard panel need?
  • What scale matters: tenants, rows, dashboard panels, teams, regions?
  • What compliance, privacy, and accessibility requirements apply?

Assumption for this answer: the primary risk is not visual complexity. The primary risk is data correctness, authorization, large-table interaction latency, and multiple teams changing the same app.

2. Architecture overview

3. Route rendering matrix

RouteStrategyWhy
/loginstatic or SSR shell, no-store auth callbacksecurity-sensitive, minimal JS
/dashboardserver shell plus panel-level data boundariesfast structure and independent degradation
/customers/:idserver composition with client tab islandsrole-specific data and interactive tabs
/ordershybrid shell plus client-heavy tablefilters and table actions need responsiveness
/exports/:jobIdserver shell plus polling/SSE islandside-effecting job state

4. Data and state

State/dataLocation
tenant and roleserver session/BFF
filters and paginationURL
server dataquery/cache layer backed by BFF
table row hover/selectioncomponent or feature state
export jobserver job model
notifications optimistic read stateclient overlay reconciled with server
user density/themepreference store

5. Module boundaries

Use a modular monolith:

features/
customers/
orders/
billing/
exports/
notifications/
platform/
auth/
data-client/
observability/
feature-flags/
design-system/

Rules:

  • feature modules cannot import each other directly
  • shared code enters platform only with owner and review
  • design-system components do not own domain data fetching
  • BFF contracts are versioned or contract-tested where shared

6. Quality gates

ConcernGate
PerformanceLCP route budget, INP table budget, third-party budget
Accessibilitykeyboard table/filter/dialog/notification walkthrough
Securityserver authorization proof for role-based actions
Reliabilitypanel failure matrix and export idempotency
Observabilityroute, release, tenant class, experiment, trace id

7. Failure modes

FailureBehavior
one dashboard panel API times outpanel error only; shell remains usable
filter query params are invalidnormalize or show recoverable error
permissions change mid-sessionprotected mutation fails closed
export job fails after navigationjob status route and notification explain failure
table causes INP regressionroll back table enhancement flag

8. Tradeoffs

Rejected:

  • full CSR: weak first useful state and harder data/permission orchestration
  • microfrontends immediately: operational cost not justified unless teams need independent deploy/runtime isolation
  • one global store: hides ownership and mixes URL/server/form/UI state

Chosen:

  • modular frontend monolith with explicit boundaries
  • BFF for frontend-specific contracts
  • route-specific rendering
  • platform defaults for auth, telemetry, flags, and design system

Strong close

I would launch with dashboard home, customer detail, and order search first, keep exports behind a separate flag, and review the quality scorecard weekly during beta. The architecture is successful if product teams can add features without cross-feature imports, critical route Web Vitals stay within budget, role-based actions are server-authorized, and partial API failures degrade locally instead of breaking the shell.