StayOS
Home

Setup guide

Connect Supabase to StayOS

StayOS uses Supabase for the database, authentication, and file storage. This takes about 10 minutes the first time. You only do this once.

Current status

Connected
NEXT_PUBLIC_SUPABASE_URL Set
NEXT_PUBLIC_SUPABASE_ANON_KEY Set

You're all set. Sign in or create an account to open your dashboard.

Steps

  1. 1

    Create a free Supabase project

    Go to supabase.com/dashboard and sign in. Click New project, give it a strong database password (save it in your password manager), pick a region close to you, and wait about two minutes for it to provision.

  2. 2

    Copy your API keys

    Inside your new project, open Project Settings → API. You'll see three values you need:

    • Project URL — looks like https://abcd1234.supabase.co
    • anon public key — a long string starting with eyJ...
    • service_role key — keep this one secret, never paste it anywhere public.
  3. 3

    Create your .env.local file

    In your StayOS project folder, create a new file called .env.local (the leading dot matters). Paste these lines, replacing each your-... with the value you copied:

    Terminal / .env.localSelect all and copy
    NEXT_PUBLIC_SUPABASE_URL=https://your-project-ref.supabase.co
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
    SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
    SUPABASE_PROJECT_ID=your-project-ref

    This file is already in .gitignore — it will never be committed to git.

  4. 4

    Apply the database migrations

    In Supabase, open SQL Editor → New query. Then, one file at a time, in this exact order:

    1. Open supabase/migrations/20260101000000_initial_schema.sql from this project, paste the entire file into the SQL editor, click Run.
    2. Repeat with 20260101000100_rls_policies.sql.
    3. Repeat with 20260101000200_public_rpcs.sql.

    The order matters — RLS policies depend on tables existing first.

  5. 5

    Restart the dev server

    In your terminal, stop the dev server with Ctrl + C and start it again:

    Terminal / .env.localSelect all and copy
    npm run dev

    Refresh this page. The status card above should switch to Connected and the gold demo banner will disappear.

After you connect

Once Supabase is wired, sign in to the dashboard and the guided onboarding checklist will walk you through the rest — adding a property, a room, configuring taxes, calendar sync, channels, AI, your first tour, your first invoice, and your first review.

Open the onboarding checklist

Stuck? Open the detailed guide

GETTING_STARTED.md in your project folder has more detail and troubleshooting, including the Supabase CLI alternative and what to do if migrations fail.