Hacktivist Platform (Live)
The operating system behind hacktivist.ai's golf and sim-racing venues
The platform hacktivist.ai runs on, built end to end by Matthew. Guests book a bay, pay, get a check-in code and check in at a kiosk with no front desk. Operators get leagues, gift cards, group rentals, payouts and a live control room over TrackMan golf bays and racing rigs. It has been live and earning revenue since December 2025 across five Central Pennsylvania locations, with about 925 paid bookings in its first year, and other venues (bars, hotels, golf rooms) can run their bays on it under their own name.
Capabilities
- Online booking with check-in codes and self-service kiosk check-in
- Stripe Connect payments, payouts, gift cards and idempotent refunds
- Winter leagues, group rentals and promotions run from one operator dashboard
- Remote control of TrackMan golf bays and racing rigs from the control room
- Multi-venue: host venues keep their own name while Hacktivist runs the bays
- Three-layer authorization: Row Level Security, table grants and definer RPCs
Stack: React, TypeScript, Vite, Supabase, PostgreSQL, Stripe Connect
Live site: hacktivist.ai
Case study: The operating system behind hacktivist.ai's golf and sim-racing venues.
Systems and architecture
- Defense in depth, not one check. RLS, table grants, and definer RPCs each play a distinct role. A pass caught six tables with policies defined but Row Level Security disabled, leaving player names, emails, and handicaps silently exposed. The fix enabled RLS and added scoped anon reads only for non-PII display.
- RPC as a security boundary. Account membership has no blanket insert. A least-privilege definer RPC is the only path to create an account and bind the creator as owner, and it grants owner only, never platform super admin.
- Migration drift as operational risk. A partially applied prior migration left a table with RLS on and zero policies, silently breaking an admin token UI. The reconcile migration restores the function and policy idempotently so staging and production converge.
- Environment isolation by default. Config points at staging, so a command missing its project ref lands somewhere harmless. The front end guards staging against production refs, and the cutover runbook makes the safe path the default path.
- Atomicity in the money path. Wallet and gift-card redemption moved from client-side multi-writes into a single atomic Postgres function, with a rollback that reverses redemptions if the booking fails.
- Search-path hardening. SET search_path = public on every definer function closes a known privilege-escalation vector, including the one function that was missing it.
Technical highlights
- Three-layer authorization. RLS, Postgres table grants, and SECURITY DEFINER RPCs each play a distinct role. Knowing which layer a failure belongs to turns permission denied into a precise fix.
- The unenforced-policy catch. Six tables carrying names, emails, and handicaps had policies defined but Row Level Security disabled, leaving them silently open. Enabling RLS with scoped reads closed the exposure without breaking the public page.
- Atomic redemption RPC. Wallet and gift-card redemption moved into one atomic Postgres function with rollback, removing a client-side multi-write race in the payment path.
- Stripe Connect money flow. Venue payouts, per-station subscription billing, and idempotent refunds, with walk-in sessions verified against Stripe before they confirm.
- Hardware auto-launch agent. A PC-side daemon launches the right scenario at session start and shuts it down at the end, authenticated by an opt-in heartbeat key that fails safe.
- Edge function surface. Deno functions handle customer creation, walk-in confirmation, payouts, automations, and the agent heartbeat, with JWT verification configured per function.
- Default-safe cutover. An environment guard and a runbook make staging the default target and backups a precondition, so a mistake lands in the harmless place.
- Removing a single vendor. Automations and auth email moved direct to Resend to remove a host-locked email gateway as a failure mode.
- CI as a gate. GitHub Actions runs a blocking typecheck and build, with a secret-gated edge-function test job, so broken code does not advance.