Deployment: Twitch 2K Wager

arch-deployment-twitch-2k-wager Architecture

architecture active

Deployment: Twitch 2K Wager

Diagram

Components

Component Purpose Notes
twitch-2k-wager-app SvelteKit app (adapter-node) Port 3000. Server routes handle Stripe webhooks, Twitch OAuth callback, admin API.
Postgres (CNPG) Game state database CNPG cluster in namespace. Tables: challengers, games, payments, payouts, revenue_splits.
Tailscale Funnel Public HTTPS ingress playme2k.tail5b443a.ts.net. Routes to app service. Stripe webhooks and user traffic both enter here.
ArgoCD GitOps deployment Watches pal-e-deployments repo. Auto-syncs on push.
Kustomize overlay k8s resource definitions Deployment, Service, CNPG Cluster, Secrets, Tailscale Funnel config.
Stripe API External payment service Checkout sessions, webhooks, payouts. Credentials from k8s secret.
Twitch API External auth + user info OAuth flow + /users endpoint. Credentials from k8s secret.

Key Decisions

  • Single service (SvelteKit) — same pattern as westside-contracts. Server routes handle API concerns. No separate backend service for MVP.
  • Tailscale Funnel for ingress — no cert-manager, no Traefik. Platform standard. Stripe webhooks need public HTTPS endpoint.
  • CNPG for Postgres — platform standard. Backups to MinIO. Same operational model as other services.
  • pal-e-deployments for GitOps — kustomize overlay + ArgoCD. Same deployment pipeline as all other services.
  • Secrets via k8s — Stripe keys, Twitch OAuth credentials stored as k8s secrets. Sourced from ~/secrets at deploy time.