⚡ SONAN TECH

Location Launchpad Docs

Deployment Guide← Docs Home

Deployment Guide

Complete steps to deploy SONAN Location Launchpad from scratch.

Prerequisites

  • Cloudflare account with Workers & Pages access
  • GitHub account
  • Node.js installed locally (for Wrangler CLI)
  • Domain added to Cloudflare DNS (for custom domain)

Step 1 — Create GitHub Repository

cd sonan-location-launchpad
git init
git add .
git commit -m "feat: initial SONAN Location Launchpad"
git remote add origin https://github.com/sonantechai/sonan-location-launchpad.git
git push -u origin main

Step 2 — Install Wrangler

npm install -g wrangler
wrangler login

Step 3 — Create D1 Database

wrangler d1 create sonan-location-launchpad

Copy the database_id from the output and paste it into wrangler.toml:

[[d1_databases]]
binding = "DB"
database_name = "sonan-location-launchpad"
database_id = "YOUR_DATABASE_ID_HERE"

Step 4 — Apply Migrations

# Local (for testing)
wrangler d1 execute sonan-location-launchpad --file=db/migrations/001_schema.sql

# Remote (production)
wrangler d1 execute sonan-location-launchpad --remote --file=db/migrations/001_schema.sql

Step 5 — Seed Data

wrangler d1 execute sonan-location-launchpad --remote --file=db/seed/seed.sql

Step 6 — Connect to Cloudflare Pages

  1. Go to Cloudflare Dashboard → Workers & Pages → Create → Pages → Connect to Git
  2. Select sonan-location-launchpad repository
  3. Build command: (leave blank)
  4. Build output directory: src
  5. Click Save and Deploy

Step 7 — Bind D1 to Pages

  1. Go to Pages project → Settings → Functions → D1 database bindings
  2. Add binding: Variable name = DB, D1 database = sonan-location-launchpad
  3. Save and redeploy

Step 8 — Add Environment Variables (Optional)

If using fallback password auth, go to Pages → Settings → Environment Variables:

  • ADMIN_PASSWORD — set a strong password

Step 9 — Add Custom Domain

  1. Go to Pages project → Custom domains → Set up a custom domain
  2. Enter launchpad.sonantech.com
  3. Cloudflare will auto-configure DNS (domain must be on Cloudflare)
  4. Wait 1-2 minutes for SSL to provision

Step 10 — Configure Zero Trust Access

See the Zero Trust Guide for detailed access configuration.

Local Development

npm run dev
# Starts local dev server at http://localhost:8788
# D1 runs locally via wrangler