Learn how to set up a cloud database for your React applications using Supabase - a free, easy-to-use backend platform.
What is Supabase? An open-source Firebase alternative that provides a PostgreSQL database, authentication, storage, and real-time subscriptions.
Before you begin:
Time Required: 15-20 minutes
Go to supabase.com and create a free account.
💡 Tip: Use your school or personal email. You’ll need to verify your email address.
After logging in, click “New Project” to start.
What to enter:
Wait for your project to finish setting up (this takes 1-2 minutes). You’ll see a loading screen while Supabase creates your database.
⚠️ Important: Save your database password! You’ll need it to connect from your app.
What’s happening: Supabase is creating a PostgreSQL database, setting up authentication, and configuring your project.
Once your project is ready, click on the Table Editor icon in the left sidebar.
What is the Table Editor? A visual interface for creating and managing database tables - think of it like a spreadsheet for your data.
Click “New Table” to create a table for your data.
What to enter:
💡 Naming Tips:
user_profiles)Define what information each row will store by adding columns.
Example for a Todo List App:
| Column Name | Type | Options |
|---|---|---|
| id | int8 | Primary key, auto-increment (created automatically) |
| created_at | timestamptz | Default: now() (created automatically) |
| task | text | Required |
| completed | bool | Default: false |
| priority | text | Optional |
Common Column Types:
💡 Tip: The id and created_at columns are added automatically - you usually don’t need to change these!
Click “Insert” → “Insert row” to add data to your table.
Fill in the values for your new row.
Example for Todo List:
Note: You don’t need to fill in id or created_at - these are auto-generated!
Click “Save” when done.
Add at least 3 rows of data to your table. This will help you test your app later!
💡 Practice Tip: Add diverse data to test different scenarios:
To let your React app read data, you need to set up security policies.
Click on “RLS” (Row Level Security) or “Policies” tab, then click “New Policy”.
This opens the policy creation screen where you can configure security rules.
Select the first template on the left: “Enable read access for all users”
This allows anyone to read your data (perfect for demo apps and learning projects).
When to use this:
⚠️ Security Note: For production apps with private data, you’ll want more restrictive policies!
To let your React app create new data, add another policy.
Click “New Policy” again.
Steps:
true to the “with check” statement in the policyThis allows anyone to create new rows in your table.
⚠️ Security Warning: Only use this for demo apps and learning! Real apps should authenticate users first.
Your Supabase database is now ready to connect to your React app!
What you have:
You’ll need:
Stay tuned for the React integration guide!
Coming Next:
Solution:
Solution:
Solution:
Official Documentation:
Video Tutorials:
Supabase Dashboard Sections:
Common Terms:
Congratulations! You’ve set up your first cloud database. You’re ready to build data-driven applications! 🚀
Attribution: This guide was created with assistance from Claude AI (Anthropic) to provide clear, step-by-step instructions for setting up Supabase.