← Back to Blog
Backend & Data2 min read

Setting Up Supabase Properly: Database, RLS, Migrations and Secrets

It is extremely easy to start using Supabase.

Create a project, create a table, copy the URL and key into the app and start writing data.

That is enough for a prototype. It is not quite enough for a project I want to keep working on.

The first thing I now think about is permissions. If the application talks directly to Supabase from the browser, Row Level Security is what decides which rows the current user can actually access. Without sensible policies, having authentication does not automatically mean the data is protected correctly.

The second thing is migrations. Clicking around in the dashboard is fine while experimenting, but once the schema matters, I want changes represented as files that can be reviewed, reproduced and applied to another environment.

Then there are secrets. The public client configuration can live in the frontend when it is designed for that purpose. Privileged service-role credentials absolutely cannot. Those belong only in trusted server-side code.

So my mental checklist for a Supabase project has become:

schema
↓
migrations
↓
RLS policies
↓
client credentials
↓
server-only credentials
↓
development / production configuration

None of these pieces is particularly difficult. The problem comes when they are postponed until the application already depends on a database that was created manually and has unclear permissions.

Supabase makes it very easy to get a backend running quickly, which is exactly why I think it is worth adding a little structure before the project grows.

The goal is not to make a small app “enterprise-ready”.

It is simply to make sure I can understand and reproduce my own backend a few months later.

Topics

SupabaseRLSmigrationssecrets