Bird
Raised Fist0
Supabasecloud~20 mins

Setting up a Supabase project - Practice Exercises

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Supabase Setup Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Supabase Project Initialization

When you create a new Supabase project, what is the first essential step to connect your application to the Supabase backend?

AObtain the API URL and anon public key from the Supabase dashboard to configure your client.
BInstall a local database server on your machine before creating the project.
CWrite SQL queries manually before creating the project to define tables.
DSet up a virtual machine to host the Supabase backend.
Attempts:
2 left
💡 Hint

Think about what you need to connect your app to the cloud service after project creation.

❓ Configuration
intermediate
2:00remaining
Supabase Environment Variable Setup

You want to securely store your Supabase project URL and anon key in a Node.js app. Which environment variable setup is correct?

Supabase
import { createClient } from '@supabase/supabase-js';

const supabaseUrl = process.env.SUPABASE_URL;
const supabaseKey = process.env.SUPABASE_ANON_KEY;
const supabase = createClient(supabaseUrl, supabaseKey);
AUse a global variable in the browser to store the URL and key.
BHardcode the URL and key directly in the code for faster access.
CStore the URL and key in a JSON file and import it directly.
DSet SUPABASE_URL and SUPABASE_ANON_KEY in a .env file and load them with dotenv package.
Attempts:
2 left
💡 Hint

Think about keeping secrets safe and not exposing keys in code.

❓ Architecture
advanced
3:00remaining
Choosing Supabase Database Schema Design

You are designing a Supabase project for a simple blog. Which schema design best supports posts with multiple tags and user comments?

ACreate tables: posts, tags, post_tags (join table), users, comments with foreign keys linking appropriately.
BCreate one big table combining posts, tags, users, and comments in columns.
CCreate tables: posts, tags, users only; store comments inside posts as JSON.
DCreate tables: posts and comments only, store tags as comma-separated strings in posts.
Attempts:
2 left
💡 Hint

Think about how to represent many-to-many relationships and keep data organized.

❓ security
advanced
3:00remaining
Supabase Row Level Security (RLS) Configuration

You want to restrict access so users can only read their own profile data in Supabase. Which RLS policy is correct?

Supabase
CREATE POLICY "Users can view their own profile" ON profiles
FOR SELECT USING (auth.uid() = user_id);
ACREATE POLICY "Users can view all profiles" ON profiles FOR SELECT USING (true);
BCREATE POLICY "Users can view their own profile" ON profiles FOR SELECT USING (auth.uid() = user_id);
CCREATE POLICY "Users can view profiles" ON profiles FOR SELECT USING (user_id = 'admin');
DNo policy needed; all profiles are public by default.
Attempts:
2 left
💡 Hint

Think about matching the authenticated user ID to the profile's user ID.

❓ service_behavior
expert
3:00remaining
Supabase Realtime Behavior on Database Changes

In a Supabase project with Realtime enabled on the 'messages' table, what happens when a new message row is inserted?

AClients receive an event only if they query the table again.
BOnly the client that inserted the row receives an event notification.
CAll clients subscribed to 'messages' receive an event with the new row data immediately.
DNo event is sent until the database is manually refreshed.
Attempts:
2 left
💡 Hint

Think about how realtime subscriptions work to keep clients updated.

Practice

(1/5)
1. What is the first step when setting up a new Supabase project?
easy
A. Choose a project name, password, and region on the Supabase website
B. Write SQL queries to create tables
C. Install Supabase CLI on your computer
D. Connect your project to a third-party API

Solution

  1. Step 1: Access the Supabase website

    To start a project, you first go to the Supabase website where you can create a new project.
  2. Step 2: Provide project details

    You must enter a project name, set a password, and select a region to host your project.
  3. Final Answer:

    Choose a project name, password, and region on the Supabase website -> Option A
  4. Quick Check:

    First step = Choose name, password, region [OK]
Hint: Start by naming and securing your project on the website [OK]
Common Mistakes:
  • Trying to write SQL before creating the project
  • Assuming CLI installation is first
  • Skipping region selection
2. Which of the following is the correct way to set the project password during Supabase setup?
easy
A. Enter a strong password with letters, numbers, and symbols
B. Leave it blank to use the default password
C. Use your email address as the password
D. Set the password after project creation only

Solution

  1. Step 1: Understand password requirements

    Supabase requires a strong password to secure your database access.
  2. Step 2: Choose a secure password

    You should enter a password with a mix of letters, numbers, and symbols during setup.
  3. Final Answer:

    Enter a strong password with letters, numbers, and symbols -> Option A
  4. Quick Check:

    Password must be strong and set at setup [OK]
Hint: Always use a strong password when creating your project [OK]
Common Mistakes:
  • Leaving password blank
  • Using weak or guessable passwords
  • Trying to set password after creation
3. After creating a Supabase project, what will you see on the dashboard?
medium
A. A list of third-party APIs to connect
B. Only a blank screen with no options
C. Options to manage your database, authentication, and storage
D. A command line interface to type SQL commands

Solution

  1. Step 1: Understand the Supabase dashboard purpose

    The dashboard is the control center for your project backend services.
  2. Step 2: Identify available management options

    You can manage your database tables, authentication settings, and file storage from the dashboard.
  3. Final Answer:

    Options to manage your database, authentication, and storage -> Option C
  4. Quick Check:

    Dashboard shows backend management options [OK]
Hint: Dashboard lets you manage database, auth, and storage [OK]
Common Mistakes:
  • Expecting a blank or empty dashboard
  • Looking for third-party API lists instead
  • Confusing dashboard with CLI
4. You tried to create a Supabase project but got an error saying the project name is already taken. What should you do?
medium
A. Delete another user's project with that name
B. Choose a different unique project name
C. Ignore the error and try again
D. Use the same name but change the password

Solution

  1. Step 1: Understand project name uniqueness

    Supabase requires each project name to be unique across all users.
  2. Step 2: Select a new unique name

    To fix the error, pick a different project name that is not already used.
  3. Final Answer:

    Choose a different unique project name -> Option B
  4. Quick Check:

    Project names must be unique [OK]
Hint: Pick a unique project name to avoid conflicts [OK]
Common Mistakes:
  • Trying to reuse an existing project name
  • Changing password instead of name
  • Ignoring the error message
5. You want your Supabase project to be fast for users in Europe. What should you do during setup?
hard
A. Set the project password to 'europe123' for speed
B. Choose the default region regardless of user location
C. Create multiple projects in different regions manually
D. Select a hosting region in Europe when creating the project

Solution

  1. Step 1: Understand region selection impact

    Choosing a hosting region close to your users reduces latency and improves speed.
  2. Step 2: Select the appropriate region during setup

    When creating the project, pick a region in Europe to optimize performance for European users.
  3. Final Answer:

    Select a hosting region in Europe when creating the project -> Option D
  4. Quick Check:

    Region choice affects speed and latency [OK]
Hint: Pick hosting region near users for best speed [OK]
Common Mistakes:
  • Ignoring region selection
  • Using weak passwords thinking it affects speed
  • Creating multiple projects unnecessarily
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard