Shipped
HomeContacts
  • Get started
  • 📚Tutorials
    • Make a waiting list
    • Launch a pre-sale
    • Build a SaaS
    • Create your store on Lemon Squeezy
  • 🟩Features
    • AI Services
    • Affiliate Program
    • Analytics
    • Authentication
      • MailChimp
      • Loops
      • AWS SES
      • SendGrid
      • Supabase Auth
        • Supabase Authentication Flow
        • Supabase Magic Link
        • Supabase Email & Password
        • Supabase Login with Google
    • API endpoints
      • 🛡️Authenticated API
    • Blog
    • Customer support
    • Chrome Extension
    • Dark mode
    • Database
      • Update your database
      • MongoDB
    • Emails
    • Error pages
    • Icons
    • Onboarding
    • Payments
      • Lemon Squeezy
        • Subscriptions
        • One-time purchase
        • Test mode
      • Stripe
    • Private pages
    • SEO
    • shadcn/ui
    • Supabase
    • Workspace / Organizations
  • 📦Components
    • AccountMenu
    • CtaBox
    • DarkModeSwitch
    • Explainer video
    • FAQ
    • Features
    • Footer
    • Header
    • Hero
    • Lifetime
    • Pricing
    • Sales Notification
    • Secondary Sidebar Pages
    • Sidebar
    • Tabs
    • Testimonials
    • Waitlist
    • WebAppPage
  • 🚀Deployment
  • ✅Other
    • Configuration
    • Changelog widget
    • Favicon
    • Google Fonts
    • Sitemap
    • Theme
  • Updates
  • GitHub Repository
  • Support
Powered by GitBook
On this page

Was this helpful?

  1. Components

WebAppPage

Easily render the pages of your Micro SaaS web app.

PreviousWaitlistNextDeployment

Last updated 1 year ago

Was this helpful?

When a user logs into your product, they access to your web app.

By default, Shipped redirects the users to the /dashboard page.

The dashboard page is an example of web app page with the sidebar (that's responsive and hides on mobile).

If you want to reuse this template for all the pages of your web app, it's strongly recommended to re-use the <WebAppPage /> component.

The <WebAppPage /> component is a template component that includes:

  • the sidebar

  • the content to be replaced with your React components, according to the current route

How to add a new web app route

Let's say you want to add a settings page, to let the users set their preferences.

The route you want is /settings, to get it you need to:

  • Create the route settings into Routes at src/data/routes.ts

src/data/routes.ts
export enum Routes {
  /* ... */
  settings = "/settings",
  /* ... */
}
  • Create the file src/app/settings/page.tsx

  • Paste this content (notice currentPage set to Routes.settings):

src/app/settings/page.tsx
import { WebAppPage } from "@/components/templates/WebAppPage/WebAppPage";
import { Routes } from "@/data/routes";

const SettingsPage = () => {
  return <WebAppPage currentPage={Routes.settings} />;
};

export default SettingsPage;
  • Update the component <WebAppPage />, scroll down where the routes are handled and add your custom content

src/components/templates/WebAppPage/WebAppPage.tsx
{currentPage === Routes.dashboard && (
  <Center w="100%" flexDir="column">
    <Heading>Welcome</Heading>
  </Center>
)}
{/* Add the route components here */}

For instance add this code (notice that UserSettings is not provided by Shipped, it is used as an example here):

{currentPage === Routes.settings && (
  <UserSettings />
)}
📦
Default /dashboard page