Introduction
Features
Integrations
Tips & tricks
Prompt Engineering
Prototype
Build an application prototype with Lovable
Lovable Crash Course
Getting started with Lovable 101
By the end, you’ll have a simple application up and running with authentication and CRUD (Create, Read, Update, Delete) functionality for managing notes.
Supabase is an open-source database service built on PostgreSQL. It provides authentication, data storage, and file storage—perfect for our Lovable integration.
Create an Organization & Project
Step 1
Log into Supabase.
Step 2
Create an organization (name it based on your startup or project).
Step 3
Create a new project within that organization.
Note your Supabase URL and API key (you’ll need them later).
Configure Authentication
Step 1
Navigate to Authentication > Sign In/Sign Up.
Step 2
Enable Email authentication.
Step 3
Turn off Confirm Email (since we don’t have an email provider set up yet).
Now, let’s set up a project in Lovable.
Start with a Fresh Blank Project
Step 1
Open Lovable and create a new project.
Step 2
Keep your first prompt simple: “Create a blank project”.
Step 3
Lovable will generate the basic structure for your app.
Connect Supabase to Lovable
Step 1
In Lovable, navigate to the database settings.
Step 2
Enter your Supabase project URL and API key.
Step 3
Click Connect to link your Lovable project to Supabase.
Create a Navigation Bar with a Login Button
Step 1
Add a nav bar at the top of your project.
Step 2
Include a Login button that redirects users to a login page.
Apply SQL Changes for Authentication
Step 1
Lovable will generate SQL for Supabase to handle authentication.
Step 2
Click Apply Changes to execute the SQL commands.
Customize the UI:
Step 1
Open the Edit Tool in Lovable.
Step 2
Click on UI elements (e.g., buttons) to modify styles.
Step 3
Ensure all text is visible (e.g., black text on white backgrounds).
Create a Test Account
Step 1
Use the Sign Up form to create a new user.
Step 2
Verify that login and logout workflows function correctly.
Redirect Users to a Dashboard After Login
Modify the authentication flow to send users to a dashboard after login.
Set Up a Notes Table in Supabase
Step 1
Use Lovable to generate SQL for a Notes table.
Step 2
Ensure it has user ID and content fields.
Step 3
Click Apply Changes to create the table.
Build the Notes UI
Step 1
Add a table to display notes on the dashboard.
Step 2
Include an input field and buttons for CRUD operations.
CRUD create, read, update and delete
Test CRUD Operations
Step 1
Add a new note.
Step 2
Edit an existing note.
Step 3
Delete a note.
Step 4
Verify notes persist in Supabase.
To enable Chat Mode, go to Settings > Accounts Settings tab.
Identify Errors
- If an issue arises, enable Chat Mode.
- Lovable will analyze Supabase logs and TypeScript errors.
Apply Fixes
Step 1
Review Lovable’s debugging suggestions.
Step 2
Apply fixes as needed.
You’ve:
- Set up Supabase and Lovable.
- Implemented authentication.
- Built a dashboard with CRUD functionality for notes.
- Learned how to debug issues effectively.
Building Interactive UIs
In this module, we’ll cover components, reusable UI elements, design improvements, and debugging best practices.
Components in Lovable help organize UI elements into modular and reusable parts. Instead of having all UI elements in a single page (e.g., a 400-line dashboard), we break them into components such as:
- Sidebar
- Welcome Card
- Quote Card
- Notes Section
This structure improves efficiency when making edits since changes apply only to specific components rather than the entire page.
Creating and Using Components:
Identify Large UI Sections
Look for UI parts that repeat or are too large.
Refactor Into Components
Use Lovable’s chat mode to scan the code and suggest an optimized structure.
Reuse Components
Copy and paste components across pages for consistency.
Modify Individual Components
Instead of modifying the full dashboard, edit smaller components like the Welcome Card.
Run a prompt:
“Update the copy in the Welcome Card to make it more engaging.”
Use Chat Mode for Refactoring
Ask Lovable to refactor large UI sections into smaller components.
Example:
“Refactor the dashboard into smaller, cleaner components.”
- Example: “Refactor the dashboard into smaller, cleaner components.”
If you’re not a designer, leveraging pre-built styles can improve your app’s appearance.
Using 21st.dev for UI Inspiration
Step 1
Visit 21st.dev to explore pre-built UI components.
Step 2
Choose a design, copy its prompt for Lovable, and integrate it into your project.
Creating Global Styles
Step 1
Modify an element on the project
for eg: “Set a button as Rainbow Button”.
Step 2
Add this system prompt in the project settings’ knowledge to ensure all new buttons follow this style:
“When creating components, make sure to always use our global rainbow button”.
Step 3
Everytime you add a button, this pre-set style will be respected.
To update the dashboard layout:
Step 1
Find a design you like (e.g., on Dribbble).
Step 2
Screenshot the relevant section and upload it to Lovable.
Step 3
Provide clear instructions, such as:
“Refactor the dashboard layout based on this design.”
“Place notes in a left-hand sidebar, and open them in a side-by-side editable view.”
Enable Real-Time Sync for Notes
Step 1
Run a prompt
“Enable real-time updates for notes so that changes reflect instantly.”
Step 2
Ensure data updates in both the sidebar and editing panel.
Debugging UI Issues
Use chat mode to scan the implementation and fix missing updates.
Example:
“When editing the title in the side-by-side view, it doesn’t save. Fix this issue.”
Use Mobbin for Real-World UI Examples
Search for “note-taking UI” to see how popular apps design their interfaces.
Example:
A clean, minimalistic note editor with large titles and a dropdown for tags.
Applying UI Improvements
Step 1
Ensure the title is large and prominent.
Step 2
Add tags via a dropdown, similar to the reference UI.
Example prompt:
“Redesign the note editor to match this screenshot. Use a large title, white space for content, and dropdown-based tags.”
Fix UI Bugs
Ensure all UI elements update correctly when modified.
Run a prompt:
“Fix the issue where note tags don’t save after editing.”
Optimize Button Styling
Adjust button and input styling to match the intended design.
Example:
“Ensure all buttons use the global Rainbow Button style.”
By the end of this module, you should have:
- Refactored large UI sections into reusable components.
- Implemented a polished note-taking dashboard.
- Used real-time updates for better user experience.
- Refined the design using external inspirations and best practices.
What's next?
If you enjoyed the first two modules, continue your crash course with Harry here! In the next lessons, you’ll explore:
- Bonus: P5.js effects & Admin Roles
- Advanced User Roles & RLS
- Connecting to APIs & AI
- Setting Up Stripe Payments
- Advanced Features
- Launch on Product Hunt
Was this page helpful?