Files
Convivo/docker-compose.yml
509e342204 Add Pretix ticketing integration (every-minute sidecar sync)
- docs/backend/pretix.md: Pretix REST API reference (auth, orders/items
  endpoints, pagination, rate limiting, worked example)
- migration 20260909000000_pretix_sync.sql: events.pretix_organizer +
  pretix_event_slug; _map_ticket_type, _ensure_auth_user (QR token =
  password), sync_pretix_attendees (service-role-only, idempotent)
- sidecar: pretixFetch/fetchPretixOrders/fetchPretixItems/transformPretix,
  runPretixSync + every-minute runPretixLoop, POST /run-pretix, /status
  extended with pretix state
- admin: Pretix panel + recent runs in Interfaces, per-event Pretix config
  + Sync button in Events, api/types for Pretix
- docker-compose: PRETIX_API_KEY / PRETIX_BASE / PRETIX_SYNC_INTERVAL_MS

Verified on VM: 25 paid orders -> 25 attendees, auto-sync every minute,
login via QR token works, idempotent (no duplicate registrations).

Co-authored-by: Stephan Charles <[email protected]>
Co-authored-by: Amelia Hernandez <[email protected]>
Co-authored-by: Markus Franz <[email protected]>
Co-authored-by: Sabrina Hota <[email protected]>
Co-authored-by: Nilüfer Doğan <[email protected]>
2026-09-09 11:40:56 +02:00

117 lines
4.8 KiB
YAML

# Convivo — application services (Docker Compose).
#
# The Supabase CORE (Postgres, GoTrue, PostgREST, Realtime, Kong, Studio, ...)
# is managed by the Supabase CLI, not by this file. Start it first:
#
# npm run db:start # = supabase start
#
# The CLI creates an external Docker network named after the project
# (supabase_network_<project_id>; here: supabase_network_Convivo) and a Kong
# container (supabase_kong_Convivo) that fronts the API on port 54321.
#
# This compose file runs the attendee app (:3000) and the admin app (:3001) as
# sidecars that JOIN that network and proxy the Supabase same-origin paths to
# the Kong container.
#
# 1. npm run db:start # start the Supabase core (CLI)
# 2. docker compose up --build # build + run both apps
#
# Then open:
# - http://localhost:3000 (attendee app) — log in with a demo QR code
# (e.g. CVV-ANA-4821 / [email protected])
# - http://localhost:3001 (admin app) — log in as admin
# ([email protected] / password appe-admin-2026)
name: convivo
services:
convivo-app:
build:
context: ./apps/convivo
args:
# Standard local Supabase anon key (not a secret). Override if needed.
VITE_SUPABASE_ANON_KEY: ${VITE_SUPABASE_ANON_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0}
image: convivo-app:latest
container_name: convivo-app
ports:
- "3000:3000"
environment:
# Where nginx proxies the Supabase paths. Default: the Kong container on
# the shared Supabase network. NOTE: Kong listens on 8000 INSIDE the
# container (the 54321->8000 mapping is host-only), so use port 8000 here.
# If you run the core on the host instead of the shared network, set this
# to host.docker.internal:54321.
SUPABASE_PROXY_TARGET: ${SUPABASE_PROXY_TARGET:-supabase_kong_Convivo:8000}
# Join the network the Supabase CLI created for the core.
networks:
- supabase
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3000/"]
interval: 15s
timeout: 5s
retries: 5
start_period: 10s
convivo-admin:
build:
context: ./apps/admin
args:
# Standard local Supabase anon key (not a secret). Override if needed.
VITE_SUPABASE_ANON_KEY: ${VITE_SUPABASE_ANON_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0}
image: convivo-admin:latest
container_name: convivo-admin
ports:
- "3001:3001"
environment:
# Same proxy target as the attendee app (Kong on the shared network).
SUPABASE_PROXY_TARGET: ${SUPABASE_PROXY_TARGET:-supabase_kong_Convivo:8000}
networks:
- supabase
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3001/"]
interval: 15s
timeout: 5s
retries: 5
start_period: 10s
convivo-sidecar:
build:
context: ./apps/sidecar
image: convivo-sidecar:latest
container_name: convivo-sidecar
ports:
- "3002:3002"
environment:
# Where the sidecar reaches PostgREST (Kong on the shared network).
SUPABASE_URL: ${SUPABASE_URL:-http://supabase_kong_Convivo:8000}
# First server-side holder of the service-role key (bypasses RLS).
# Standard local key by default; override for a real deployment.
SUPABASE_SERVICE_ROLE_KEY: ${SUPABASE_SERVICE_ROLE_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU}
# Sessionize API key (required to run a sync). Set to your key.
SESSIONIZE_API_KEY: ${SESSIONIZE_API_KEY:-}
# Pretix API key (enables the every-minute paid-ticket sync). Set to your
# team-level token. When empty, the Pretix auto-sync is disabled.
PRETIX_API_KEY: ${PRETIX_API_KEY:-}
# Pretix API base URL (default: the pretix.eu hosted service).
PRETIX_BASE: ${PRETIX_BASE:-https://pretix.eu/api/v1}
# How often the sidecar polls Pretix (default: 60000 ms = every minute).
PRETIX_SYNC_INTERVAL_MS: ${PRETIX_SYNC_INTERVAL_MS:-60000}
networks:
- supabase
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3002/health"]
interval: 15s
timeout: 5s
retries: 5
start_period: 10s
networks:
supabase:
# External network created by `supabase start`. Name = supabase_network_<project_id>.
# If you change project_id in supabase/config.toml, update this name too.
external: true
name: ${SUPABASE_NETWORK:-supabase_network_Convivo}