Hofwams: money, tickets and catering on one backend
An event platform where organizers sell tickets, run RSVPs and check in guests, then plan catering from who is actually coming.
- Role
- Lead engineer
- Timeline
- Dec 2024 to now
- Status
- Live at hofwams.com
- Stack
- NestJS, Postgres, Prisma, Redis, BullMQ, Stripe Connect, Next.js
- Problem
- Event organizers juggled separate tools for tickets, RSVPs, check-in and payouts, and guessed at catering.
- What I did
- Led the build of one platform for all of it: a NestJS backend with Stripe Connect payouts, a race-safe credit ledger and QR check-in, plus the web and admin apps. Then simplified event setup when the first version left events stuck in draft.
- Result
- Over 100 organizers and 50+ published events, mostly private ones like birthdays. Paid ticketing, door check-in, catering forecasts and direct payouts are all in use.

The system
Event organizers were juggling a ticketing tool, a spreadsheet of RSVPs, a payments dashboard and a guess at how much food to order. Hofwams puts those in one place and adds catering intelligence: dietary capture at registration and a serving prediction that turns guest counts into a kitchen plan.
Most of the risk sits in the backend. Money moves through Stripe Connect straight to organizers, credits are spent concurrently, and two door staff can scan the same QR code at the same moment.
Lead engineer since December 2024, working with a frontend engineer, a DevOps engineer and a designer. I own the architecture across the product, lead the backend, and wrote much of the web client and the admin app.
- organizers
- 100+
- published events
- 50+
- tests
- 1,370+
Hofwams at a glance. Hover or tap a node to see what it does.
Event setup people actually finish
The first version of event setup asked for everything up front. Organizers started events, hit a wall of fields and left them in draft. So we cut the flow down to what an event needs to go live, and made everything else optional: skip it, expand it to fill in now, or come back to it later.
More events made it from draft to published, and organizers started running paid and other kinds of events, not only free ones. We also added in-app feedback, so concerns reach us directly instead of showing up as abandoned drafts.
A credit ledger that cannot overspend
credit-ledger.service.ts (simplified)
const { count } = await tx.credits.updateMany({ where: { userId, available: { gte: amount } }, data: { available: { decrement: amount } },});if (count === 0) throw new PaymentRequired(); // 402
Two tabs spend 40 credits at the same moment.
Organizers spend credits on platform features, and spends can land at the same instant from different tabs, jobs or webhooks. Reading the balance, checking it and then writing is exactly where double spends come from.
So the check lives inside the write. A debit is one conditional update that only succeeds while the available balance covers the amount, committed in the same transaction as its usage and transaction rows. Concurrent spends serialize in Postgres instead of in application code. Grants carry derived idempotency keys, so a redelivered event cannot grant twice, and corrections are compensating refund rows rather than edits.
Single-writer CreditLedgerService with a dedicated concurrency test suite.
Webhooks that are allowed to fail
stripe-webhooks.service.ts (simplified)
const event = verifySignature(rawBody, signature);const saved = await upsertEvent(event.id); // unique idif (saved.processedAt) return; // retry of a handled eventtry { await route(event); } catch (err) { throw err; // 500: Stripe retries the credit purchase}
Stripe sends a payment.succeeded event.
One webhook endpoint serves both the platform account and Connect accounts, each with its own signing secret. Every event is persisted with its Stripe event id as a unique key, a retry count and the last processing error, then routed by what the payment was for: a ticket order or a credit purchase.
Credit purchase failures deliberately return an error so Stripe retries, and a reconciliation cron catches anything that still slips through. The grant, the purchase record and the payment status share one commit behind a PENDING guard.
Race-free check-in
registration-check-in.service.ts (simplified)
const { count } = await db.registration.updateMany({ where: { id, checkedInAt: null }, data: { checkedInAt: new Date() },});if (count === 0) return { status: "already_checked_in" };
Two volunteers scan the same ticket at once.
Two volunteers scanning the same ticket used to be able to check one guest in twice. The fix moved the condition into the write itself, so only one scan can flip the registration, and the other gets a clear already checked in response. The race now has a regression test.
Queues you can run without Redis
queue.module.ts (simplified)
provide: QUEUE,useClass: env.QUEUE_DRIVER === "bullmq" ? BullMqQueue // production: Redis, retries : InMemoryQueue, // dev and tests await queue.add("send-reminder", { eventId });
Features enqueue jobs through one small interface.
Background work runs through a small queue abstraction with two strategies: in memory for local development and tests, BullMQ in production. The same decorators and retry semantics apply to both. It drives abandoned checkout recovery, stale order cleanup, reminders, retention purges and credit reconciliation.
Realtime updates go over SSE with Redis fan-out, reconnect with jittered backoff and a Last-Event-ID replay buffer, so a phone that drops signal at the door catches up instead of missing check-ins.
Decisions worth defending
One writer, one conditional update
Every debit goes through the ledger service, so the rule lives in a single write, and a failed spend returns a clear 402 rather than a database error.
Ask only for what goes live
Setup requires what an event needs to publish. Everything else is optional and can wait, because a finished simple event beats an abandoned complete one.
Modular monolith
One deployable, 28 modules with clear boundaries. Splitting services would have added network failure modes before scale asked for them.
Feature flags off by default
The WhatsApp channel and its Flows endpoint ship dark until consent and templates are approved.
In their words
When MJ joined, HOFWAMS was still an idea. He led the product’s architecture and development, frontend and backend, and built what our organizers rely on: tickets, RSVPs, QR check-in and direct payouts. When organizers were leaving events stuck in draft, he simplified setup and more of them went live. I would especially recommend him to early-stage startups that need an engineer who can do more than just write code.
Paul Olatunji