📖 Scenario: You just created a new Supabase project and need to set up your first table, connect from JavaScript, and verify the API works. You'll use both the SQL Editor and the client library.
🎯 Goal: Initialize a Supabase client, create a table via SQL, insert data, and query it from the client to verify the full setup.
📋 What You'll Learn
Initialize the Supabase client with project credentials
Create a table using SQL
Insert sample data
Query data using the Supabase client
💡 Why This Matters
🌍 Real World
Every Supabase project starts with the dashboard. Understanding how dashboard sections map to client operations is the foundation for building full-stack applications.
💼 Career
Full-stack developers use the Supabase dashboard daily to manage databases, configure auth, and debug API issues.
Progress0 / 4 steps
1
Initialize the Supabase client
Import createClient from '@supabase/supabase-js' and create a supabase client using createClient() with your project URL 'https://myproject.supabase.co' and anon key 'my-anon-key'.
Supabase
Hint
Use createClient(url, anonKey) with the values from Settings → API in the dashboard.
2
Create a table via SQL Editor
Write SQL to create a public.todos table with columns: id as BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, task as TEXT NOT NULL, and is_done as BOOLEAN DEFAULT false. Then enable Row Level Security on it.
Supabase
Hint
Use BIGINT GENERATED BY DEFAULT AS IDENTITY for the primary key — this is Supabase's default pattern.
3
Insert sample data
Use the Supabase client to insert two todos using supabase.from('todos').insert(). Insert an array with { task: 'Learn Supabase' } and { task: 'Build an app' }.
Supabase
Hint
Use .from('todos').insert([array]) to insert multiple rows at once.
4
Query data using the client
Use the Supabase client to select all rows from todos where is_done is false, ordered by id ascending. Use .from('todos').select('*').eq('is_done', false).order('id', { ascending: true }).
Supabase
Hint
Chain .select(), .eq(), and .order() to filter and sort results.
Practice
(1/5)
1. What is the main purpose of the Supabase dashboard?
easy
A. To create graphic designs for marketing
B. To manage projects, databases, and monitor usage in one place
C. To design mobile app interfaces
D. To write complex SQL queries only
Solution
Step 1: Understand the dashboard role
The Supabase dashboard is described as a control center for managing projects and data.
Step 2: Identify main functions
It helps manage databases, authentication, storage, and monitor usage, all in one place.
Final Answer:
To manage projects, databases, and monitor usage in one place -> Option B
Quick Check:
Dashboard = Manage projects and data [OK]
Hint: Dashboard = control center for projects and data [OK]
Common Mistakes:
Thinking dashboard is only for SQL queries
Confusing dashboard with design tools
Assuming it is for marketing tasks
2. Which section would you NOT expect to find in the Supabase dashboard?
easy
A. Storage file browser
B. Database table editor
C. Video editing studio
D. Authentication management
Solution
Step 1: List dashboard features
The dashboard includes authentication, database, and storage management.
Step 2: Identify unrelated feature
Video editing is unrelated to database or project management in Supabase.
Final Answer:
Video editing studio -> Option C
Quick Check:
Dashboard excludes video editing [OK]
Hint: Dashboard manages data, not video editing [OK]
Common Mistakes:
Confusing storage with media editing
Assuming all tools are included
Mixing dashboard with external apps
3. Given this Supabase dashboard snippet showing usage stats: