cofi/CLAUDE.md

2.1 KiB

CoFi Registration App

Overview

Standalone event registration + payment app for CoFi (Collaborative Finance). Runs on Netcup at register.collaborative-finance.net, linked from the main site at www.collaborative-finance.net via a simple button.

Adapted from crypto-commons-gather.ing-website with centralized config.

Architecture

  • Stack: Next.js 16 (App Router, standalone) + Mollie + Google Sheets + Mailcow SMTP + Listmonk
  • Deploy: Docker on Netcup with Traefik labels
  • Domain: register.collaborative-finance.net (CNAME → Cloudflare tunnel on Netcup)
  • Key pattern: All event-specific config centralized in lib/event.config.ts

Flow

  1. User clicks "Register" button on www.collaborative-finance.net → opens register.collaborative-finance.net/register
  2. User fills form → POST /api/register → Google Sheets (Pending)
  3. User picks accommodation/payment → POST /api/create-checkout-session → Mollie redirect
  4. Mollie webhook POST /api/webhook → verify payment → assign booking → update sheet → email → Listmonk

Key Files

  • lib/event.config.tsEdit this to configure event (pricing, dates, venues, branding, links)
  • lib/mollie.ts — Shared Mollie client singleton
  • app/globals.css — Blue/teal OKLch color theme
  • docker-compose.yml — Traefik-labeled deployment
  • embed-snippet.html — Copy-paste button HTML for the main website

Embedding on the main site

Send embed-snippet.html to the website owner. It contains a self-contained styled button that links to the registration page. No iframe, no JS, no CORS — just a simple <a> tag.

Dev Workflow

pnpm install
pnpm dev          # localhost:3000 → redirects to /register

Deployment

  1. Your friend adds a CNAME: register.collaborative-finance.net → Cloudflare tunnel
  2. On Netcup: docker compose up -d --build
  3. Traefik auto-discovers via labels, Cloudflare tunnel handles TLS

DNS Setup (friend's side)

register.collaborative-finance.net  CNAME  <your-cloudflare-tunnel-id>.cfargotunnel.com

Or if using Cloudflare proxy on their domain, they can add the CNAME to point to your tunnel.