Notes App Tutorial
⏱️ 45 minutes Build a notes app with user accounts and cloud synchronization. You’ll learn about authentication, cloud databases, and real-time sync using Supabase.What You’ll Build
A notes app that:- Has user sign up and login
- Creates, edits, and deletes notes
- Syncs notes to the cloud
- Works across devices (same account = same notes)
Before You Start
This tutorial requires a Supabase account (free tier available).Set Up Supabase
- Go to supabase.com and create a free account
- Create a new project (any name, choose a region near you)
- Wait for the project to initialize (~2 minutes)
- Note your project URL and anon key (Settings → API)
Part 1: Create the App
On the Nativeline home page, enter:Complete the Wizard
- Who is this for? — Anyone (public app)
- Feel — Simple & clean
- Priority — Core functionality first
- Colors — Your choice
- Name — Cloud Notes
Part 2: Connect Supabase
Tell Nativeline about your Supabase project:YOUR_SUPABASE_URL and YOUR_ANON_KEY with your actual values from the Supabase dashboard.
Part 3: Create the Notes Table
We need a database table to store notes. In your Supabase dashboard:- Go to Table Editor
- Click Create a new table
-
Name:
notes -
Add columns:
id(uuid, primary key) — auto-generateduser_id(uuid, not null) — links to auth.userstitle(text)content(text)created_at(timestamptz, default: now())updated_at(timestamptz, default: now())
- Enable Row Level Security (RLS)
Add RLS Policies
In the Supabase dashboard, go to Authentication → Policies and add: Select policy (users can read their own notes):Part 4: Build the Auth Flow
Let’s create the login and signup screens:- Try signing up with an email
- You should be logged in and see the notes list
- Log out and try logging back in
Part 5: Build the Notes List
Create the main notes interface:Part 6: Create Note Editor
Build the editing experience:Part 7: Add Note Deletion
Let users delete notes:Part 8: Add Real-time Sync
Make notes update in real-time:- Opening your Supabase dashboard → Table Editor → notes
- Editing a note directly in Supabase
- Watching it update in the app
Part 9: Add Search
Help users find notes:Part 10: Polish the Design
Make it look professional:Final Result
You now have a cloud-synced notes app with:- ✅ User registration and login
- ✅ Create, read, update, delete notes
- ✅ Cloud sync via Supabase
- ✅ Real-time updates
- ✅ Search functionality
- ✅ Polished UI
What You Learned
| Concept | How It Was Used |
|---|---|
| Authentication | Email/password signup and login |
| Database | Supabase tables and queries |
| Row Level Security | Protecting user data |
| Real-time | Live sync between devices |
| CRUD Operations | Create, read, update, delete |
| State Management | Auth state and data sync |
Troubleshooting
Can't connect to Supabase
Can't connect to Supabase
- Double-check your project URL (ends in .supabase.co)
- Make sure you’re using the anon key, not the service_role key
- Check if your Supabase project is still initializing
Sign up not working
Sign up not working
- Check Supabase Authentication → Users to see if user was created
- Check if email confirmation is required (Authentication → Settings)
- For testing, you can disable email confirmation
Notes not saving
Notes not saving
- Check Supabase Table Editor for errors
- Verify RLS policies are set correctly
- Make sure user_id is being set when creating notes
Real-time not updating
Real-time not updating
- Real-time requires Supabase Realtime to be enabled (it’s on by default)
- Check the browser console in Supabase for errors
- Try refreshing the app
Permission denied errors
Permission denied errors
Your RLS policies might be incorrect. In Supabase:
- Go to Authentication → Policies
- Verify each policy uses
auth.uid() = user_id - Make sure RLS is enabled on the table
Understanding the Architecture
Challenge: Extend Your App
Try these on your own:- Rich text — Add formatting (bold, italic, lists)
- Folders — Organize notes into folders
- Sharing — Share notes with other users
- Markdown — Support markdown preview
- Offline mode — Work offline and sync when back online
- Attachments — Add images to notes using Supabase Storage