// saas platform
Patchgrid
Multi-tenant IT service management with isolation enforced by the database.
Patchgrid is a ticketing and operations platform for IT and security teams. Each company gets its own subdomain, and its data is isolated at the database level through five independent layers, not by remembering a WHERE clause.
- year
- 2026
- type
- saas platform
- group
- platforms and backends
- status
- in active development
the problem
//01the problem
Multi-tenant apps usually trust every query to filter by tenant. One forgotten filter leaks another customer's tickets. I wanted a platform where a cross-tenant read is not a bug you can write.
how it works
//02how it works
- 01
Five layers of isolation
Composite (orgId, id) foreign keys make a cross-tenant reference unrepresentable. The tenant comes from the credential, never the host. Every repository method takes an explicit orgId. A Prisma client extension sets a transaction-local config and throws without context. Postgres enforces it all with FORCE ROW LEVEL SECURITY and an app role that holds no BYPASSRLS.
- 02
Four ITIL records, four lifecycles
Incidents, service requests, problems and changes are modeled as different things with their own states. Priority is computed from impact and urgency, never typed into a dropdown.
- 03
Invariants you can run
A db:doctor script asserts the isolation guarantees actually hold against a live database, so the architecture is tested, not just described.
measured
//03measured
- 5
- isolation layers
- keys, credential, repository, prisma, postgres rls
- 4
- itil record types
- incident, request, problem, change
- 1
- subdomain per tenant
- marketing, workspace and api in one monorepo
highlights
//04highlights
- Subdomain per tenant across a Turborepo monorepo: marketing site, tenant workspace and API
- Row level security forced on every tenant table
- Priority derived from impact x urgency
- CI with CodeQL analysis on every change
built with
- NestJS
- Next.js
- PostgreSQL
- Prisma
- Turborepo
- Zod
- Docker
//05contact
Say hello. I read everything.
Email is the fastest way to reach me. For anything that needs a conversation, book a call.
to
- name
- Khaled Saeed
- country
- Lebanon