Portfolio demo
DeskLab
A 3D workspace builder backed by Shopify. One planner validates budget and fit; shared Redis quotas and cart checks protect the checkout path.
- Role
- Designer and developer
- Built with
- Next.js, TypeScript, React Three Fiber, Shopify Storefront API, Redis, Playwright
- Status
- Portfolio demo, live

The problem and what I built
Putting a desk setup together means holding a budget, the width of the space and whether the pieces fit, all at once. DeskLab helps a visitor assemble a compatible setup within their space and budget, then look around it in 3D.
I built the 3D storefront, plain-language preference flow, planner and validator, and Shopify checkout integration. The engineering problem was preserving product choices through model errors, stale stock, upstream outages and graphics failures.
What a visitor does
- Describe the space, budget and style in plain words.
- Get a proposed setup and look around it in a 3D scene.
- Swap pieces and open “Why this setup fits” to inspect the current budget, dimensions and compromises.
- Copy a link that reopens the same setup in another browser.
- Add pieces to the bag and continue to Shopify's hosted test checkout.

The hard choice: a narrow job for AI
The model interprets what a visitor wants. Deterministic application rules decide whether a setup fits their space and budget. The model returns validated preferences, never product IDs, prices or purchase actions.
Recommendations and manual swaps use the same validator, which also explains the current selection. Builder edits invalidate pending recommendations, so late results cannot overwrite newer choices. Shopify stays the authority for connected prices, availability, carts and payment totals.
Source at the reviewed commit:Validated AI preferencesThe shared validatorCurrent-selection explanationDiscarding stale results
Boundaries and who decides
The table follows five responsibilities from the brief to checkout. Choose a boundary to inspect its input, decision and output.
A correctness example: combined footprints
A 100 cm desk inside a 140 cm space still has only 100 cm of tabletop. Checking each accessory against the space, or against the desk on its own, was not enough. The validator checks the combined footprints and clearance against the dimensions configured for the selected desk in the demo catalog.
The fit model is deliberately simple: rectangles in a fixed two-row layout, two items per row, with 4 cm of clearance between them. It does not assess ergonomics, load ratings, electrical compatibility or unusual room shapes.
Source at the reviewed commit:Combined footprint calculationFit regression cases
Protecting the service and checkout
One Redis Lua script checks the client-minute, global-minute and global-day quotas before incrementing any counter. Server instances share these limits, and production cannot substitute per-process counters when Redis is unavailable.
Checkout validates the response as well as the request. The server rejects Shopify warnings, changed cart lines and quantity mismatches before returning a checkout URL. A successful API response alone does not prove the cart matches the visitor’s choice.
Health probes share an in-flight Redis PING, cached for 30 seconds per instance, without calling Shopify or the model. Application logs record a fixed event, route, status and duration, without briefs, cart tokens or raw IPs.
Source at the reviewed commit:Atomic Redis quotasLua reservationCart response validationCoalesced health probesBounded application logs
When something fails
Each failure has a defined behavior, and none of them quietly changes what a visitor buys.
- The AI model times out or errors
- A labelled rules fallback produces the preferences instead.ai.ts
- Shopify is configured but unavailable
- The visitor sees an error. The fictional local catalog is never presented as live inventory.shopify.ts
- Stock or the cart changes before checkout
- The server rechecks stock and verifies the returned cart lines and quantities. A warning or mismatch stops the handoff. It does not reserve inventory, so hosted checkout stays authoritative.shopify.ts
- A quota is exhausted or Redis is unavailable
- Exhausted quotas return 429 with Retry-After. Missing or unavailable protection returns 503 and stops the request, without a local counter fallback._utils.ts
- WebGL fails
- A usable SVG configurator replaces the 3D scene.workspace-scene.tsx
How it was checked
Local verification on November 18, 2026 covered the builder changes and shared quotas. Earlier hosted checks retain their original dates.
- Lint, TypeScript and the production build passed, with 109 domain/backend tests.
- 49 Chromium/WebKit browser checks passed; one existing WebKit pixel check was intentionally skipped. Regressions forced late responses to arrive after edits and exercised the setup explanation.
- A separate Redis suite passed 15 tests across four worker processes, covering 14 quota, atomic-denial, time-window, expiry and failure scenarios.
- November 15 hosted checks covered AI recommendations, sharing, declined and successful test payments, and storefront return. The documented Shopify orders were Paid, Unfulfilled and Test.
- November 16 and 17 scheduled smoke runs checked homepage/headers, readiness, the connected catalog and an empty-brief rules recommendation. They made no model call or cart.
The Redis suite ran unchanged production Lua through a local socket adapter, with direct handler calls and controlled time. It checked production TTLs before shortening fixture expiry. Hosted Upstash transport and production throughput remain untested; other service tests use test doubles. The November 18 checks made no model calls or orders.
Source at the reviewed commit:November 18 checks and scopeHistorical hosted checksScheduled smoke, Nov 16Scheduled smoke, Nov 17
Tradeoffs and limits
- Exhaustive planning stays inspectable for a curated 18-product catalog. A larger catalog would need a candidate search step in front of the same validation boundary.
- Inventory rechecks do not reserve stock, and orders are not reconciled through webhooks.
- Share links are validated, not private.
- Footprints use a bounded, simplified geometry model.
- Fixed-window quotas share workload limits across instances. Denied requests still use Redis, so these are not provider billing caps.
What carries over to infrastructure work
- Put each decision where its authority lives. The model interprets, the application validates, and Shopify owns prices, stock and payment.
- Validate both sides of an integration: model output before planning, and the returned cart before handing off to checkout.
- Give every path the same check. Generated and manual selections share one validator, so there is one place to fix and test.
- Make failure states explicit. Exhaustion, unavailable protection, upstream failure and a labelled rules fallback each have a defined response.
- Turn observed mistakes into regression cases. “1.2 meters” once became $1.20; the corrected parser separates measurements from money. Its small fixture set does not establish general language accuracy.
Source at the reviewed commit:The parser regression