RLS Generator
A visual builder that turns a schema and a role-by-operation matrix into Supabase row-level security SQL, live.
Visit the live site ↗
The 30-second version.
Row Level Security is the right way to lock down a Supabase table, and the easiest to get subtly wrong by hand.
Designed and built a role-by-operation matrix that writes policy SQL live, with a preview of which rows each role can reach.
A role-by-operation matrix that emits policy SQL live in the browser, on seven runtime dependencies and no backend.
- Presets
- 5
- Column types
- 10
- Access toggles
- 12
- Backend
- 0
Easy to want, easy to get wrong.
Developers usually know the access they want, not the exact policy syntax. A missing WITH CHECK or a forgotten ENABLE statement fails silently.
- Who: developers who know the access they want, not the syntax.
- Constraint: the tool must never touch anyone's data.
- Risk: SQL that looks right but lets the wrong rows through.
What I owned.
What I owned
- Interaction design
- SQL generator and preview logic
- Frontend
How it came together.
Access as a grid.
Roles down one axis, the four operations across the other: the whole policy surface in one glance. There's no Generate button; the SQL updates on every edit.
Show which rows each role reaches.
Sample rows carry per-role read and write badges and highlight the rows a simulated auth.uid() owns, before you run anything.
Detect the owner, or say why not.
The generator looks for user_id, owner_id or created_by and wires the auth.uid() checks; with none, it disables the owner row and explains instead of emitting something misleading.
What shipped.
- Runtime dependencies
- 7
- Preset templates
- 5
- Backend services
- 0
- InputSchema + matrixTyped columns, role × operation toggles
- TransformPure generatorsState → SQL, preview, highlight
- OutputSQL + row mapCopy or download, visual preview
Entirely client-side. There is no database, no API route, no Supabase client, and no auth anywhere; Supabase appears only in the SQL it writes. A single page holds the schema and access rules in React state, and pure functions turn that state into a policy SQL string, the sample rows, and the syntax-highlight tokens. The data model is in-app TypeScript types, not real tables; even the SQL highlighter is a small hand-rolled tokenizer, to keep the dependency list short. Staying fully client-side is what stops the tool ever touching your data, and it is equally why no policy survives a refresh and why the emitted SQL has never been run against a real Postgres to prove it correct.
- Next.js
- TypeScript
- React
- Tailwind
- lucide-react
What I'd change, and what I'd keep.
I'd do differently
Test the generated SQL against a real Postgres instance, make policies survive a refresh, and go beyond owner-or-everyone access.
I'd keep
Fully client-side, so it never touches your data.
Open to full-time product design and full-stack development roles. Let's build something people rely on.
javiertpga@gmail.com