Toolstools / supabase

Supabase

What this is

Supabase is a backend platform.

It can provide:

  • Database.
  • Authentication.
  • File storage.

Simple model:

Setting

Frontend = what users see
Backend = where data lives

Why it matters

Beginner websites can stay frontend-only.

Apps that store user data usually need a backend. Supabase is useful when the project needs saved profiles, bookings, dashboards, uploaded files, or login.

What to do

Use Supabase only when the project has a real data need.

Decide if Supabase is needed

Ask:

Reference

Does this project need to save user data after refresh?

If no, skip Supabase.

If yes, continue.

Create the project

  1. Create an account at supabase.com.
  2. Create one project.
  3. Choose a project name that matches the app.
  4. Save the database password somewhere private.
  5. Wait for the dashboard to finish provisioning.

Visual checkpoint:

Flow

Supabase Dashboard
  Project selected
  Table Editor visible
  SQL Editor visible
  Authentication visible
  Project Settings -> API visible

Create the first table

Start with one table only.

Example for a booking/contact project:

ColumnTypeMeaning
iduuidUnique row ID.
created_attimestampWhen the row was created.
nametextCustomer name.
emailtextCustomer email.
messagetextMessage or booking request.

Ask AI:

Copy prompt
I am a beginner using Supabase.

My app needs to save:
[describe data]

Suggest one first table only.
Explain each column in simple language.
Do not add authentication yet.

Core features to understand

FeatureMeaningBeginner action
DatabaseStores rows of app dataStart with one table.
Table EditorSpreadsheet-like database viewUse it to inspect data.
SQL EditorAdvanced database commandsUse later with tutor guidance.
AuthUser login systemAdd only when the app truly needs accounts.
StorageUploaded filesUse for images/files later.
API keysApp connection keysPublic anon key can be used client-side; service role key stays private.
RLSRow Level SecurityKeep it enabled and create policies before real user data.

Connect to a web app

For a Next.js project, install the client:

Terminal command
npm install @supabase/supabase-js

Add env variables locally:

Setting

NEXT_PUBLIC_SUPABASE_URL=...
NEXT_PUBLIC_SUPABASE_ANON_KEY=...

Then add the same variables in Vercel Project Settings before deploying.

Safety rule

Never put the service role key in frontend code.

Use this check:

Setting

Anon key = okay for browser use
Service role key = server only, never public

Common mistakes

  • Adding Supabase too early.
  • Starting with authentication before understanding the app.
  • Creating too many tables.
  • Copying database code without knowing where it belongs.
  • Turning off Row Level Security without understanding the risk.
  • Putting service role keys in .env.local and then pushing them.
  • Connecting frontend before the table design is clear.

Next step

Go to Links.