Skip to main content

Prerequisites

Before you begin, ensure you have the following installed:

Node.js

Version 18.x or higher
node --version

pnpm

Preferred package manager
npm install -g pnpm

Supabase CLI

For local database
brew install supabase/tap/supabase

Xcode

For iOS development (Mac only)
  • Xcode 15+
  • iOS Simulator

1. Clone the Repositories

mkdir popup && cd popup

# Clone all three repos
gh repo clone unfinished-bizness/getpopup-store
gh repo clone unfinished-bizness/popup-supabase
gh repo clone unfinished-bizness/popupstore.ios

2. Setup Supabase Backend

1

Start Supabase locally

cd popup-supabase
supabase start
This will output your local Supabase credentials. Save these!
2

Note the credentials

API URL: http://127.0.0.1:54321
anon key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
service_role key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
3

Run migrations

supabase db reset

3. Setup Web Store

1

Install dependencies

cd ../getpopup-store
pnpm install
2

Create .env.local

.env.local
# Supabase
NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key_here
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here

# Razorpay (test mode)
NEXT_PUBLIC_RAZORPAY_KEY_ID=rzp_test_xxxxx
RAZORPAY_KEY_SECRET=xxxxx

# PostHog (optional)
NEXT_PUBLIC_POSTHOG_KEY=phc_xxxxx
NEXT_PUBLIC_POSTHOG_HOST=https://app.posthog.com

# Resend (for emails)
RESEND_API_KEY=re_xxxxx
3

Update hosts file

Add test subdomains to /etc/hosts:
sudo nano /etc/hosts
Add these lines:
127.0.0.1   teststore.localhost
127.0.0.1   myshop.localhost
4

Run dev server

4. Setup iOS App (Mac only)

1

Install dependencies

cd ../popupstore.ios
pod install  # If using CocoaPods
2

Configure Supabase

Update Configuration/Development.xcconfig:
SUPABASE_URL = http://127.0.0.1:54321
SUPABASE_ANON_KEY = your_anon_key_here
3

Open in Xcode

open popupstore.xcworkspace
4

Run on simulator

  1. Select a simulator (iPhone 15 Pro)
  2. Press Cmd + R to build and run

Test Data

The local Supabase instance comes with seed data:
Email: [email protected]
Password: password123
Store: teststore
  • 5 sample products with images
  • 2 categories (Electronics, Clothing)
  • Various price points
  • 3 pending orders
  • 2 completed orders
  • Mix of UPI and Razorpay payments

Verify Setup

Visit http://teststore.localhost:3000You should see:
  • ✅ Store homepage with products
  • ✅ Working cart functionality
  • ✅ Checkout flow

Troubleshooting

Make sure you:
  1. Updated /etc/hosts with test domains
  2. Using .localhost:3000 (not localhost:3000)
  3. Middleware is detecting subdomains correctly
Check middleware logs:
# In getpopup-store/src/middleware.ts
console.log('Host:', req.headers.get('host'))
Verify Supabase is running:
supabase status
Check .env.local has correct credentials:
cat .env.local | grep SUPABASE
Common fixes:
  1. Clean build folder: Cmd + Shift + K
  2. Delete derived data
  3. Update Swift package dependencies
  4. Restart Xcode
Stuck? Join our Discord or create an issue on GitHub