Lesson 7 of 16 · 45 min suggested practice
Choose Lovable Cloud or Supabase when the app needs shared data
Decide when a backend is necessary and plan persistent resource records without overcomplicating the first version.
Identify the requirement that changes the architecture
Do not add a database simply because it appears in a tutorial. Resource Shelf's first six records can live in the project. A backend becomes useful when an editor needs to update resources without changing source files, or when a user's saved list must follow them between devices.
Write the new requirement precisely. For this extension, choose cross-device favourites for signed-in users and administrator-managed resource records. Keep public browsing and free files available without sign-in. The extra infrastructure should support a clear user benefit.
Understand the two backend options
Lovable's built-in backend includes a database, authentication, storage, realtime, and functions. It uses Supabase's open-source foundation without requiring a separate Supabase account. An external Supabase connection uses a project you own in Supabase, with its own dashboard, account, and billing.
Choose based on management needs, not a claim that one is always best. Decide early: current documentation does not describe switching between them as an automatic one-step migration. If a backend already exists, inspect it before proposing another service or another project.
Plan records and permissions together
Define resources separately from saved_resources. A resource has a stable ID and public metadata. A saved-resource record links a signed-in user to one resource and should prevent duplicate entries. Decide who may create or edit public resource records; ordinary users should not gain that privilege just by signing in.
Write the access rules before the migration. Public users may read published resource metadata, while each signed-in user may manage only their own favourites. Keep unpublished or internal notes out of public responses. Review the plan and data migration before applying it.
Migrate and verify a small slice
Move the six practice records first and connect the library's read path. Check loading, empty, success, and failure states. Add saved-resource persistence only after the public catalogue still works. If you import existing local favourites, make the action explicit and prevent duplicates.
Test persistence after refresh and with a second browser session. A completed save should be visible to the same account, while another account must remain isolated. Keep a note of which provider stores the data, who administers it, and how to export it.
Try this focused prompt.
Plan an optional backend extension for Resource Shelf using the backend already connected, if any. Keep the public catalogue accessible without login. Model published resources separately from each user's saved-resource links, prevent duplicate saves, and reserve resource editing for authorized administrators. Explain built-in Cloud versus external Supabase if no backend exists. Review permissions and migration before implementing. Then migrate only the six practice records and verify the public read flow before adding account saves.
Replace the sample context with your own approved facts. Review Lovable’s proposed changes before accepting them.
Evidence before the next step
Check your work.
- The backend solves a named requirement.
- The schema separates public resources from private saved lists.
- Provider ownership, billing, access rules, and migration are documented.
Your checkmark stays in this browser. It records your own progress, not a certification.
Official sources & further reading
Reviewed November 19, 2026. Plans, terminology and interfaces can change; follow the linked documentation if your workspace differs.