Case study · Web app foundation

The base I build client apps on. One codebase serves many companies, and each company's records are walled off inside the database itself, so a bug on a page can't show one company's data to another.

In progressWeb apps
Company A own team
Company B own team
Company C own team

One database, a wall per company

Postgres checks every row against who is asking

Diagram: three companies share one app and one database, and the database only returns each company its own rows.
How the data is kept apart. There are no public screens yet.

Why it exists

Small businesses want their own app, but building every one from nothing is slow and repeats the risky parts. I wanted one solid base where the hard things like logins, roles and keeping each company's data apart are done once and checked.

How it was made

  1. 01

    Walls in the database

    Postgres row-level security checks every row against who is asking. The page code can't hand one company's records to another, even with a bug in it.

  2. 02

    Roles per person, per company

    Each person gets a role inside their own company, and what they can see and change follows that role.

  3. 03

    Changes checked before they ship

    Database migrations are checked, and every change deploys to staging on its own, so it gets tried there first.

Where it is now

In progress. It holds real business records, so there are no screens to show here. I'll add some once there's a demo company filled with made-up data.

Built with

  • Next.js
  • Postgres
  • GitHub Actions
  • Fly.io

Services it shows

Get a quote

Tell us what you'd like built and we'll send a written quote with a fixed price and a dated plan.