CASE STUDY · Next.js (production SaaS) · 2026
RetiredSets
A production-grade LEGO buyback SaaS with guided sell wizard, admin counter-offers, and automatic Wise payouts.
Production

- RetiredSets
- E-commerce / LEGO secondary market (UK)
- Next.js (production SaaS)
- Next.js 14, TypeScript, PostgreSQL, Prisma, NextAuth, Wise API, BrickLink API, Render, Docker
- 2026
- Custom web apps & SaaS
The brief
RetiredSets needed a sell-only LEGO buyback platform built from scratch. Customers list retired sets through a guided wizard; admins review and counter-offer; payouts run automatically via Wise when a customer accepts. Bank details had to be handled with proper encryption, a real fintech-adjacent build, not a marketing site dressed up.
What we did
- Designed and built the full platform in Next.js 14 with TypeScript.
- Integrated the BrickLink API (OAuth 1.0) with a two-tier cache and persisted pricing.
- Built Wise API payouts with webhook auto-reconciliation, no manual 'mark as paid'.
- Implemented AES-256-GCM encryption for customer bank details, transparent to application code.
- Built the multi-item sell wizard, admin counter-offer workflow with audit trail, and customer dashboard.
How we built it
The hard part is matching real-time pricing to real inventory without hitting BrickLink's rate limits. We built a two-tier cache, a hot in-memory cache for the most-requested items refreshed every few minutes, and a warm Postgres-persisted cache for the long tail refreshed lazily, giving sub-100ms quotes for common items and graceful degradation for obscure sets. Wise payouts run on a webhook architecture: state changes call our signed webhook and move the submission to its next state automatically. Bank details are encrypted with AES-256-GCM behind a Prisma extension, so application code reads and writes plaintext while storage stays encrypted, even in backups.
Authentication runs on NextAuth with credentials plus email, and admin access is gated by a role check at the middleware layer rather than per-route, so privileged surfaces fail closed by default.



The result
The platform is live in production. Customers sell retired sets through the guided wizard; admins counter-offer; the system handles everything else end to end through to bank transfer. The architecture supports planned growth, more SKU coverage, geographies, and payout methods, without rewriting the core.
AES-256-GCM
Tech stack
- Next.js 14
- TypeScript
- PostgreSQL
- Prisma
- NextAuth
- Wise API
- BrickLink API
- Render
- Docker
07, START A PROJECT
Want work like this?
Tell us what you're building. We reply within 4 hours during UK business hours.