Skip to content
BlackBadger

Guides / Lovable How-To Guides

How to Create a Multi-Page App in Lovable

/ 8 min read

Diagram illustrating the architecture of a multi-page application in Lovable with interconnected pages and shared layouts.

TL;DR

Building a multi-page app in Lovable involves structuring navigation, data flow, and shared UI effectively to transition from a simple demo to a robust, maintainable product, focusing on client-side routing with server-side components for data and authentication.

Key takeaways

  • Before prompting Lovable, plan your pages and routes, distinguishing between public and authenticated sections and identifying which pages will share common layouts like marketing or app-specific designs.
  • Create an initial multi-page scaffold in Lovable by providing a clear prompt detailing routes, two distinct layouts (marketing and app), navigation elements, and a 404 page, then validate navigation, layout rendering, and 404 functionality.
  • Implement scalable navigation using global patterns like sidebars or top navs, ensure active states and breadcrumbs clearly indicate the user's location, and leverage deep linking with shareable URLs to make each route independently usable.
  • Wire up data across pages by defining a clear source of truth for each page type, using URL parameters for detail pages, and fetching data on page load to maintain synchronization between lists, details, and forms.
  • Maintain UI consistency and guard authenticated routes by establishing shared components and layouts early, and implementing route guards to protect sensitive sections like /app routes, ensuring a sensible authentication structure.

Multi-page apps in Lovable feel deceptively simple at first. You can get from a single screen to a working set of pages in minutes, but the difference between a demo and an app people use daily usually comes down to how you structure navigation, data flow, and shared UI. This guide walks through the approach I use in real projects, including the prompts that work well, the common routing mistakes, and how to keep pages consistent as your app grows.

1) Understand what “multi-page” means in Lovable

In Lovable, a multi-page app is typically a single deployed web app that contains multiple routes, each route rendering a page or view. You are not building separate apps, you are building one app with organized screens and navigation. Under the hood, most Lovable projects behave like a modern SPA with client-side routing, plus server-side pieces for data and authentication.

That distinction matters because it changes how you think about shared UI, state, and data fetching. Instead of duplicating components across pages, you want a shared layout and reusable components, then page-specific logic where it belongs.

If you start by cloning one page into another and editing it, you will move fast early, but you will create a maintenance problem. It is almost always better to establish shared layout components first, then build pages that plug into that layout.

2) Plan your pages and routes before you prompt

Before you ask Lovable to create pages, write down a quick route map. You do not need a full spec, but you do need clarity on what pages exist and what data each page needs.

A practical route map template

  • Public: Landing, Pricing, Sign in, Sign up

  • Authenticated: Dashboard, List view, Detail view, Settings

  • Utility: 404 Not Found, Unauthorized

  • / Landing

  • /signin Sign in

  • /app Dashboard

  • /app/contacts Contacts list

  • /app/contacts/:id Contact detail

  • /app/settings Settings

Decide which pages share the same layout

Most apps benefit from at least two layouts.

  • Marketing layout: top nav, footer, wide content

  • App layout: sidebar or top nav, smaller max width, persistent navigation

Put all authenticated routes under a single prefix like /app. It makes guarding routes, applying the app layout, and reasoning about navigation much easier as the app grows.

3) Create the initial multi-page scaffold in Lovable

The fastest way to get a stable foundation is to ask Lovable for a multi-page scaffold with shared layouts, navigation, and placeholder pages. Be explicit about the route structure and the navigation elements you want to be persistent.

Prompt you can copy

Prompt: Build a multi-page app with these routes: / (Landing), /signin, /app (Dashboard), /app/contacts (Contacts list), /app/contacts/:id (Contact detail), /app/settings. Use two layouts: a marketing layout for / and /signin, and an app layout for all /app routes with a left sidebar that links to Dashboard, Contacts, Settings. Include a 404 page. Use a consistent design system and reusable components for buttons, inputs, cards, and page headers.

After Lovable generates the scaffold, click through every route. You are validating three things.

  • Navigation works and the active state is correct

  • Pages render inside the expected layout

  • Unknown routes land on 404

One of the most common issues in early scaffolds is duplicated navigation. You will see a sidebar rendered inside a page and also inside the layout, which creates nested navs and broken spacing. Fix it by ensuring navigation only lives in the layout component, not in each page.

4) Add navigation that scales

Navigation is the difference between “multiple screens” and a coherent app. In practice, you will want a mix of global navigation, contextual navigation, and deep links.

Global navigation patterns that work well

  • Sidebar for app routes: best for 4 to 8 core sections

  • Top nav with tabs: best when sections are peers and you need more horizontal space

  • Hybrid: sidebar for sections, top tabs inside a section

Make active states and breadcrumbs intentional

Users need to know where they are, especially on detail pages. For a route like /app/contacts/123, I usually include:

  • A breadcrumb back to Contacts

  • A page title that uses the record name, not just “Contact”

  • Secondary actions near the title like Edit, Archive, Delete

Deep linking and shareable URLs

Multi-page apps shine when the URL reflects the current view. Prefer route parameters like /app/contacts/:id over storing the selected record only in client state. That way, refresh works, and links can be shared in email or Slack.

If a page only works after you visited another page first, you likely have a state coupling problem. Use URL params and fetch on page load so each route is independently usable.

5) Wire up data across pages without creating a mess

In real Lovable apps, the main data challenge is keeping list pages, detail pages, and edit forms in sync. The key is to define a clear source of truth for each page.

Recommended data flow for common page types

  • List page: fetch collection, support search and filters, paginate if needed

  • Detail page: fetch single record by route param, fetch related records if needed

  • Edit page or modal: load current values, validate, update, then invalidate or refresh views

Example scenario, contacts list to contact detail

When a user clicks a contact on /app/contacts, navigate to /app/contacts/:id. The detail page should fetch by :id even if the list already had the data. This prevents stale data and makes refresh reliable.

Prompt to connect pages to real data

Prompt: Connect the Contacts list and Contact detail pages to the database. On /app/contacts, show a table with name, email, company, and last updated. Add search by name and email. Each row links to /app/contacts/:id. On /app/contacts/:id, fetch the contact by id, show a header with the name and an Edit button, and show fields in a details card. Handle loading and not found states.

When you add create or edit flows, make sure the list page refreshes after mutations. In practice, this often means invalidating cached queries or refetching after the mutation succeeds, rather than assuming local state updates will stay correct.

6) Add authentication and guard your /app routes

Most multi-page apps have public pages and private pages. In Lovable, you want the app to route unauthenticated users to the sign-in page and prevent private data from flashing on screen.

A sensible auth structure

  • Public: /signin

  • Private: /app and everything under it

Prompt to implement route guards

Prompt: Add authentication. Users can sign in on /signin. All routes under /app require authentication. If a user is not signed in and visits an /app route, redirect them to /signin and preserve the intended destination so they return after signing in. Ensure private pages do not briefly render before redirect.

In hands-on builds, the “preserve intended destination” detail is what makes the app feel polished. Without it, users land on the dashboard after signing in, then have to navigate back to what they wanted.

Be careful with redirect loops. If /signin itself checks for auth and redirects to /signin, you can get stuck. Keep the auth guard scoped to /app routes and let /signin remain public.

7) Keep UI consistent with shared components and layouts

Once you have 5 or more pages, consistency becomes the real productivity multiplier. The goal is that any new page uses the same building blocks, spacing rules, and header patterns.

Shared components worth standardizing early

  • Page header: title, subtitle, primary action, secondary actions

  • Card: consistent padding, border, and header style

  • Form field: label, help text, error message, disabled state

  • Empty state: message and CTA that matches your tone

  • Loading state: skeletons or spinners that do not shift layout

A pattern that avoids duplicated styling

Use a single layout component for /app routes that sets the overall spacing, background, and nav. Then each page only defines its content. When you later change the sidebar width or typography scale, you do it once.

Lovable documentation page showing integrations and usage-based cloud and AI pricing details.

8) Test the multi-page experience like a user would

Most routing and page issues only show up when you use the app the way real users do. Here is the checklist I run before calling a multi-page build “done.”

A 404 Page Not Found error screen on the Black Badger Portal website with Go Back and Home buttons.
  1. Step 1: Open a deep link directly, like /app/contacts/123, in a new tab

  2. Step 2: Refresh on every major route and confirm it still loads correctly

  3. Step 3: Sign out, then try to visit an /app route

  4. Step 4: Use Back and Forward navigation and confirm state stays sane

  5. Step 5: Confirm 404 behavior for unknown routes, both under / and under /app

Common multi-page bugs and what to do

  • Active nav highlight is wrong: match on route prefix for section pages, not exact URL

  • Detail page breaks on refresh: ensure it fetches by route param, not from list state

  • Layout jumps between pages: standardize page wrappers and loading skeleton heights

  • Users lose context after sign-in: implement return-to behavior after auth

9) Next steps, turn your multi-page scaffold into a real product

Once your routes, layouts, and auth are solid, you can iterate quickly without breaking navigation.

  • Add create and edit flows: a “New contact” page or modal, plus edit on the detail page

  • Add role-based access: hide admin pages and protect routes based on user role

  • Improve performance: paginate lists, avoid fetching related data until it is needed

  • Harden edge cases: not found states, empty states, and error recovery

If you only do one thing after reading this, make it this. Keep navigation in layouts, make each route independently loadable via URL, and be strict about which pages are public versus private. That is the foundation that lets Lovable generate new features without turning your app into a maze.

WorkHub platform dashboard showing workload forecast heat map, user management list, and key performance metrics.Supabase product feature grid showing Postgres Database, Auth, Edge Functions, Storage, Realtime, Vector, and Data APIs.

Frequently asked questions

What is a multi-page app in Lovable?

In Lovable, a multi-page app is a single deployed web application that contains multiple routes, with each route rendering a distinct page or view. It functions like a modern Single Page Application (SPA) with client-side routing, augmented by server-side components for data and authentication, allowing for organized screens and navigation within one app.

What are the benefits of planning pages and routes before prompting Lovable?

Planning pages and routes before prompting Lovable helps establish clarity on what pages exist and what data each page requires. This prevents common routing mistakes and ensures a stable foundation for the app, making it easier to structure navigation, data flow, and shared UI as the application grows.

What is a practical route map template for a multi-page app?

A practical route map template includes categories like Public (e.g., Landing, Pricing, Sign in, Sign up), Authenticated (e.g., Dashboard, List view, Detail view, Settings), and Utility (e.g., 404 Not Found, Unauthorized). Authenticated routes are typically grouped under a prefix like /app for easier management.

How can I create the initial multi-page scaffold in Lovable?

You can create the initial multi-page scaffold by prompting Lovable to build an app with specific routes, shared layouts (e.g., marketing and app layouts), and persistent navigation elements. Be explicit about the route structure and the desired navigation, such as a left sidebar for authenticated routes.

What are common global navigation patterns that work well in multi-page apps?

Effective global navigation patterns include a sidebar for 4 to 8 core app sections, a top navigation bar with tabs when sections are peers and require more horizontal space, or a hybrid approach with a sidebar for main sections and top tabs within a section.

How should data flow between list and detail pages in Lovable?

For list and detail pages, the list page should fetch a collection and support search/filters, while the detail page should fetch a single record by its route parameter. Even if the list already has the data, the detail page should re-fetch to prevent stale data and ensure reliability upon refresh.

Share this article

When the side project becomes the product

Built something in Lovable that a business now depends on?

A Lovable app often starts as a quick experiment and ends up carrying real work. Black Badger turns it into a production system your company owns, with its own data, access control and support. If you built the app, read how that works. If someone built it for the company you run, book a strategy call and bring the app. A written scope follows the call.

How a Lovable app becomes a production systemBook a strategy call

Who wrote this

David Verneuille

David Verneuille

Founder, Black Badger Software Solutions

David Verneuille founded Black Badger after 18 years as a project manager and years implementing Smartsheet, monday.com, Wrike and Zoho for clients. He now builds custom systems that clients own outright, which is why the writing here is specific about where each platform fits and where it stops fitting.

About Black Badger

Related

More on general

General /

How to Design Reliable Workflows in Lovable

Reliable Lovable builds come from process, not clever prompts. Here's how knowledge files, Drafts, follow-ups and automatic rule tests fit together, and where they still fall short.

Read it

General /

How to Safely Regenerate Parts of a Lovable App

Learn how to safely modify parts of your Lovable app using the revert button, Plan mode, targeted chat edits, and strategic regeneration techniques without breaking what already works. Master the tools and strategies that let you experiment freely while preserving your app's solid foundation.

Read it

More reading

Read this next

Want this looked at properly?

An article can only go so far without knowing your systems. Book a strategy call, walk us through what is breaking, and you will get a straight read on whether custom software is the right answer.