Step 1 of 4

Set Up Your Database

Create the database that stores your products, orders, and customers — then let the setup scripts wire it to your store.

You'll need a free Supabase account, Node.js 20 or newer, and your ShipCommerce repository cloned locally · Estimated time: 10–15 min

Good news: you don't need Stripe to get a working store. Checkout supports cash on delivery and bank transfer out of the box, so you can finish this step, launch, and add card payments later in Step 3.

1. Create a Supabase Project

  1. Go to supabase.com/dashboard and sign up (or log in)
  2. Click the green New Project button
  3. Fill in the details:
    • Name: anything you like (e.g. "my-store")
    • Database Password: click "Generate a password" and save it somewhere safe — you need it again in a moment, and Supabase won't show it twice
    • Region: the one closest to your customers
  4. Click Create new project and wait about 2 minutes

2. Collect Four Values

You need three API values and one database connection string. Keep them in a scratch file — the setup wizard will ask for all four in the next section.

Project URL and API keys

  1. Open your project and click Project Settings (the gear icon at the bottom of the left menu)
  2. Click API Keys
  3. Find the section called "Legacy anon, service_role API keys"
  4. Copy each value using the copy icon
In SupabaseSave it as
Project URL (shown on Project Overview)NEXT_PUBLIC_SUPABASE_URL
anon publicNEXT_PUBLIC_SUPABASE_ANON_KEY
service_role (secret)SUPABASE_SERVICE_ROLE_KEY

Note: if you also see a "Publishable and secret API keys" section, ignore it. The legacy keys are what this project expects.

Database connection string

This one is easy to get wrong, and it is the most common reason Step 1 fails.

  1. Still in Project Settings, click Database
  2. Find Connection string and select the URI tab
  3. Choose Transaction mode
  4. Copy the string and replace [YOUR-PASSWORD] with the database password you saved earlier
Connection string → URI (transaction mode)SUPABASE_DB_URL

Keep these private. The service_role key and the database URL both bypass every security rule in your store. They belong in .env.local and in your hosting provider's environment settings — never in your code, screenshots, or support emails.

3. Run the Setup Wizard

In your project folder, install dependencies and run the wizard. It asks for the four values you just collected and writes them to .env.local for you.

npm install
npm run setup

The wizard collects, in order:

  • Supabase — the four values from section 2
  • Site config — your store name and URL (use http://localhost:3000 for now)
  • Cron secret — press Enter to have one generated for you
  • Stripe, email, AI, analytics — all optional, skip them for now

Prefer editing files by hand? Copy .env.example to .env.local and fill in the same values. Every variable is documented on the Configuration page.

4. Create the Database Tables

One command creates every table, function, security policy, and the storage bucket for product images:

npm run db:setup

This connects using SUPABASE_DB_URL and applies the migrations from supabase/migrations/. It takes about 30 seconds and prints a green check per migration.

Safe to re-run. The migrations are idempotent — running db:setup again picks up anything new without touching existing data. This is also how you apply database changes after installing an update.

Connection failed? Almost always the connection string. Check that you used the URI tab in Transaction mode, and that you replaced [YOUR-PASSWORD] with your real database password. More fixes on the Troubleshooting page.

5. Create Your Admin Account

This creates the account you'll use to log into the admin panel:

npm run seed
Emailadmin@demo.com
PasswordDemo1234!

These credentials are published in this guide. Change the email and password the first time you log in, and always before your store is reachable from the internet.

6. Start Your Store

npm run dev

Open localhost:3000 for the storefront, or localhost:3000/admin to log in. The store starts empty — that's expected. You'll add your first products in Step 4.

7. Authentication URLs

Supabase needs to know where customers return to after signing in or resetting a password.

  1. In the left menu, click Authentication
  2. Click URL Configuration
  3. Set Site URL to your store address
  4. Under Redirect URLs, click Add URL and add both forms:
    https://yourstore.com/
    https://yourstore.com/**

No domain yet? Skip this section for now — you'll come back after deploying in Step 2. If login redirects you to the wrong place later, this is the setting to check.

Checklist

  • Supabase project created and database password saved
  • Three API values plus the database connection string collected
  • npm run setup completed — .env.local exists
  • npm run db:setup finished without errors
  • npm run seed created the admin account
  • Store loads at localhost:3000 and you can log into /admin

Was this step clear?