SaaS site and billingVirtual-office SaaS companyanonymised, sample data
Doorlit is the marketing site and account layer for a virtual-office product used by remote teams. Pages are prerendered static HTML. A few server routes handle sign-in, checkout, seat billing and a signed hand-off into the app.
A pricing card is set to five seats and a test checkout completes, then adding a member raises the paid seats to six with a prorated charge. A signed pass hands the user into a placeholder app.
The client runs a virtual-office app in a separate codebase. They needed a public site to explain it, plus payments and account management, without disturbing the live app's sign-in. Client details are anonymised.
A founder on a no-code forum asked: "If I add a new user halfway through the billing period, is my card charged immediately for that extra seat?" Seat billing raises that question constantly. This team also needed paid seats to match real team size in both directions, a trial with no card, and a way into the app that the browser could not forge.
The product worked, but sign-up, checkout and seat-based billing were held together by hand, and seats added in the app never reached the invoice. I built Doorlit as the marketing site and account layer, with per-seat billing that stays in step with the team size.
I kept every visitor-facing page static and moved anything touching money or identity into server routes. The payment provider's webhook is the only thing allowed to record a payment. The site decides whether each office is paid for and tells the app. The app trusts only a short-lived pass the site signs after checking the session itself.
Not in this build. The first office gets a 14-day trial with no card, by the client's decision.
The office is blocked until billing is fixed, so nobody gets an unpaid seat.
This build used a merchant-of-record provider. The same webhook and seat-sync patterns apply to Stripe, but I have not built this version on Stripe.

Tell me the problem in your own words. I will reply with what would carry over from this build and what would change for you.
Astro builds every visitor page to static HTML. On Vercel only the API routes run as functions. Those routes talk to Supabase for sign-in and billing tables, to the payment provider for checkout and seats, and to the app's server for offices and billing status. Two Supabase Edge Functions bridge Google sign-in. Entry into the app goes through a signed pass that expires after 60 seconds.
The webhook writes an idempotency record before working. A failure after that record made the provider's retry look like a duplicate, so the payment was never saved. Failures now remove the record, so a retry really retries.
Removing a seat changes only the next renewal. Adding one charges straight away, and if that charge fails the office is blocked rather than letting someone in unpaid.
The hand-off checks the session on the server, requires a confirmed email and signs a single-use pass that expires in 60 seconds.
A build setting produced files that worked locally but not on the static host. I kept the directory output format and documented why.
Facing the same problem in your business?
Send an enquirySaaS founders who want a marketing site separate from the app but sharing accounts and billing, and teams moving to per-seat pricing who need paid seats to track real usage.