0
0
Supabasecloud~30 mins

Supabase architecture (Postgres, Auth, Storage, Realtime, Edge Functions) - Mini Project: Build & Apply

Choose your learning style9 modes available
Build a Simple Supabase Backend Architecture
📖 Scenario: You are creating a simple backend for a photo sharing app using Supabase. You will set up the main parts of Supabase architecture: a Postgres database table, authentication, storage for photos, realtime updates, and an edge function to process uploads.
🎯 Goal: Build a basic Supabase backend with a photos table in Postgres, enable user authentication, configure storage for photo files, set up realtime updates on new photos, and create an edge function to log uploads.
📋 What You'll Learn
Create a Postgres table called photos with columns id, user_id, and url
Enable authentication with email and password
Create a storage bucket called photo-uploads
Set up realtime subscription on the photos table
Write an edge function called logUpload that logs photo upload events
💡 Why This Matters
🌍 Real World
This project models a common backend architecture for apps that need user login, file storage, live updates, and serverless functions.
💼 Career
Understanding Supabase architecture is useful for junior backend developers and cloud engineers working with modern serverless platforms.
Progress0 / 4 steps
1
Create the Postgres photos table
Write the SQL command to create a table called photos with columns: id as a primary key UUID, user_id as UUID, and url as text.
Supabase
Need a hint?

Use CREATE TABLE photos and define id as UUID primary key with default UUID generation.

2
Enable email and password authentication
Write the Supabase CLI command to enable authentication with email and password for your project.
Supabase
Need a hint?

Use the command supabase auth enable email-password to enable email/password login.

3
Create a storage bucket called photo-uploads
Write the Supabase CLI command to create a storage bucket named photo-uploads.
Supabase
Need a hint?

Use supabase storage create-bucket photo-uploads to create the bucket.

4
Set up realtime subscription and edge function
Write the Supabase CLI commands to subscribe to realtime changes on the photos table and create an edge function called logUpload.
Supabase
Need a hint?

Use supabase realtime enable photos to enable realtime on the table and supabase functions new logUpload to create the edge function.