Open source · MIT · Deno 2

The groundwork of a SaaS, already built.

Template is an open-source starter for multi-user web products. Accounts with a second factor, groups with roles, billing per member, realtime and an offline app are wired together, so your first week goes to your product, not to sign-in.

The demo is the app you get on day one, with nothing added.

Who it is for

Developers starting a product that many people use together, who want sign-in, groups, billing and deployment settled before the first feature. It runs on a server you control. Skip it if you deploy to serverless functions.

What you get

Each part works today.

How it works

Four parts, one repository, one server.

  1. The API

    Hono on Deno. It holds every rule: who may do what, in which group. It is the only part that writes to Postgres.

  2. The web app

    Preact. It is what your users sign in to. It calls the API and listens on a WebSocket, so it shows other people's changes as they happen.

  3. The worker

    It reads the events the API wrote next to each change and does the slow work: mail, notifications, clean-up.

  4. The website

    Fresh, rendered on the server, like this page. It explains your product and links into the app.

Quick start

You need Deno 2, Docker and the GitHub CLI.

gh repo create my-product --template spy4x/template --private --clone
cd my-product
cp infra/envs/.env.example infra/envs/.env   # then fill in the secrets
deno task vapid-key:create
deno task proxy:start
deno task dev

Then open the address in DOMAIN, app.localhost by default. The README lists every secret to fill in and how to deploy.

Honest status

Work in progress, built in public. Here is where it stands.

Works today

  • Sign-up, sign-in, e-mail verification, password reset and the second factor
  • Groups with members, roles, invitations and ownership transfer
  • Billing per member with trials, through Stripe
  • Notes, the example feature to copy for your own
  • Realtime updates, the offline app and web push
  • The outbox worker, the mailing list and this website

Not built yet

  • Sign-in with Google, GitHub or passkeys
  • Downloading an account's data
  • Parts of the worker

Built in public

I'm Anton Shubin. I build client MVPs on this template and develop it in the open. If something is missing for your product, or you just want to say what you think, open an issue or write to me.