All projects

Case study 03 of 07 · Marketplace · Payments · Search

SocialField

A UK events and ticketing marketplace, built end to end as a production system. There is no AI in the product. The AI engineering is in how it was built.

Live in productionAI in the workflow, not the product
Screenshot of the SocialField home page on desktop: event search, category filters and app store badges

In 20 seconds

What it is
Organisers list and sell tickets to sports, social, nightlife and community events, and attendees browse, book, follow and join memberships. The engineering is in payments, data integrity and search visibility.
My part
Product, architecture and operations. Claude Code implemented much of the code.
Built with
Claude Code in VS Code with five custom review subagents, Git with a private GitHub backup, the Vercel and Firebase CLIs
AI in the product
None in the product. The only machine learning at runtime is Google Cloud Vision for image moderation. The AI is in how it was built: Claude Code plus five custom review subagents.
Status
Live in production. Notes from 25 Jul 2026. Git history from 24 Aug 2026 (73 commits).

Straight answer: The product has no LLM, RAG, embeddings or voice, so I don’t call it an AI product. The repository is private. The git history has one author and I can’t split hand-written lines from AI-written ones.

  • 233 unit tests passing in 2.5 seconds verified
  • 108 API routes verified
  • 6 scheduled jobs running unattended verified
  • 18 of 19 sitemap pages indexed by Google verified
01

Overview

SocialField is a UK events and ticketing marketplace. Organisers list and sell tickets to sports, social, nightlife and community events. Attendees browse, book as a guest or with an account, follow organisers and join memberships.

The problem. Small organisers, such as casual sports and social groups, get ticketing, payouts, memberships, waitlists, check-in and promotion in one place.

Who it is for. Attendees, organisers, “Event Admin” volunteers (a free role for helpers) and platform admins.

What makes it different

  • Standard and VIP organiser memberships. Standard includes one event a day, VIP is unlimited and adds a 10% discount on one ticket per event.
  • A prepaid deposit wallet that enables pay-on-arrival events.
  • A paid waitlist with a 30-minute claimable offer.
  • Per-date volunteer roles.
  • Refund rules modelled on Eventbrite.
  • Search and AI-visibility work: server-rendered pages, llms.txt and structured data.
02

Screens

Screenshot of the SocialField home page on desktop: event search, category filters and app store badges
The public home page on desktop, captured from the live site on 16 Nov 2026.
Screenshot of the SocialField home page on a phone
The same page on a phone.
03

How it works

System architecture

System architectureBrowser, PWA,native shellstatic pages andJSON API callsVercelstatic pages andrewritesExpress APIone Firebase CloudFunction, 108 routes6 scheduledfunctionsStripe payouts,reminder emails,waitlist, retentionFirestore andStorageabout 27 collectionsStripeConnect, signedwebhooksResend, Vision,address APIsemail, image check,geocodingstatic pagesSSR, sitemapsJSON and JWTwebhooksSystem architectureBrowser,PWA, nativeshellVercelExpress API6 scheduledfunctionsFirestoreand StorageStripeResend,Vision,address APIsstatic pagesSSR, sitemapsJSON and JWTwebhooks
  • Client
  • Service
  • Scheduled / background
  • Data store
  • External service
  • Asynchronous / scheduled
Read this diagram as a list

The boxes

  • Browser, PWA, native shell: static pages and JSON API calls
  • Vercel: static pages and rewrites
  • Express API: one Firebase Cloud Function, 108 routes
  • 6 scheduled functions: Stripe payouts, reminder emails, waitlist, retention
  • Firestore and Storage: about 27 collections
  • Stripe: Connect, signed webhooks
  • Resend, Vision, address APIs: email, image check, geocoding

The connections

  1. Browser, PWA, native shell → Vercel (static pages)
  2. Vercel → Express API (SSR, sitemaps)
  3. Browser, PWA, native shell → Express API (JSON and JWT)
  4. Express API → Firestore and Storage
  5. Express API ⇄ Stripe (webhooks)
  6. Express API → Resend, Vision, address APIs
  7. 6 scheduled functions → Firestore and Storage
Derived from the code. No diagram exists in the repository.

Runs without me

  • expireWaitlistOffers, every minute: releases expired 30-minute waitlist holds.
  • sendEventAdminAttendeesReminders, every minute: reminder emails to Event Admins reported
  • sendOnlineEventReminders, every 5 minutes: reminders for online events.
  • releaseOrganizerPayouts, daily 03:00 London: releases payouts after a 3-day hold.
  • deleteFinishedEvents, daily 04:30 London: archives and deletes events 10 days after the last session.
  • sendMembershipRenewalReminders, daily 09:00 London: renewal emails, at most 3.
  • A Stripe webhook checks the signature on the raw body and handles payment, refund, dispute, invoice and subscription events. Followers get an instant email when an event is published.

Needs a person

  • Organisers create events, check attendees in with a QR scanner and request refunds.
  • Platform admins use a separate dashboard to remove events (refunds first), reassign events and read stats and reports.
  • The newest refund rules still need a real-money test by me.
04

Stack

AI models and APIs

  • Google Cloud Vision SafeSearchimage moderation, the only ML at runtime

AI techniques

  • Content moderationrule engine plus Vision
  • Agentic development workflowfive Claude Code review subagents

Languages

  • JavaScriptNode.js 24 backend, ES modules in the browser
  • HTML and CSS

Backend and APIs

  • Express 4one Firebase Cloud Function v2, 512 MiB, 300 s
  • firebase-functions 7 and firebase-admin 13
  • bcryptjs and jsonwebtokencustom email and password login
  • express-rate-limit
  • sharp

Frontend

  • Hand-written static HTML and JS (no framework)68 pages
  • PWAmanifest and service worker
  • Stripe.js
  • CapacitoriOS and Android wrappers that load the live site

Data and storage

  • Cloud Firestoreabout 27 collections
  • Firebase Storageimages

Payments and integrations

  • StripeConnect, PaymentIntents, subscriptions, payouts, refunds, webhooks
  • Resendabout 50 email send sites
  • OpenStreetMap Nominatim and postcodes.ioaddress detection
  • YouTube oEmbed
  • QR codes (qrserver)

Cloud and infrastructure

  • Vercelstatic frontend and rewrites
  • Firebase Cloud Functionsus-central1
  • Cloudflareresponse headers seen
  • Codemagicnative app builds

Testing and tooling

  • Node built-in test runner233 tests
  • Claude Code
  • Git
  • Vercel and Firebase CLIs
  • Headless-browser harnessreal backend with mocked services
05

AI and machine learning

This is the section where I am most careful. SocialField contains no LLM, RAG, embeddings, speech or autonomous agents. The backend dependency list has no AI SDK and a code search found no model calls. The real AI engineering evidence is the development process.

Models and what they do

  • Google Cloud Vision SafeSearchImage moderation over REST. Rejects images where adult content is likely, racy is very likely, or violence is likely or higher. It checks the exact stored bytes, and animated images keep only the first frame. It fails open on a Vision outage, so uploads are not blocked and the skip is logged reported

Techniques actually used

  • Rule-based text moderation (345 lines with 216 lines of unit tests) that sees through digits, spaced letters, lookalike Cyrillic and Greek characters and zero-width characters, with an allow-list for innocent UK terms and a no-links policy.
  • Only Firebase Storage URLs are accepted as images reported
  • AI-assisted engineering: five custom Claude Code subagents (payment, security, mobile responsiveness, analytics and SEO). They are diagnostic only, triggered proactively, and report back instead of editing code.
  • The agent files encode real past bugs as checklist items, for example an input that needs min-width:0 inside a flex row reported
  • A ‘Meeting Room’ log where the agents pose hard, non-repeating questions to each other, with an explicit no-code-changes rule.
  • A test harness that runs the real backend against mocked Firebase, Stripe and Resend, with injected latency and conflicts, to reproduce race conditions reported It lives in a session scratchpad, not in the repository.
  • Other AIs’ audits were treated as claims to verify on the live page, not as instructions reported

Not in this project

  • LLM calls
  • Prompt engineering in the product
  • RAG
  • Embeddings
  • Vector database
  • Speech to text or text to speech
  • Product-side agents

AI-search visibility work is real, though: llms.txt, schema.org structured data and server-rendered pages.

06

Features

  • Attendees: browse and filter events, category and area landing pages, event pages, guest or account booking, card payment plus Google Pay and Apple Pay, free events and memberships, a waitlist (free events auto-book, paid events get a claimable offer), find-my-tickets by email, QR tickets, cancellation within a window, following organisers, a sale countdown badge and an “Open with…” map picker.
  • Organisers: event creation with per-date sessions and a recurrence tool, a custom time picker, ticket types and relative sale-end cutoffs, attendee lists and a QR check-in scanner, refund requests, analytics that never decrease, Stripe Connect payouts, pay-on-arrival with a deposit wallet (auto top-up and withdrawal to bank), promotion campaigns, and public profiles with YouTube and Instagram.
  • Event Admin: a free volunteer role, restrictable to specific dates.
  • Platform admins: a separate dashboard with event removal (refunds first), reassigning events, stats and event reports.
  • Payments: destination charges with a platform fee of 12% plus 49p on top. The fee is kept on attendee cancellations, the organiser pays it on removals, and everything is returned on a cancellation reported
  • Moderation: no links or 18+ words in public text, with image checks.
07

My role

Product and architecture decisions recorded in my project notes reported:

  • Permanently deleting events 10 days after the last session instead of hiding them.
  • “Analytics only go up, only refunds lower them”, which led to the eventArchive design.
  • A no-links content policy.
  • The pay-on-arrival deposit design, a 6-stage plan I approved.
  • Eventbrite-style refund rules, and UK-first expansion.
  • Rounds of SEO and security audits.
  • Rejecting reactive payment fixes: the brief was “fix this forever”.
  • A rule never to risk an admin lockout, after one actually happened on 2026-09-24.

I also built the integrations with the assistant: Stripe Connect and webhooks, Resend, Vision moderation, address detection, Codemagic native builds and read-only Search Console API access through a restricted helper account.

Built with AI. Effectively all implementation was done with Claude Code, including the review subagents and the test harness. Line-level authorship can’t be verified, so I don’t claim it.

08

Engineering challenges

“Customers can’t pay”

Stripe’s card box silently failed, and earlier fixes only detected the freeze and sent customers elsewhere.

How it was solvedHide

The diagnostic signature was a PaymentIntent with “payment method: none”. The root cause was Stripe Link inside the Card Element, reproduced only in my normal Chrome and not in Incognito. The fix was disableLink: true in all three card boxes, plus a silent retry and a Google Pay and Apple Pay path. Confirmed on 2 Oct 2026 reported

Refund and fee rules

Money rules need hardening, and mocks hide bugs.

How it was solvedHide

The rules were hardened over two review rounds (claim, read Stripe first, finish in one transaction). Real Stripe test mode caught a “fee 0” bug the mocked tests missed, because Stripe’s charge objects lag after payment. A deployment-order constraint also surfaced: Vercel first, then functions. refundRules.test.js is in the suite.

Exactly-once payments

A payment must be decided once, even when Stripe retries.

How it was solvedHide

Each payment is decided once inside the webhook transaction, and Stripe retries only if nothing was booked. Races were reproduced with latency-injecting fakes reported

A waitlist that never worked

The cause was missing Firestore composite indexes.

How it was solvedHide

The fix was single-equality queries with in-code filtering, plus claimable paid offers, all in transactions reported

Moderation hardening

A catastrophic regex backtracking problem took 10 to 36 seconds and was reachable by an unauthenticated visitor on the register page.

How it was solvedHide

It was caught in review and replaced with single-pass matching, plus a speed test. A security review also found an image-check bypass, now closed reported

Data lifecycle

Firestore read costs, not storage, drive the bill.

How it was solvedHide

Events are deleted to limit reads. eventArchive keeps analytics and old links working: a 301 to the organiser’s next event with the same title, or a “This event has ended” page.

Search and indexing

An SSR proxy loop, empty category pages being indexed, and a client script overwriting good structured data.

How it was solvedHide

All fixed. The .html addresses then moved to clean URLs with 308 redirects in a staged rollout. A check on 16 Nov 2026 shows 18 of 19 sitemap pages indexed. Search Console, 28 days: 24 clicks and 1,108 impressions, against 14 clicks and 464 impressions in the 28 days before. About 40% of recent impressions came from one deleted event’s old address, which got no clicks, so these are small but growing numbers.

Performance

A slow events page came from redundant refetches and sequential API calls, not backend compute.

How it was solvedHide

Cold starts were measured at 89 in 3 days at 3.3 s each reported The YouTube embed now loads only on play reported

Security hardening

CORS was too open, a forged X-Forwarded-For header bypassed rate limiting, and a storage-deletion IDOR existed.

How it was solvedHide

CORS is limited to the project’s own Vercel deployments, the rate-limit bypass is closed with trust proxy 1, and the IDOR fix has a regression test (storageOwnership.js).

09

Status

Live and verified on 16 Nov 2026. www.socialfield.uk returns HTTP 200 and its events page lists 6 live events. The sitemap and llms.txt load, and the Google Play (uk.socialfield.app) and App Store listings both return HTTP 200. The Android build v1.0.3 was submitted to Play production on 1 Aug 2026 reported All 233 unit tests pass.

Complete

  • Attendee flows: browse and filter, event pages, guest or account booking, card, Google Pay and Apple Pay, waitlist, QR tickets, cancellation within a window.
  • Organiser flows: per-date sessions with recurrence, ticket types, attendee lists and check-in, refund requests, Stripe Connect payouts, pay-on-arrival with a deposit wallet, promotion campaigns.
  • Event Admin volunteer role, platform admin dashboard and content moderation.

Partial or still open

  • Migration from the Stripe Card Element to the Payment Element reported
  • A decision on minInstances, which is not configured.
  • Not every payment path has been run end to end with real money reported

Not built, and not claimed

  • Any LLM, RAG, embeddings, voice or product-side agent feature.
10

Evidence

  • 233 unit tests passing in 2.5 seconds verified
  • 108 API routes 52 GET, 48 POST, 2 PATCH and 6 DELETE, in one Express app.verified
  • 6 scheduled jobs running unattended Payouts, reminders, waitlist expiry and retention.verified
  • 18 of 19 sitemap pages indexed by Google Checked on 16 Nov 2026.verified
  • ~25,600 lines of hand-written front end 68 HTML pages and 12 JS modules, no framework. 29 pages are category and area landing templates.verified
  • 73 commits Aug 6, Sep 26, Oct 33, Nov 8.verified
  • 0.4 to 0.9 s live page response times From one machine. A single sample, not a benchmark.verified

Code worth reading (private repository, excerpts only)

  • functions3/lib/contentPolicy.jsThe moderation rule engine and its unit tests.
  • functions3/lib/refundRules.jsEventbrite-style refund and fee rules, with refundRules.test.js.
  • functions3/lib/eventRules.js and place.jsEvent rules and address detection.
  • functions3/lib/storageOwnership.jsThe fix for a storage-deletion IDOR, with a regression test.
  • Scheduled functions in index.jsThe six unattended jobs near the end of the file.
  • .claude/agents/*.mdThe five review subagents and the Meeting Room log.

What I can't verify, so I don't claim

  • User, organiser and revenue numbers, and uptime.
  • The native app source. It lives in a separate folder that is not part of this repository.
  • Who wrote which lines. The git history has one author and most implementation was done conversationally with Claude Code.
  • The other test counts in my notes (62, 74, 20 and Stripe 52 of 52). They come from a harness outside the repository.

Public links

Compiled on 16 Nov 2026 from the code, tests, live site and the Search Console API. Items marked reported come from my project notes and were not re-verified.

verified checked against the code, tests, logs or the live system. reported from my own notes or hands-on use. unverified could not be checked, so it is not claimed.