Technical brief · build plan

How we build it.

A pragmatic architecture for a small team shipping fast without painting into a corner. Integration-first, one source of truth, the hard computer-vision isolated from everything else — and a build order that earns revenue while the moat matures.

Architecture principles

Five decisions that shape everything.

Get these right and the rest is execution. Get them wrong and you rewrite in a year.
P1

One source of truth

Every surface — Lily, Vision, CRM, events — reads and writes one Supabase project, scoped by tenant_id with row-level security. No module owns its own siloed data.

P2

Swappable adapters

Two interfaces hide every external dependency: CommsSource (OpenClaw→Twilio) and BookingSource (TPC/Playtomic/Padel Mates/own). The UI never talks to a vendor directly — a port becomes a config swap.

P3

Canonical data model

Normalise every booking system into one internal model — Player, Court, Booking, Membership, Transaction. Store raw payloads so you can re-map without re-fetching.

P4

Isolate the CV

Vision is the one separate service — its GPU and scaling profile is nothing like the rest. Everything else is a modular monolith. Microservices are premature at this stage.

P5

Revenue before moonshot

Ship sellable modules first; let Vision's hard inference mature on accumulating, labelled data. Start Vision's capture pipeline day one — gate launch on it never.

System architecture

The stack, layer by layer.

Clients
Owner / Coach DashboardNext.js · Vercel
Player Mobile AppReact Native · Expo
Comms Dashboardlive take-over
Application — modular monolith
Lily EngineLLM + RAG + fn-calling
CRM + Retentionchurn · reactivation
Eventsbuild · fill · run
Coachingreports
Marketingsocial APIs
Adapters — the swappable core
CommsSourceOpenClaw → Twilio
BookingSourceTPC · Playtomic · Padel Mates · own
Async — jobs & queue
Job QueueBullMQ / Celery
Campaign sendsemail · WA · SMS
Nightly QA & summaries
Percorner Vision — isolated GPU service
Capture pipelineupload · court cams
TrackingYOLO + ByteTrack
Shot classifiertrained on padel footage
Per-corner rankingattribution engine
Data & infra
Postgres + RLSSupabase
pgvectorLily knowledge
Object storageCloudflare R2 · no egress
Rediscache
Technology choices

What runs where.

Chosen for a small team's speed and your existing footprint (Vercel, Supabase, Clerk, Anthropic). Boring where it can be, specialist only where it must be.
Frontend
Next.js on Vercel for dashboards; React Native (Expo) for the player app (camera + uploads for Vision). TypeScript end-to-end, shared component library.
Backend
Node.js (NestJS) modular monolith for app logic; Python (FastAPI) isolated for AI/CV. Clean separation by scaling profile, not by fashion.
Database
Postgres via Supabase — multi-tenant with row-level security on tenant_id. pgvector keeps Lily's knowledge in-DB. Auth + storage from the same provider to move fast.
Auth
Clerk (or Supabase Auth) — multi-tenant org/role model from day one: platform admin, club owner, coach, staff, player.
Lily / conversational
Anthropic for reasoning + RAG over per-club knowledge. Telnyx for voice & number porting (cheaper than Twilio for your flow), WhatsApp Business Cloud API. Function-calling so Lily queries real availability & CRM — not a static FAQ.
Vision
Python service. YOLO-family detection + ByteTrack/BoT-SORT tracking, court homography, a shot classifier trained on labelled padel footage. Async GPU inference via the queue — no real-time at first. GPU on Modal / Replicate / RunPod.
Storage
Cloudflare R2 for video — no egress fees, which matters enormously at video scale.
Async / jobs
BullMQ (Node) or Celery (Python) + Redis: campaign sends, video processing, Lily outbound, nightly QA & summaries.
Marketing
Meta Graph API (IG/FB) + TikTok API for posting; LLM for copy & clip selection; existing PostFast / scheduling tooling for distribution.
Billing
Stripe for subscriptions & usage metering; Stripe Connect for clubs taking court payments on the full-house booking.
Hosting
Vercel (frontend), Railway/Render early for backend → AWS/GCP when outgrown. Managed Postgres throughout.
Analytics
PostHog for product analytics across dashboard & player app.
Booking integrations

Plug in, don't rip out.

The promise is "keep your booking system, add the intelligence layer." Whether that's read-only or fully two-way depends entirely on what each provider's API allows — and they differ a lot. Here's the real state of each, researched against their current docs (June 2026), and exactly how far the sync goes.
Playtomic
Documented third-party API, self-serve. The club generates its own credentials in Playtomic Manager → Settings → Developer Tools. Exposes three resources: Auth, Bookings, Players. Returns roughly the last 3 months of booking data; rate-limited (~1 call/min). Playtomic reserves the right to change or discontinue with one month's notice. Crucial caveat: clubs on Playtomic don't own their data — access is via Playtomic's terms, so this is read-centric.
TPC Matchpoint (now MATCHi)
API available on request — gated, commercial. Not self-serve: access is granted per partnership, "especially when the partner is compensated via the API." So integration here is a business conversation first, technical second — expect a commercial agreement before credentials. Capabilities are negotiated rather than published.
Padel Mates
The most integration-friendly — by design. Padel Mates actively markets full member-data ownership and "seamless integration through a powerful API" as its core differentiator versus Playtomic. Clubs switching to it (e.g. Rocket Padel) cite data access as the reason. Best candidate for richer, potentially two-way sync.
Own booking
Full control, full two-way. For greenfield clubs on PerCorner's own booking, there's no external API limit — every read and write is native. This is the only path with guaranteed bidirectional sync.
Q1 · Read-only or two-way?

Both — but it's per-provider, not a choice we make

Read (their bookings/players → PerCorner) is available everywhere there's an API. Write-back (a change made in PerCorner pushes to the booking system) is only as good as each provider's write endpoints — and most expose read first. So the honest answer to your partner: day one is read-heavy; two-way is enabled provider-by-provider as their write APIs allow, and is fully two-way only on our own booking.

Q2 · Staff edits a booking in our system

What actually happens

If the provider supports writes: the edit flows back and the plugin updates too (true two-way). If it's read-only: PerCorner shows the change in our UI and flags it as "pending in {provider}", and Lily/staff complete it in the source system — we never silently desync. The canonical model always holds the source of truth and reconciles on the next sync. We never let our copy and theirs drift without showing it.

How the player toggle works. Each club sets one active BookingSource in settings (Playtomic, TPC/MATCHi, Padel Mates, or PerCorner's own). That single switch repoints the adapter — the player app and owner dashboard don't change at all, because they only ever talk to the canonical model, never the vendor directly. For the player, booking simply works against whatever the club has connected: if the provider allows booking writes, the player books in-app and it lands in the club's system; if not, the player app deep-links to the provider's booking flow and reads the result back. The toggle is a club-level config, not something the player ever sees or manages.

Architecturally this all sits behind the one BookingSource interface (the same swappable-adapter pattern as CommsSource). One canonical data model — Player, Court, Booking, Membership, Transaction — with a per-provider adapter mapping each API in, raw payloads stored so we can re-map without re-fetching, webhook ingest where offered and polling where not. Adding a provider is writing one adapter; switching a club is flipping one config value.
How the apps coexist

Two shapes, one platform.

A club that already runs Matchpoint (or Playtomic/Padel Mates) doesn't throw it away. PerCorner takes one of two shapes depending on what they already have — and the player experience adapts to match.
Mode A · Companion layer

Club keeps its existing booking app

PerCorner runs as a second app/layer beside Matchpoint. The player still books in Matchpoint (or via a PerCorner screen that deep-links into it), and PerCorner reads that schedule. Everything the incumbent doesn't do — Vision, per-corner ranking, AI highlights, detailed coaching-with-video, progress reports, combined ratings — lives in PerCorner. We don't compete with their booking; we fill the gap above it.

Mode B · All-in-one

Club runs on PerCorner booking

For greenfield clubs or those switching, booking is native and there's one app for everything — booking, ranking, coaching, events, profile. No second app, full two-way control, the cleanest experience. This is the natural upsell from Mode A once a club sees the value.

Why the companion model works. Incumbents like TPC Matchpoint have no video, no real coaching-booking flow, and no per-shot ranking — that entire surface is PerCorner's. The player tolerates a second app because it does things the first one never could; over time PerCorner becomes the app they open daily (their rank, clips, progress, combined rating) while the booking system stays the booking utility underneath. The friction sits on the boring task, not the engaging one. For the player, the only visible difference between Mode A and Mode B is where the Book button takes them — everything else is identical.

Same canonical model underneath both. In Mode A the player's identity is matched across the incumbent's data and PerCorner's; in Mode B PerCorner is the system of record. Either way, the combined rating reconciles a player's BPC/club rating with their Playtomic, Matchpoint and Padel Mates levels — the one place in the sport that unifies a fragmented padel identity, with shareable public profiles that drive organic growth.

Player free vs Pro. The member app is free for what makes the club sticky — booking, club & combined rating, joining ranked matches, standard reports, profile & share links. PerCorner Pro (~£6/mo) gates the personal-value features: full video parsing, deep stats, outside-club uploads, and AI highlight reels (a monthly bundle, then a per-creation fee). Ranked matches stay free to join — the cost sits in a slightly higher ranked-court price with Vision capture included, so participation (and the data it generates) is never gated. Three revenue layers: club subscription, player subscription, per-use fees.

Scope · the MVP line

What ships, and in what order.

Vision's capture & data layer starts in the MVP; its hard inference grows across phases. The line is drawn so 1–4 are sellable with a normal team while the moonshot matures.
MVP · sellable now

Earn while you build

  • Multi-tenant Lily + booking-aware function calling
  • TPC Matchpoint connector + canonical model
  • Dead-data ingestion + churn scoring + reactivation
  • Comms dashboard + take-over
  • CRM: segmentation + automated outreach
  • Coaching Studio + AI reports
  • Event engine + automated promo & bookings
  • Vision Phase 1: capture, storage, clips, basic stats
  • Coach-assisted onboarding rating (human confirm)
  • Owner dashboard
Phase 2 · deepen

Turn tool into platform

  • Full marketing / content automation
  • Playtomic + Padel Mates connectors
  • Vision shot classification
  • Churn-risk modelling
  • Player app + personal stats subscription
  • Ranked matches (assisted attribution)
Phase 3 · the prize

The moat at full strength

  • Autonomous high-confidence rating
  • Calibrated 0–7 per-corner engine + appeals
  • Fixed court-camera capture (hardware partner)
  • Own booking system for greenfield clubs
  • Twilio port via CommsSource (config swap)
Build sprints

The sequence.

Two-week sprints, ordered so each one ships something demonstrable. Durations are planning estimates for a small team, not commitments.
Sprint 0

Foundations

~2 weeks
  • Lock Supabase schema: tenant, conversations, messages, call_sessions, players, courts, bookings, ratings
  • Row-level security on tenant_id; auth roles (admin/owner/coach/staff/player)
  • Rotate & vault all credentials; environment config
  • Define CommsSource + BookingSource interfaces
Ships: the spine every module hangs off.
Sprint 1–2

Lily, productised & multi-tenant

~4 weeks
  • Both surfaces (OpenClaw WhatsApp + voice) write to shared message tables
  • CommsSource(OpenClaw): read + Supabase realtime
  • Comms dashboard: login, inbox, conversation view, live
  • Take-over toggle (lily_active) + staff alerts queue
  • Function-calling v1: Lily reads availability from BookingSource
Ships: your live revenue engine, now sellable to multiple clubs.
Sprint 3–4

Integration layer + retention engine

~4 weeks
  • BookingSource(TPC Matchpoint): bookings, courts, customers → canonical model
  • Webhook ingest where available, polling fallback; raw-payload store
  • Dead-data ingestion: full customer history → one real profile per player
  • Churn-risk scoring: who's gone quiet, who's at risk, who to reach out to
  • Automated reactivation: Lily wakes dormant players with the right offer
  • Segmentation + win-back / onboarding journeys; owner dashboard v1
Ships: the goldmine — waking the dead data into rebooked courts, the clearest near-term ROI.
Sprint 5–6

Event engine + Coaching Studio

~4 weeks
  • Event builder: formats, courts, capacity, price, level limits
  • Auto-generate promo content; multichannel send via queue; waitlist + auto-fill
  • Live draw, scoring, standings, auto-recap
  • Coaching: history form → video upload → AI-assisted review → player report
  • Coach Mic (capture): clip-on mic → app records the lesson → audio uploaded to the session
Ships: the flagship demo that shows the whole platform in one workflow.
Sprint 6–7

Coach Mic — audio intelligence

~3–4 weeks
  • Mic pairing (Bluetooth/lapel) + chunked, resumable upload; record locally first so signal drops never lose a session
  • Speech-to-text + speaker diarization (coach vs player) — reuses Lily's voice stack
  • LLM session summary: focus, key corrections, drills, "next time" — drops straight into the report
  • Timestamp-align transcript to video so spoken cues become comments pinned to the exact moment on screen
  • Consent captured at booking/checkout — recording is an opt-in paid tier (video + audio + report); coach always reviews/edits before delivery (never auto-send); deletion on request
Ships: coaches stop writing reports — the lesson writes itself from what they already said out loud. Reuses the Lily transcription pipeline, so low net-new risk.
Sprint 7–8

Vision Phase 1 + assisted rating

~4–6 weeks
  • Capture pipeline: upload + R2 storage + processing queue
  • Tracking → rally/shot counts, duration, win-loss, coverage heatmaps
  • Auto-highlight clipping → feeds marketing + player profiles
  • Onboarding rating: history form + video → proposed 0–7, coach one-tap confirm
  • Begin labelling footage (coach ratings = ground truth) for the ranking model
  • Recording consent on ranked matches: starting a digitally-ranked game flags it as recorded; every player who joins accepts it's filmed & rated before they're in
Ships: Vision's easy wins live; the moat's data engine running.
Sprint 9+

Phase 2/3 — deepen toward the moat

ongoing
  • Shot classification → per-corner attribution → ranked matches
  • Calibrated 0–7 engine with confidence bands + appeals path
  • Playtomic / Padel Mates connectors; marketing automation at scale
  • Player subscription; churn modelling; own booking; Twilio port
Ships: the defensible product no competitor can copy.
Honest risks

Where this could go wrong.

Spreading too thin

This is four products plus an integration platform plus a CV moonshot. The biggest risk isn't any one feature — it's building everything before anyone pays.

Mitigation: don't build past Lily until 5–10 clubs pay for it. Let them tell you which module is next.

Vision is research-grade

Multi-player + ball tracking, shot classification and homography from club video is genuinely hard. The 0–7 rating depends on accumulated labelled data first.

Mitigation: ship easy Vision wins early; never gate launch on autonomous rating; consider a CV vendor/academic partner for v1.

Booking incumbents

Playtomic owns player-network liquidity; you'd lose a head-on booking war.

Mitigation: integrate, don't compete. Be the intelligence layer on top. Own-booking is a fallback for greenfield clubs only.

Rating trust & safety

A wrong autonomous rating puts a weak player into an unsafe match — clubs won't forgive it.

Mitigation: human-in-loop until confidence is proven; transparent "why" + appeals built in from day one.

Before any of this: rotate every credential that has left your vault, run the formal trademark search on "Percorner" (UK IPO + EUIPO, classes 9 / 41 / 42), and lock the matching Instagram & TikTok handles — for a product whose pitch includes social automation, the handle matters as much as the domain.