Garage64
A digital garage and peer-to-peer marketplace for 1:64 diecast collectors in India. Photograph a car from three angles, get an AI-generated 3D model you can spin, and put it up for sale with one toggle.

Overview
Garage64 is a digital garage and marketplace for 1:64 diecast cars like Hot Wheels, Tomica, Mini GT and Inno64. A collector photographs a car from three fixed angles and gets an AI-generated 3D model on their public garage page. Any car in the garage can be put up for sale, or taken back off sale, with one toggle. It launches in India with prices in rupees, meetup handovers, auctions and a moderated community feed.
The frontend is Next.js 16 on Vercel. The backend is a standalone Fastify API with a background worker, on Render, backed by Supabase (Postgres, Auth and Storage).
The problem
Diecast collections live in blister packs on a wall or in boxes in a cupboard. The places to sell them online are generic listing grids where a ₹1,500 Ferrari F40 looks exactly like a phone charger. Collectors want to show their cars, and buyers want to see the exact car, not a stock photo.
So we made one product decision early: the 3D garage is the pitch. Chips, scratches and card creases are condition disclosures on a listing, never the marketing.
What I built
- 3D garage. Three photos (front three-quarter, side, rear three-quarter) become an interactive 3D model, shown with
model-vieweron a public garage page with a pinned turntable. - Marketplace. Search with filters (brand, condition, price, buy-now or auction), listing pages with the real photos first and the 3D view as a labelled "AI-generated preview".
- Server-side grading. The seller fills a condition checklist and the server derives the grade, so a seller can't just type "Mint".
- Orders with buyer protection. An explicit order state machine with a dispute window, auto-confirm sweeps, meetup handovers and seller ratings.
- Auctions. Binding bids, minimum increments and 5-minute anti-sniping, closed by a worker sweep into a normal order.
- Messaging and community. Per-listing threads with contact details masked, plus a feed that refuses posts trying to take sales off-platform.
- Admin. Payouts, reports, disputes, a 3D job queue, feature switches, soft-deleted content and an audit log.
Screens

Architecture
The browser never talks to the database. Every request goes through the Fastify BFF ("backend for frontend"), which owns sessions, validation, rate limits and every write.
flowchart LR
B[Browser] -->|same-origin /api/*| N[Next.js 16<br/>Vercel]
N -->|rewrite| F[Fastify BFF<br/>Zod · sessions · rate limits]
F -->|service role| DB[(Supabase Postgres<br/>RLS on, direct access revoked)]
F -->|enqueue| Q[pg-boss queue<br/>same Postgres]
Q --> W[Worker]
W --> M[Meshy]
W --> T[TRELLIS<br/>Hugging Face Space]
W --> S[(Supabase Storage<br/>optimised GLBs)]- Why a BFF instead of Next.js route handlers. It keeps domain logic, auth and job dispatch out of the rendering layer, and lets the API and worker scale separately. The cost is an extra network hop, which the same-origin
/api/*rewrite hides from the browser and keeps the session cookies first-party. - Zero-trust database. One migration revokes every privilege on public tables and functions from the
anonandauthenticatedroles. Before that, a signed-in user could have used their own token against the auto-generated REST API to read every email or make themselves admin. Row-level security stays on as a second layer. - No Redis. The job queue (pg-boss) lives in the same Postgres. That's one less thing to run.
System design
The 3D pipeline
3D generation is slow, expensive and rate-limited, so it never blocks a seller. Photos and the listing publish immediately, and the model arrives later.
sequenceDiagram
participant A as Admin
participant API as Fastify
participant Q as pg-boss
participant W as Worker
participant P as Meshy / TRELLIS
A->>API: POST /listings/:id/3d
API->>Q: enqueue (dedupe on photo-set hash)
Q->>W: job
W->>P: submit 3 photos (primary provider)
P-->>W: GLB (or failure)
alt provider failed
W->>P: one try on the fallback, then stop
end
W->>W: optimise GLB with glTF Transform
W-->>API: model ready, listing shows the 3D tab- Meshy first, TRELLIS as the fallback. Once the monthly Meshy credit budget is spent, routing goes to TRELLIS and never back. A retried job reuses its provider task ID, so it's never billed twice.
- One try per provider. An early version bounced between the two providers forever when both failed, creating 92 failed jobs in about two minutes. Now each photo set gets exactly one attempt per provider.
- 3D is admin-triggered. Publishing never starts a job, which keeps costs predictable and stops spam.
Orders as an explicit state machine
stateDiagram-v2
[*] --> pending_payment
pending_payment --> paid_held
paid_held --> shipped
paid_held --> cancelled_refunded
shipped --> delivered
delivered --> completed: window ends or buyer completes
delivered --> disputed
disputed --> refunded
disputed --> releasedEvery status change goes through one pure, tested transition function, and the write is conditional on the status that was read. That closed a real race found in an audit, where two buyers could order the same car in the same instant. Listings and 3D jobs got the same treatment.
How it was built
Garage64 was built with AI coding agents, with me directing and reviewing. OpenCode, on a free DeepSeek model, scaffolded the first backend. An Opus agent oversaw it and verified every step, while another built the frontend in parallel. Later, Opus agents audited the codebase and found 8 security issues, including a rate-limit bypass through a spoofable header, plus the double-order race. All of them were fixed.
The full story, including what the agents got wrong, is in How I Work as an Agentic Engineer.
Decisions & trade-offs
- 3D is a preview, not proof. Listings open on the real photos. The 3D tab is labelled as an AI-generated preview, and condition flaws are pinned to zones so they survive a model regeneration.
- Soft delete everywhere. Removing a car, post or comment hides it but keeps orders, ledgers and audit logs intact. Admins can restore it or purge it permanently.
- The 18+ check happens at the first listing or purchase, not at sign-up. That means less friction for people who only want a garage.
- Money in integer minor units with a currency code, formatted in one place, because rupees have 2 decimal places and yen have none.
- Free-tier hosting. The worker runs inside the API process on Render's free tier. The trade-off: background sweeps pause when the service sleeps.
What I'd do next
- Online payments through Razorpay Route. Today only meetup orders run end to end.
- Better 3D quality checks before a model goes live, and a poster render for listing cards.
- Scale-aware browsing, so collectors beyond 1:64 get proper filters instead of just a welcome message.