OctoWiki

Octopus Handover Wiki

Single source of truth for taking over the Octopus voucher/topup/eSIM platform — architecture, infrastructure, Cloudflare, vendors, and operations.

Welcome. This wiki is the handover pack for the Octopus platform. It was written to get a new maintainer productive without prior context — how the system is built, where every piece runs, how to deploy it, and the hard-won gotchas that are not obvious from the code.

Read the safety rules first

Two absolute rules were followed while building this system and must continue to be:

  1. Never run ad-hoc INSERT/UPDATE/DELETE against the production database. All data changes go through the app or migrations. Use SELECT for investigation only.
  2. Migrations are applied by a human operator, never auto-applied on app start. Same for D1 migrations on the Cloudflare side.

What Octopus is

Octopus is a high-performance, multi-tenant B2B commerce & fulfilment platform written in Go. Clients (tenants) buy digital products through one API:

  • Vouchers / gift cards — the original line (the "Octopus Cards" brand).
  • Direct top-ups — mobile & gaming recharge.
  • eSIM — data plans.
  • Payouts — outbound money to beneficiaries.

Each vertical is toggled by a feature flag, so a deployment can ship any subset. The platform sits between clients (who consume the /api/v1 API or the client portal) and a fleet of vendor adapters (upstream suppliers: DT One, SEAGM, Runa, NeoCurrency, EpinForce, etc.).

The cardinal product rule

To the customer, Octopus does everything itself. Vendor topology (brand names, the words "vendor/upstream/supplier") is never exposed in any client-facing surface — API responses, docs, emails, the client panel, or the claim page. This is a hard rule enforced throughout the code and data model. See the Memory Appendix.

System context

The 60-second mental model

Where things run (at a glance)

SurfaceRuns onDomain
Go API + Admin (PROD)Hetzner 65.109.119.112, systemdapi.octopuscards.io, warden.octopuscards.io
Go API + Admin (SANDBOX)Hetzner 94.130.137.222, systemdsandbox-api.*, sandbox-warden.*
Client portal (Next.js)same servers, systemd Nodeapp.octopuscards.io, sandbox-app.*
Claim page (Grasshopper)Cloudflare Workersclaim.octopuscards.io, sandbox-claim.*
Marketing siteCloudflare Pagesoctopuscards.io, www.*
Developer docsCloudflare Pagesdeveloper.octopuscards.io
Observability (SigNoz)94.130.137.222telemetry.octopuscards.io (UI), otel.* (ingest)

How to use this wiki

Read Start Here first. It's the map and compass — how the 11 sections are organized, reading paths by goal (onboarding, firefighting, tracing an order, following the money, touching a vendor, changing the API, deploying), and the conventions (file:line citations, Callouts, the 🔴🟠🟢 index, the memory appendix). This wiki is exhaustive by design; read it by goal, not front-to-back.

Quick jumps:

This wiki itself is a Fumadocs (Next.js) app in frontend/handover-wiki/. Run it with bun run dev from that directory. It has no deploy pipeline yet — see Frontend Apps.

On this page