Files
Convivo/docs/backend
Lago b7c2abb73b docs: seed drift, pretix skip observability, new-suite run books, current-state refresh
tests.md: new 'Full E2E Suite Status' opener -- suite is NOT green (213/42,
2026-10-19, exit 1); the pipe-through-tail trap that produced two false '0
failed' records; seed-drift mechanism (config.ts identities gone, reset.ts
UPDATE-only no-ops, logins hang); 11 failing families; admin-schedule
exonerated by the reverted-Schedule.tsx check; fix direction (upsert demo
identities, self-provision new specs). Four new run sections: llm-connection
(three-state verdict), tooltip containment (mutation-validated provenance),
CONV-MATERIAL-005 (self-contained fixture pattern), corrected counts
(sidecar 35, checkin-points 4).

pretix.md: 'Positions that never become registrations' -- the email+name
guard, the 118->115 grouping on production numbers, and the anonymous-Skipped
gap (QRJZN case study, sync_runs.skipped never sees client-side drops).

next-steps.md: new 'Known work (open as of 2026-10-19)' section (seed drift,
skip observability, QRJZN operator action); stale cross-cutting items marked
done (subdomains live, printing shipped after the 'skipped by decision'
note, testing exists); Open decisions cleared; current-state blockquote
extended through the 2026-10-19 round.
2026-10-19 22:39:23 +02:00
..

Backend — Supabase Core

Convivo uses a local Supabase stack (run with the Supabase CLI) for its schema, RPCs and RLS, plus a Node sidecar for imports, reports and manual feedback AI summaries. This folder documents both the database core and those integrations.

File What it covers
supabase-core.md The local stack: containers, ports, how to start/reset, config
schema.md All 14 tables, columns, constraints, indexes
rpcs.md The transactional points RPCs (the business logic)
rls.md Row Level Security policies + which key the app uses
seed.md Seed data + the demo accounts
docker.md Docker: the app image + root compose (how the core + app run together)
sidecar.md The Sessionize sync sidecar (on-demand, service-role)
feedback-ai.md Admin-configured LLM endpoint and manual event/session feedback summaries
printing.md Badge printing: the pgmq queue, token-gated printer RPCs and the Raspberry Pi print stations
tests.md The RPC test suite (npm run test:rpc)

The big picture

Postgres 17  ──  schema (14 tables, multi-event model)
             ──  RLS (who can read/write what)
             ──  RPCs (security definer, transactional points logic)
             ──  seed (demo data)
  • Data + logic live in the database. The app never computes points or writes to registrations.points directly — it calls RPCs, and Postgres enforces the rules.
  • RLS is the security boundary. The app uses the anon key + the user's session JWT; RLS decides what that user may see and do. The service-role key is never shipped to the app. See rls.md.
  • Points are transactional. Each RPC updates points, inserts the related row, and re-syncs the leaderboard mirror in one transaction, so the leaderboard is always consistent and duplicate actions never double-award. See rpcs.md.

Source of truth