Skip to main content

Capstone — real-time operations dashboard

Build an operations dashboard for live orders, incidents, devices, jobs, or transactions. Users should filter/search, open details, mutate status, receive live updates, understand connection health, preserve navigational filters, recover from failures, and complete the primary flow by keyboard.

Architecture target​

Keep transport, live subscriptions, feature state, and React UI as separate responsibilities
Server / API
authoritative records + permissions
Data adapter / external store
normalize · subscribe · snapshot · reconnect
Feature ownership
selection · workflow · URL coordination
React UI
filters · table · details · mutation feedback

The primary design question is: which system owns each value, and who should subscribe to it?

State inventory​

Which system owns this dashboard value?
Search/filter/date/sort that should survive history/shareURL
Popover/editor/focus/draft stateLocal UI state
Selected record or bulk workflowFeature-scoped client state
Records/details/totals/permissionsServer/data-cache state
Socket health/cursor/live snapshotExternal live store

Avoid one mega Context that mixes all update frequencies and ownership categories.

Live connection adapter​

type ConnectionState =
| { status: 'connecting' }
| { status: 'connected'; lastEventAt: number }
| { status: 'reconnecting'; attempt: number }
| { status: 'offline'; reason?: string };
Components should consume a stable live-data contract
WebSocket/EventSource
transport details
External store
subscribe · getSnapshot · normalize · reconnect
UI
connection state + records

This is a good useSyncExternalStore exercise when the live state truly exists outside React.

Identity under live reordering​

{records.map(record => (
<RecordRow key={record.id} record={record} />
))}

Use persistent record IDs. Test that an inline editor stays attached to the same record while live events insert, remove, sort, or filter rows.

const [query, setQuery] = useState('');
const deferredQuery = useDeferredValue(query);
Separate input urgency from expensive downstream rendering
query
urgent controlled input
deferredQuery
large result tree may lag

Deferral does not cancel remote requests. The data layer still owns stale-response/cancellation behavior.

Scaling the list​

What is actually limiting the list?
Too many records transferred/filtered client-sideServer pagination/filtering/sorting
Too many mounted DOM rowsWindowing/virtualization
Every live tick updates broad consumersNarrow subscriptions/state ownership
Row rendering is measured as expensiveOptimize the verified row/update path

Measure before choosing.

Status mutation flow​

Model a status sequence such as Open → Investigating → Resolved.

1User intent
2Pending / optimistic projection
3Server validation + authorization
4Canonical result
5Reconcile / rollback
6Live event convergence

Protect duplicate submissions, runtime input validation, authorization, rollback, and accessible error feedback. The server record remains canonical.

Error and loading architecture​

Different failures deserve different containment
Data/live failure
local retry/reconnect UI
Render failure
feature-level Error Boundary
Shell failure
root fallback only when app is unusable
Keep a stable dashboard shell while independent regions load
Dashboard shell
orientation + filters
Summary
independent reveal
Results
table/list boundary
Details
record detail boundary

Accessibility contract​

Connection health must not rely on color alone. Filters need visible labels. Row actions need meaningful names. Keyboard users must reach details and restore focus appropriately. Loading and live announcements should preserve orientation and avoid noisy live regions. A virtualized grid still needs a documented accessibility strategy.

Testing portfolio​

Unit
reducers · event normalization · permissions · URL serialization
Integration
filters · deferred search · details · optimistic success/rollback · reconnect · keyboard
E2E
primary mutation flow · reconnect · unauthorized mutation · keyboard-only journey

Performance investigation​

Intentionally create a broad live update, unstable row props, and expensive formatting, then follow an evidence loop:

1Reproduce
2Profile
3Find dominant cost
4Narrow ownership/work
5Measure again

Production evidence​

Instrument release IDs, connection failures, mutation failures, latency, retry/reconnect frequency, and trace IDs without logging sensitive record payloads.

A strong capstone explains not merely that the dashboard works, but why its ownership, subscription, failure, and scaling boundaries remain understandable under live production pressure.