01

Overview

Adminly helps individuals and the self-employed with admin in Switzerland: taxes, moving house, starting a business, arriving in Switzerland, VAT, health insurance. Its core is the "Life situations" flow: a questionnaire produces a dated to-do plan adapted to the canton, with a free preview, a paid offer, a PDF export and email reminders. It is a personal project in production; it has not proven itself commercially yet.

This case study follows three pieces of work from November 2026: backups that can actually be restored, a delivery pipeline, and a security audit with its fixes.

02

Context

Adminly started as a five-module SaaS with a portal for fiduciaries. In May 2026, I refocused it on "Life situations"; the former scope has not been developed since. Along the way, the product had built up several purchase flows.

It is a containerised Next.js 16 application of about 108,000 lines, behind Caddy, with a managed database on a free plan that has no native backup. It handles accounts, payments and sensitive data: answers that can touch on health, and tax data. Until 9 November 2026, deployment was a script run as root that pulled the branch and built the working copy.

03

Challenge

An admin assistant is only worth anything if it is accurate, current and safe: it handles personal data, payments and rules that change from one canton to the next.

Backups. The audit of 4 November 2026 showed that the nightly dump could not be restored: it held neither the accounts, nor the permissions, nor the files, and its clean-up option destroyed the target schema. The storage key kept on the server could erase the whole history, and five other services on the server had no backup off the disk.

Delivery. The audit of 11 November 2026 rated deployment "fragile": no lock, a build from a directory the agents could modify, a single level of rollback, a lax health check, and an image clean-up that could affect other projects. There was no CI, and no protection of the main branch (not available on the plan in use).

Security. The read-only audit of 9 November 2026 raised 18 findings, 3 of them critical: account takeover during a purchase made without logging in, a business account taking over a customer, and paid access granted by directly updating a table. On top of that, monitoring had been blind for 83 days and the framework ran a vulnerable version.

04

Objectives

  • A dated plan adapted to the canton
  • Safe payment
  • Protected personal data
  • Backups proven by real restores
  • Deployments that don't break production

05

Technical decisions

Containerised Next.js application served behind Caddy on my server; managed Supabase database in Frankfurt (PostgreSQL 17, authentication, private storage, Vault); Stripe redirect checkout with a signed, idempotent webhook; email via Resend; admin notifications on Telegram. Row-level security (RLS) is enabled on all 43 public tables in production (15.11.2026), and its policies are tested role by role in a faithful local staging environment.

Backups. Three independent daily chains (Adminly, a second product, the server infrastructure): restorable archive → symmetric encryption → upload to object storage with a 30-day object lock → fingerprint check → daily check with an alert → freshness monitoring every 15 minutes. The upload keys have no delete permission. The restore procedure is written down and shipped inside the archive; the passphrases are kept off the server.

Delivery. A GitHub Actions CI with no secret at all: types → ratcheted lint (never worse than the baseline) → tests → build → route guard → smoke test against a real server → dependency audit, plus a separate, non-blocking job for "date alarms". Deployment is a root script that cannot be modified: it takes a commit, checks that it is the tip of the main branch, builds from a Git archive, tries the image on a secondary port, switches over, requires the health route to return that commit, rolls back on its own otherwise, and keeps 5 images. A local hook refuses any direct push to the main branch; a local CI image replays the sequence before pushing.

Security. Access after a purchase goes through a link sent to the account's address, tied to the payment session. Client-side update policies were removed: access status is now written by the server only, with a guard trigger in the database. The payment webhook is signed, idempotent and rejects test events. The notification secret moved into the database vault; monitoring got a read-only role; needless rights were taken away from public roles. RLS tests run role by role in a faithful staging environment.

06

Architecture

Browser → Caddy → Next.js application (container, production server) → Supabase (Frankfurt); external services: Stripe, Resend, Telegram.

Commit → CI (GitHub Actions) → deployment script → image tried on a secondary port → switch-over → commit-bound health check → automatic rollback on failure. Database, accounts and files → encrypted archive → off-site object storage, locked for 30 days.

07

Technologies

  • TypeScript 5
  • Next.js 16.4.6
  • React 19.2.4
  • Tailwind CSS 4
  • Node 24.22.3
  • Supabase (PostgreSQL 17, Auth, Storage, Vault)
  • PostgreSQL RLS, triggers, pg_dump
  • Stripe (webhooks)
  • Resend
  • Docker (multi-stage)
  • Caddy
  • GitHub Actions
  • Vitest
  • ESLint
  • GnuPG
  • Bash, cron

Versions as of 15 November 2026. Size: about 108,000 lines of TypeScript, 694 files, 56 pages, 75 API routes.

08

Implementation

Backups. The difficulties: rebuilding the exact permissions of a managed database, restoring accounts with their triggers, and identifying the exact production versions to set up a faithful stack; the provider migrated a component during the test, and its secrets vault cannot be exported. The answers: a four-step restore (schema with permissions, exact permissions, authentication triggers, data in replication mode), versions deduced from the fingerprints of production migrations, a row-by-row checksum comparison, and documentation of what is not backed up and how to recreate it.

Delivery. The difficulties: 114 inherited lint errors, tests depending on the date or the time zone, the need for Docker in local CI when the agents no longer have access to it, and a tight disk (each build adds 1 to 2.5 GB). The answers: a ratchet (never do worse than the baseline) rather than a full block, date tests isolated in a non-blocking job, a fixed root command for local CI, a logged nightly clean-up of the build cache, and a test bench for the deployment script with a fake Docker.

Security. The difficulties: fixing, without regression, a payment flow not covered by end-to-end tests; proving that a policy is really closed; and, during the work, a secret displayed by mistake by a read query. The answers: RLS tests that fail without the migration and pass with it (6 failures, then 21 out of 21), reversible emergency measures before the underlying fix, rotation of the exposed secret within the hour, recorded as an incident, and an automatic guard against open policies.

09

Results

  • Backups, 4 November 2026: 14 checks out of 14 and 6 files out of 6, about 452,600 identical rows, in 14 seconds.
  • Backups, 10 November 2026: end-to-end restore from off-site storage, 7 out of 7 and 9 out of 9, archive identical to the byte. 11 November: infrastructure chain, 19 out of 19. 13 November: second product, 18 tables out of 18.
  • Backups can no longer be erased from the server for 30 days.
  • Delivery: 22 PRs shipped through this pipeline in 6 days (10–15 November 2026); a CI job of about 3 minutes; about 2,600 tests run, per the logs of 10 to 13 November 2026; rollback in one command. Recorded incident: CI red for about 24 hours because a new route was missing from a reference list.
  • Security: all 3 critical findings were closed on the evening of 9 November 2026. The next day: production dependencies brought from 13 vulnerabilities to 0, the notification secret in the vault, tokens revoked, monitoring restored with a "monitoring down" alert. No real sale had taken place, so no one was harmed.

10

Limits

  • Backups: data restore only; neither the recovery time nor a full rebuild of the service has been tested.
  • Delivery: no end-to-end test; database migrations without rollback; deployment triggered by hand.
  • Security: some points remain open after the audit; they are written down and being dealt with.
  • Also still to do as of 15 November 2026: structured logging and full availability monitoring.

11

My role

I defined the product and its refocus on "Life situations", and chose the priorities and editorial rules. The code is largely produced with Claude Code: 287 of 337 commits (85 %) carry a Claude co-signature as of 15 November 2026.

Backups: I required real proof and no mock object, approved each step, created the buckets, the lock and the restricted keys from my own computer, and installed the scripts. The restore method and the scripts were written by Claude Code.

Delivery: I push, merge each PR after green CI, trigger each deployment and check its outcome; I decided the workflow and the version pinning. The CI code, the deployment script and its test bench were written by Claude Code.

Security: I commissioned the audit, decided what was urgent, authorised each measure and applied it, or had it applied, on my explicit go-ahead; I renewed the secrets and revoked the tokens. The analysis, fixes and tests were written by Claude Code.

12

Lessons learned

A backup is only reliable after a successful restore; a deployment must also be verifiable and reversible.

Contact

Let's build something reliable.

Available immediately for a systems administrator role, and always up for making a system reliable or talking through a product.

Get in touch