Case Study

← Back to selected work

AI Infrastructure Product Workflows

Turning backend-heavy AI infrastructure capabilities into usable customer-facing and internal product workflows.

Summary

Role

Frontend lead for AI Services, frontend architecture, product workflow design, API contract collaboration

Scope

Model APIs, deployments, GPU resources, notebooks, storage, AI agents, analytics, billing, permissions, admin operations

Stack

React, TypeScript, REST APIs, dashboard UI, internal tooling

Focus

State modeling, API contracts, permissions, async workflows, operational usability

TL;DR

I helped turn EdgeCloud AI Services from separate infrastructure capabilities into a coherent product system for customers and internal operators.

Context

Theta EdgeCloud exposed AI infrastructure workflows across model APIs, notebooks, GPU resources, storage, agents, usage, billing, permissions, and internal admin operations.

The frontend challenge was turning backend-heavy capabilities into safe customer workflows and reliable internal operator tools.

View public EdgeCloud site →

Problem

The challenge was not just building screens. The product needed clear paths around configuration, validation, permissions, async provisioning states, usage visibility, billing context, and failure recovery.

The main risks showed up as:

Inconsistent statesScattered permissionsOperational handoffs

Ownership

I led most frontend implementation for EdgeCloud AI Services, covering customer-facing AI infrastructure flows and the internal admin dashboard used by support, QA, operations, and engineering.

My work often sat between product intent and platform constraints: deciding what should be visible to users, what needed backend confirmation, what belonged in reusable UI patterns, and where internal tooling needed different assumptions from customer-facing workflows.

Product system map

Product System Map Customer surfaces / shared layer / internal ops

Customer-facing workflows

Model APIsNotebooksGPU ResourcesStorageAI Agents

Shared product layer

Org / Project ContextPermissionsAsync StatesResource LifecycleUsage Context

Internal admin ops

Account LookupFeature FlagsModel / Agent ConfigVM / Storage SettingsPlatform Metrics

Separate infrastructure capabilities became one product system through shared org/project context, permissions, async states, lifecycle patterns, and admin operations.

Multi-tenant context consistency

EdgeCloud scopes product data by organization and project. Requests, routes, persisted selection, and effective role all depend on that pair. Updating each value independently could briefly publish Org B / Project A1—an invalid context that React effects and API calls could act on, not just a visual flicker.

State invariant: whenever the UI renders tenant data, issues a tenant-scoped request, or makes a permission decision, the organization, project, route, and effective role must belong to the same validated tenant context.

Tenant context transition Independent updates / atomic publish

Before: independent updates

A / A1
  ↓ organization updates
B / A1   ← invalid
  ↓ project updates
B / B1

After: validated transition

Committed  A / A1
  ↓ select Org B
Pending    validate B / B1
  ↓ atomic publish
Committed  B / B1

The previous context stays committed until projects, effective role, target project, and route can move together.

Publish one validated context

Load target projects and role independently, validate the project, then publish organization, project, and effective role atomically. Keep tenant route content closed until Redux context and routing represent the same completed transition.

Protect async ownership

Scope roles by organization, order same-organization role requests, and bind transition ownership to both request and session identity. Treat persisted IDs as restoration hints; ignore stale success and failure, and protect only caches where tests exposed stale cross-tenant data reuse—without a broad cache rewrite. Frontend role checks remain UX gates; backend authorization stays authoritative.

Verify invariants, not action counts

Tests assert that A/A1 → B/B1 never exposes B/A1, and that a late B response cannot replace a newer completed C transition. Coverage also includes stale role responses, invalid persisted context, session changes, route mismatches, and naturally project-less organizations.

GPU lifecycle correctness

GPU nodes are long-running asynchronous resources. A create or start request can succeed before the resource appears through the list API, while provisioning may continue for several minutes. Polling, navigation, and user mutations can all be active at the same time.

The central problem was not polling every few seconds. It was deciding which asynchronous result was still allowed to change the UI.

Technical deep dive Original failure modes

Inconsistent lifecycle semantics

Readiness was inferred from raw backend fields. Missing status could stop polling too early, while failed or unknown observations could continue indefinitely.

Async work outliving its owner

A detail request could begin for one resource, outlive navigation, then commit old state or schedule another polling cycle.

Mutation overwritten by an older query

A request could still belong to the current page while carrying a snapshot from before a stop or delete mutation.

GET A: Running
→ Stop succeeds
→ GET B: Stopped
→ old GET A resolves
→ UI returns to Running

Create success mixed with visibility

An immediate list miss after a successful create did not prove the write failed; list visibility and runtime readiness were separate events.

POST succeeds
→ immediate list GET misses
→ create outcome is still valid
Four-layer design Semantics / ownership / ordering / reconciliation
01 · Lifecycle semantics
02 · Async ownership
03 · Mutation ordering
04 · Creation reconciliation

01 — Normalize lifecycle semantics

Backend response shape, resource lifecycle, capability readiness, and transport health are separate concerns. Explicit boundaries removed contradictory polling behavior; transport failure never becomes a lifecycle state, and unknown or degraded observations consume a bounded budget.

PENDINGPROVISIONINGRUNNINGDEGRADEDSTOPPEDFAILEDUNKNOWN

02 — Give async work an owner

Each list or detail cycle captures an owner generation. Only the current generation may commit Redux responses, update local presentation, consume retry budgets, or schedule more work.

List · project Running detail · project + runtime identity Stopped detail · project + stable identity

03 — Order queries behind mutations

A request can still belong to the current page and be stale. Successful start, stop, delete, and rename operations advance a project-scoped mutation epoch, invalidating snapshots that began before the mutation. A response may commit only when its owner generation and captured mutation epoch are both current.

Query A begins
→ mutation succeeds
→ project epoch advances
→ Query A finishes
→ snapshot rejected

The epoch stays in memory because it does not drive rendering. Its scope is project-level because a list response replaces the project snapshot.

04 — Reconcile creation by stable identity

POST success, list visibility, and runtime readiness are distinct. A successful response retains BaseID; reconciliation matches only that stable identity—never a display name, timestamp, newest row, or timing heuristic.

POST succeeds
→ invalidate pre-create snapshots
→ retain stable identity
→ owned list refresh
→ bounded reconciliation
→ exact resource becomes visible
→ normal lifecycle polling

Visibility completes reconciliation even while the resource is pending or provisioning. The same owned polling loop handles both phases.

Ownership principle

Cancellation saves resources. Ownership protects correctness. AbortController reduces obsolete work, but correctness does not depend on cancellation succeeding.

Correctness model Meaning / ownership / authority / visibility
Backend responseRaw status
Lifecycle semanticsNormalized meaning
Polling policyCapability readiness
Async requestCaptured snapshot
Owner generationCurrent UI scope
Mutation epochCurrent project version
Commit authorityAccept or reject
Create responseConfirmed write
Stable identityBaseID
ReconciliationBounded visibility
Lifecycle pollingRuntime readiness

Handling ambiguous create outcomes

A rejected browser request does not prove the server made no change. If the POST reached the backend but its response was lost, an automatic retry could create a duplicate. The frontend invalidates pre-request snapshots, performs an observational refresh, attributes no row without a returned stable identity, does not automatically retry, and tells the user the outcome could not be confirmed.

An ambiguous write is different from a confirmed write failure. Exactly-once creation cannot be guaranteed by frontend code alone.

Verification & boundaries

Make race conditions deterministic

Deferred-promise and fake-timer tests reproduce concurrency failures without timing-sensitive integration behavior. The GPU-focused suite covers 100+ deterministic lifecycle cases, including:

Resource A → B → A generationsCompletion after unmountPre-mutation query after stop / deleteDeleted-row resurrectionManual refresh during an in-flight pollDelayed list visibility after createReconciliation transport failuresAmbiguous create outcomes

Keep concurrency boundaries lightweight

  • Keep the project mutation epoch in memory because it is concurrency metadata, not presentation state.
  • Make lifecycle polling single-flight instead of adding request IDs for overlaps that can be eliminated structurally.
  • Use AbortController as an optimization, not the correctness guarantee.
  • Avoid optimistic lifecycle transitions; authoritative backend reads remain the source of truth.
  • Reuse one owner-controlled loop for creation reconciliation instead of adding another timer.
  • Do not attempt frontend-only exactly-once creation.

Preserve the frontend / backend boundary

The frontend can reject obsolete observations, but it cannot provide these guarantees on its own:

Exactly-once creationSafe automatic retry of an ambiguous createWhen a write must become list-visibleWhen a visible resource must become runtime-ready

Stronger guarantees require backend contracts such as idempotency keys, operation IDs, or explicit read-after-write behavior.

Key Decisions

Make workflow states explicit

Model complex flows around clear states such as draft, validating, provisioning, ready, failed, disabled, and permission-blocked instead of treating them as generic loading states.

Design customer and operator paths differently

Customer-facing pages need confidence and guardrails. Internal tools need fast lookup, safe defaults, status visibility, and recovery paths.

Push repeated parsing to the boundary

Work with backend engineers so analytics, billing, configuration, and admin views can share stable response shapes.

Impact

Turned AI Services into a more coherent self-serve product across model APIs, notebooks, GPU resources, storage, agents, and billing.

Built the internal admin dashboard from scratch and made common support, QA, ops, and engineering workflows self-serve.

Created reusable frontend patterns for permissions, async states, configuration forms, validation, and recovery paths.

Hardened GPU resource workflows around explicit lifecycle semantics, stale-response protection, mutation ordering, and bounded creation reconciliation.

Improved the boundary between customer-facing product areas and internal operations.

Trade-offs

  • A more explicit state model adds upfront structure, but makes complex workflows easier to debug and extend.
  • UI-ready API contracts require backend alignment, but reduce duplicated frontend parsing.
  • Internal admin tools can move faster than customer-facing pages, but still need permission clarity, auditability, and safe failure handling.

Closing

The core challenge was not rendering AI infrastructure data. It was making complex platform capabilities feel understandable, operable, and trustworthy.