05 / PLATFORMS & WORKFLOWS
SupabaseClientFlow
A helpful AI workflow needs reliable boundaries around its data.
Conversation ownership, booking uniqueness and daily AI quotas are enforced server side.
01 / CONTEXT
The problem.
A chat interface is only the visible part of a support workflow. Saved conversations need ownership checks, bookings need concurrency protection and paid AI requests need a server-enforced budget.
02 / IMPLEMENTATION
The approach.
A React frontend connected to Supabase Auth, Postgres row-level security and an Edge Function. The workflow combines FAQ-grounded responses, persisted conversations, support handoff flags and fixed-slot booking.
Simplified flow. Implementation details and boundaries are documented in the repository.
03 / TRADEOFFS
Decisions that matter.
Enforce ownership in the backend
Row-level security limits reads to the owner. The Edge Function validates the session and conversation ownership before making a paid AI request.
Reserve quota before AI work
A database RPC enforces 20 new AI requests per authenticated user per UTC day. Repeated request IDs do not consume additional quota.
Let the database arbitrate booking
A unique slot constraint prevents duplicate bookings, including concurrent requests. Availability exposes slot IDs without another user’s booking details.
04 / EVIDENCE & BOUNDARIES
What was checked.
- Cross-user conversation isolation
- Browser-written assistant messages denied
- Invalid token and duplicate request scenarios
- Duplicate booking rejection and frontend lint/build
Checks summarized from the project documentation. See the repository and CI for current details.
Scope of this reference project
Portfolio demonstration. Handoff stores a flag; it does not notify a human. Booking does not send email or create calendar events. Anonymous identities need stronger abuse controls for production. The repository documents local setup; no public live demo is advertised here.
Run it locally
Follow the repository README for prerequisites and configuration before running:
cd web
npm ci
npm run devRead the setup instructions WORKING ON A SIMILAR PROBLEM?