Skip to content
Atreyu Sutton
The Classic Motor Market home page: the rear of a dark green Porsche behind the headline "Drive your next adventure", with Browse Listings and List a Vehicle buttons and an event announcement bar across the top
The home page. The site's own branding reads Classic Motor Market.

Software

FuelFed Motor Market

A members-only marketplace for European collector cars. I was the sole engineer, and I rewrote it in Next.js and TypeScript on a 9-model PostgreSQL schema.

Live siteclassic-motor-market.atreyusutton.workers.dev

  • Next.js
  • TypeScript
  • PostgreSQL
  • Prisma
  • Cloudflare Workers
  • AI-assisted development
Prisma models
9
Steps in the listing wizard
5
Commits on the rewrite
37
Hosting targets
2

Counted from the rewrite's repo, November 2026.

FuelFed Motor Market and Classic Motor Market are the same project. The screenshots read Classic Motor Market, which is the name the rewrite was built under. It is a members-only classifieds site for European collector cars: fixed-price listings, no auctions. I was the sole engineer.

I built it twice. The first version, in July and August 2025, was React on Supabase. In November 2025 I started over in Next.js and TypeScript on a 9-model PostgreSQL schema. The screenshots show the rewrite.

There is no machine learning model in this product. It is on this site because of how it was built: from written specs and a context file that an AI coding agent works against, on top of the data modeling, access rules and import pipeline that ML work also needs. Four ML extensions are listed near the end as planned, not built.

01

Spec

LaneSoftware
StatusRunning
RoleSole engineer: data model, auth, listing workflow, media pipeline, admin tooling, deployment
TimelineJuly 2025 to April 2026, plus a hosting port in November 2026
Build stateWorking build with sample listings, deployed for demonstration. Payments are placeholders.
StackNext.js 16 (App Router, Server Components, Server Actions), React 19, TypeScript, Prisma 6, NextAuth v5, Zod, react-hook-form, Tailwind CSS v4, shadcn/ui
DatabasePostgreSQL on Neon, 9 Prisma models
Media and emailCloudflare Images, Resend
HostingVercel, then Cloudflare Workers through the OpenNext adapter
First versionReact, Vite and Supabase, July to August 2025

02

State

What exists today

This is a working build with sample listings, deployed for demonstration. On a first visit the site shows a notice that it is a development version.

Membership and listing fees are placeholder checkboxes, so no money moves. The section on what is not built lists the rest.

03

Method

Written specs, then an AI coding agent

The planning docs date from December 2025, the same week as the first feature commits. They cover the product, the stack, the database design, the listing flow and a build plan.

I later folded them into one context file, CLAUDE.md, which is the reference an AI coding agent reads before it touches the code. It covers the architecture, the schema, the business rules and a table of what is not built yet. Keeping that file current is the real work: a model can only be as right as the context it is given.

The repo shows the split. I am the only committer, and 18 of the 37 commits on the rewrite carry a Claude co-author trailer. The architecture, the data model, the privacy rules and the trade-offs were my decisions, and I reviewed what went in.

04

Two versions

The first version, then the rewrite

The first version ran from July to August 2025: React and Vite on the front, Supabase behind it. It had a bulk import that checked every vehicle for required fields before inserting it, and a SQL migration that added indexes for filtering plus the full-text search index below.

The rewrite moved to a typed Prisma schema of 9 models: users, listings, listing media, saved listings, ads, events, and three for auth.

First version: supabase/migrations/001_enhance_vehicle_listings.sql
-- Create full-text search index for searching across text fields
CREATE INDEX IF NOT EXISTS idx_vehicle_listings_search
ON vehicle_listings
USING gin(to_tsvector('english',
  COALESCE(make, '') || ' ' ||
  COALESCE(model, '') || ' ' ||
  COALESCE(description, '') || ' ' ||
  COALESCE(vehicle_story, '') || ' ' ||
  COALESCE(key_features::text, '')
));

Search has not been carried over to the rewrite yet. That index belongs to the first version only.

05

Selling

A 5-step listing wizard

A seller goes through basic info, options and modifications, condition and history, images, then review and publish. Every step is validated with Zod and react-hook-form. A listing can be saved as a draft, published, and edited later.

Photos are dragged in and dragged to reorder, up to 50 per listing, and the first one becomes the cover. They are stored in Cloudflare Images. The database keeps image IDs only, never URLs.

Step 1 of 5, filled with sample data
A member's listings. All listings are sample data.

06

Access

Three tiers, and privacy by default

Access is split into public, member and admin. New listings go to members first. During that window everyone else sees a placeholder card marked as a member exclusive. The window is set to 10 minutes in this build.

Seller email addresses are never shown. Contact seller relays the buyer's message by email with reply-to set to the buyer, so the seller answers from their own inbox. The VIN is hidden from signed-out visitors.

Login is NextAuth v5 with JWT sessions and bcrypt-hashed passwords. Routes are protected at the proxy layer and again in layouts, and server actions check the session and ownership before they change anything.

TierWhat it can do
PublicBrowse listings once the early access window has passed, and open detail pages. No VIN.
MemberEverything public, plus early access, the full VIN, contacting sellers, a watchlist and listing vehicles.
AdminEverything a member can, plus the admin console: all listings, users and roles, events and advertising.
Signed out: the VIN row asks you to sign in
Signed in: the full VIN. This capture is from the seller account, so the top button reads View My Listings.

The admin console manages every listing (feature, mark sold, override fee status, delete), users and roles, and the events and advertising that drive the announcement bar across the top of the site.

07

Import

The bulk-import pipeline

Sample vehicles do not get typed in by hand. A script reads one text file of vehicle records and one folder of images per vehicle, and turns them into listings. It runs dry by default, so nothing is written until I pass a flag.

A text file of vehicle records and a folder of images per vehicle are parsed, normalized and matched to their image folders. A dry run stops there. A real run skips vehicles that already exist, uploads the images to Cloudflare Images, and inserts one listing with its media rows.
  1. Input

    One text file of records and one image folder per vehicle. The seed folder holds 19 vehicles and 186 images.

    The run stops if the seller account does not exist.

  2. 1Parse

    Splits the file into vehicle blocks and reads key and value lines. Narrative fields can run over several lines.

  3. 2Normalize

    Yes, true and 1 become booleans. Commas come out of numbers. Prices round to whole dollars. Escaped line breaks are restored.

  4. Then, typed vehicle records:

    3Match images

    Builds a slug from year, make and model and looks for a folder with that name. No folder, and the vehicle is skipped with a warning.

    A dry run prints the plan and stops here.

  5. Then, only with the run flag:

    4Deduplicate

    Skips any vehicle whose VIN or chassis number is already on a listing.

  6. 5Upload

    Each image goes to Cloudflare Images. The first file in the folder becomes the cover.

  7. 6Insert

    One listing row, plus one media row per image holding the image ID.

scripts/import-bulk-vehicles.ts, the deduplication step
if (vehicle.vehicleIdentifier) {
  const existing = await prisma.listing.findFirst({ where: { vehicleIdentifier: vehicle.vehicleIdentifier } });
  if (existing) {
    console.log(`Skipping ${vehicle.blockLabel} (${slug}) - listing already exists with vehicleIdentifier ${vehicle.vehicleIdentifier}`);
    continue;
  }
}

08

Porting

One database client, two runtimes

The app was first deployed on Vercel. In November 2026 I ported it to Cloudflare Workers with the OpenNext adapter, to host this build.

Workers do not allow a database connection to be reused across requests. On Node the usual pattern is the opposite: one shared Prisma client for the whole process. So on Workers each request now gets its own client through a driver adapter, and on Node the shared client stays.

The 26 files that import the client did not change. They still import one object named prisma. That object is now a proxy that picks the right client on every call.

A request reaches the Cloudflare Worker, which resolves a Prisma client that belongs to that request only, which connects to PostgreSQL. On Node and Vercel the same import returns one shared client instead.
  1. Request

  2. Cloudflare Worker

    The Next.js app, built with the OpenNext adapter.

  3. Then, import { prisma }:

    Per-request client

    Created on first use and kept in a WeakMap keyed by the request's execution context.

    On Node and Vercel the same import returns one shared client.

  4. PostgreSQL

    Hosted on Neon.

lib/prisma.ts
// Workers forbid reusing a database connection across requests, so on Cloudflare
// each request gets its own client, keyed by that request's execution context.
const clientsByRequest = new WeakMap<object, PrismaClient>()

function getWorkerClient(): PrismaClient {
  const requestKey = getCloudflareContext().ctx as object
  let client = clientsByRequest.get(requestKey)
  if (!client) {
    const connectionString = process.env.DATABASE_URL
    if (!connectionString) {
      throw new Error('DATABASE_URL is not set')
    }
    const adapter = new PrismaPg({ connectionString, maxUses: 1 })
    client = new PrismaClient({ adapter })
    clientsByRequest.set(requestKey, client)
  }
  return client
}

// ...

// Existing code imports a `prisma` singleton; this proxy keeps that API while
// resolving the right client (per-request on Workers, global on Node/Vercel).
export const prisma = new Proxy({} as PrismaClient, {
  get(_target, property) {
    const client = isCloudflareWorker ? getWorkerClient() : getNodeClient()
    const value = Reflect.get(client, property, client)
    return typeof value === 'function' ? value.bind(client) : value
  },
})

09

Mobile

The same pages on a phone

The layout is responsive. These are the home page, the catalog and a listing at phone width.

Home
Catalog. Listings are sample data.
Listing, signed out

10

Not built

What is not built

Placeholders are labeled as placeholders, in the app and here.

PaymentsMembership and listing fees are placeholder checkboxes. The Stripe SDK is installed and the checkout route is a skeleton.
Search and filteringNot in the rewrite.
Email verification and password resetNot built.
Video uploadNot built.
Admin analyticsA placeholder page.

11

Next steps

Where ML would go

None of these exist. They are the four places I would add a model.

  • Listing quality assistant

    Planned, not built

    An LLM pass over a draft listing before it is published. It would flag missing history, vague condition claims, and places where the description disagrees with the spec fields.

  • Semantic search

    Planned, not built

    Embeddings over the listing narratives, so a query like "numbers-matching air-cooled driver under $80k" works without exact keywords.

  • Photo checks

    Planned, not built

    A vision model that checks the required angles are present (exterior, interior, engine bay, undercarriage) and picks the best cover image.

  • Price guidance

    Planned, not built

    A regression baseline on comparable sold listings, with honest uncertainty, because collector-car data is sparse.

12

Results

In numbers

Schema9 Prisma models on PostgreSQL
CodeAbout 9,900 lines of TypeScript in 105 files
History17 commits on the first version, July to August 2025. 37 on the rewrite: 36 from November 2025 to April 2026, and the Workers port in November 2026.
Listing wizard5 steps, up to 50 photos per listing
Seed data19 sample vehicles and 186 images
Hosting2 targets from one codebase: Vercel and Cloudflare Workers

13

Learned

What I took from it

I owned a whole system alone: schema, auth, media, admin tools and deployment. There was nobody to hand the hard part to.

I learned to write specs a model can build against, and to keep them true as the code changes.

And I learned to scope honestly. A placeholder checkbox is fine as long as it is called a placeholder.