# Chobble Tickets Chobble Tickets is a reservation system that runs on Bunny Edge Scripting (or any Deno environment) with libsql, which encrypts all PII at rest and handles free and paid listings with Stripe, Square, or SumUp. It is developed by [Chobble CIC](https://www.chobble.com) - a community interest company, which means the assets are locked to the community and cannot be sold off. **Website**: [tickets.chobble.com](https://tickets.chobble.com) This is not "open core" - every feature is available under [AGPL-3.0-only](LICENSE) with no proprietary add-ons. If you prefer not to host it yourself, I offer hosted instances at [tix.chobble.com](https://tix.chobble.com/ticket/register) for £5/month or £50/year. --- ## Deploy on Bunny Edge Scripting This is the recommended way to deploy it. Fork the repo, connect it to Bunny, and deploy via GitHub Actions - you can pull in upstream changes and push your own customisations on your own schedule. 1. **Fork or clone** this repository 2. **Create a Bunny Database** in the [Bunny dashboard](https://dash.bunny.net) - note the database URL and token 3. **Create a Bunny Edge Script** using your repository as the linked source 4. **Add secrets** to the script in the Bunny dashboard: | Secret | Description | | -------------------- | ---------------------------------------- | | `DB_URL` | Your Bunny database URL | | `DB_TOKEN` | Your Bunny database auth token | | `DB_ENCRYPTION_KEY` | 32-byte base64-encoded AES-256 key | | `SCHEDULED_TASK_KEY` | Unique 32-byte base64url maintenance key | 5. **Add GitHub Actions secrets** to your repository: `BUNNY_SCRIPT_ID` and `BUNNY_ACCESS_KEY` Pushes to `main` trigger the deploy workflow automatically. The database schema auto-migrates on first request. Visit `/setup/` to set your admin password and currency. For image uploads, also add `STORAGE_ZONE_NAME` and `STORAGE_ZONE_KEY` as Bunny secrets. Configure an external monitor using the [scheduled maintenance guide](docs/scheduled-maintenance.md). See the [CONFIG_KEYS reference](https://chobbledotcom.github.io/tickets/doc.ts/~/CONFIG_KEYS.html) for all optional variables. --- ## Features ### Listings - Standard listings (fixed capacity) and daily listings (per-date capacity with calendar picker) - Listing groups for organising related listings together - Optional listing date and location fields, displayed on the ticket page - Configurable contact fields: email, phone, postal address (any combination) - Special instructions field for attendee notes - Terms and conditions - set globally in settings, attendees must agree before booking - Capacity limits, max tickets per purchase, registration deadlines - Multi-listing booking - combine listings in one URL (`/ticket/listing1+listing2`), one form, one checkout - Multi-booking link builder on the dashboard for generating combined-listing URLs - Listing QR code SVG (`/ticket/:slug/qr`) for posters and printed materials - Embeddable via iframe with configurable CSP frame-ancestors - Custom thank-you URL or default confirmation page - Non-transferable tickets - per-listing toggle requiring ID verification at check-in - Listing image and file attachment uploads (encrypted, stored on Bunny CDN) - Manual attendee creation from the admin listing page (walk-ins, comps) ### Payments - Stripe, Square, and SumUp, with a provider interface so adding others is straightforward - Enter your API key in admin settings and the webhook endpoint configures itself - Checkout sessions with metadata, webhook-driven attendee creation - Configurable booking fee added to each transaction - "Pay what you want" pricing with optional minimum and maximum - Deposits / partial payments: take a flat, percentage, or per-item amount up front and track the rest as owed - Self-service balance payment: attendees get a signed, PII-free `/pay/:token` link to pay off what they owe, no login - With no provider configured, paid bookings are still accepted and recorded as a balance owed - Automatic refund if capacity exceeded after payment or listing price changes during checkout - Admin-issued full refunds for individual attendees or all attendees in bulk ### Tax - Owners select No tax, Add tax to listed prices, or Listed prices include tax. Rates support two decimal places. A rate of 0% is valid. - Tax applies after surcharges and discounts. Booking fees remain outside tax. - Each booking stores its original price basis and tax policy. A settings edit does not change money on past bookings. - An explicit attendee save applies the current policy to the original basis. The form shows the tax and balance before and after the save. - A save adds ledger corrections. It does not take or return money. A negative balance means that the attendee has credit. - Percentage deposits use the total with tax. Fixed and per-item deposits keep their stated amounts. Balance payments do not add tax again. - Signed checkout metadata retains the charged policy. Old signed sessions without a tax policy remain untaxed. - Refunds reverse the original entries and every tax correction. The existing review rules still apply to unsettled payments and operator money. `deno task verify:models` checks the production-derived VAT machine with Apalache. It checks the initial state and an unrestricted inductive step. The arithmetic domain uses representative minor-unit amounts. These checks do not prove database atomicity or provider behaviour. They do not establish legal tax compliance. For model authors and reviewers, the [model verification guide](docs/model-verification.md) explains the commands, focused exemplars, evidence boundaries, and limits of advisory code grades. ### Check-in - Each ticket gets a unique URL (`/t/:token`) with a QR code - Staff scan QR to reach check-in page, toggle check-in/out - Built-in QR scanner - open from a listing page, uses device camera, check-in-only (no accidental check-outs) - ID verification prompt for non-transferable listings before completing check-in - Cross-listing detection: scanner warns if a ticket belongs to a different listing - Multi-ticket view for multi-listing bookings (`/t/token1+token2`) ### Wallet passes - Apple Wallet: generates `.pkpass` files with listing details and barcode - Web service API for automatic Apple pass updates (follows the Apple Wallet spec) - Google Wallet: inline RS256-signed "Add to Google Wallet" save links - Configurable via admin settings or environment variables ### Localisation - ICU MessageFormat copy with locale picked from the `Accept-Language` header - Rebrand layer (`I18N_REPLACEMENTS`): substring replacements (for example `ticket|booking`) that rewrite copy without touching HTML, links, or interpolated values, applied once at load ### Admin - Listing CRUD, duplicate, deactivate/reactivate, delete (requires typing listing name) - Calendar view for daily listings with per-date attendee counts - Attendee list with date filtering (daily listings), check-in status filtering - Attendee editing - update name, contact details, quantity, or reassign to a different listing - CSV export (respects active filters) - Per-listing and global activity log (creation, updates, check-ins, exports, refunds, deletions) - Holiday/blackout date management for daily listings - Multi-user with graded roles: owners invite managers (full back office) via time-limited links (7-day expiry), plus a content-only `editor` (edits listings/site but holds no data key, so attendee PII stays undecryptable), a delivery `agent` (locked to its own run sheet), and a door-only `scanner` (checks people in and out, sees the doors page only) - Session management: view active sessions, kill all others - Attendee merge: deduplicate records with a review-then-apply diff that repoints ledger entries and posts write-off adjustments so balances stay correct - Contact history per email/phone: last-contacted, visit/booking counts, and an owner-encrypted private note, keyed by a blind HMAC index - Bulk email: compose/preview/send to filtered attendee groups with reusable subject/body templates (encrypted under the owner key); recipients get one-click unsubscribe / resubscribe / erase links - Catalog import/export: export any listing or group as portable JSON and re-import it to move a catalog between sites - Settings: payment provider config, email templates, custom domain, embed host restrictions, terms and conditions, password change - Privacy tools (`/admin/privacy`): plain-language data-minimisation guidance, automatic/manual purging of orphaned attendee records, and GDPR erasure of a contact's recognition record by email or phone - Demo mode (`DEMO_MODE=true`): replaces all user-entered text with generated sample data so demos hold no real PII - Branding: custom header image, website title, theme colours - Built-in admin guide (`/admin/guide`) with FAQ for all features - Ntfy error notifications for production monitoring (optional; sends domain + error code only, never PII) ### Logistics - Optional postcode/address lookup on booking and admin forms, via a same-origin proxy that keeps the provider key server-side, caches results encrypted, and rate-limits anonymous use; provider is pluggable - Drop-off and collection dates per booking (collection on the last booked day) - Van/agent allocations: assign a drop-off and collection agent per booking, filter the calendar by agent - Delivery driver login (`agent` role): an auto-generated run sheet of today's and tomorrow's drop-offs and collections with per-leg done toggles, walled off from the rest of admin ### Multi-site hosting - One-click site builder: provision a new tenant on Bunny Edge or Deno Deploy, auto-creating its database and its own encryption key - Sell sites as products: buying a "site" listing auto-provisions and assigns a live site to the buyer, with its own renewal tracking and tokenised `/renew` flow - Self-updating fleet: each site records its build commit; the host sees which sites are behind and redeploys them from the latest GitHub release - Secret backfill: detects host secrets a site is missing and fills them in without overwriting deliberately-changed values ### Embedding - Generated `