What Is This Project?

An internal web application for managing the full onboarding and opening process for every new SONAN TECH store location. Tracks 60+ auto-generated tasks, budget, reminders, calendar, and daily digest emails.

Repo & Folder

ItemValue
Local folderE:\Claude_Projects\SONAN DIGITAL\sonan-location-launchpad\
GitHub remotehttps://github.com/sonantechai/sonan-location-launchpad
HostingCloudflare Pages → auto-builds on push to main
Live URLlaunchpad.sonantech.com
AuthCloudflare Zero Trust Access (email OTP)

Tech Stack

LayerTechnology
FrontendPlain HTML / CSS / JavaScript (src/ folder)
BackendCloudflare Functions — serverless edge API (functions/api/)
DatabaseCloudflare D1 (SQLite at the edge) — binding name DB
Configwrangler.toml — D1 binding, cron triggers, build output dir
Build outputsrc/ (set in wrangler.toml as pages_build_output_dir)

Key File Structure

sonan-location-launchpad/
  src/                      ← frontend HTML pages (served by Cloudflare Pages)
    index.html              ← dashboard
    location-detail.html
    reminders.html
    calendar.html
    settings.html
    ...
  functions/api/            ← Cloudflare Functions (edge API routes)
    locations/[id].js
    reminders.js
    reminders/[id].js
    calendar.js
    cron/daily-digest.js
    settings.js
    ...
  db/
    migrations/             ← SQL migration files (run manually via wrangler CLI)
    seed/
  wrangler.toml             ← D1 binding, cron schedule, build config

How to Deploy

Code changes:

cd "E:\Claude_Projects\SONAN DIGITAL\sonan-location-launchpad"
git add <files>
git commit -m "..."
git push origin main

Cloudflare Pages detects the push and rebuilds. No build command needed.

Database migrations must be run manually — Cloudflare Pages does not auto-run SQL:

wrangler d1 execute sonan-location-launchpad --remote --file=db/migrations/003_reminders_recurring_email.sql

Always run migrations against --remote (production D1). Test locally with --local.

Cron Trigger

The daily digest email fires via Cloudflare cron. Configured in wrangler.toml:

[[triggers]]
crons = ["0 9 * * *"]    # 9am UTC daily

The cron calls functions/api/cron/daily-digest.js which emails reminders due within the configured intervals to the configured address via Resend.

Common Mistakes to Avoid

MistakePrevention
FUSE git staging corruption — git add from sandbox stages files as deletedAlways use FUSE-safe git plumbing pattern (write to /tmp, hash-object, mktree, commit-tree). Never git add in the sandbox.
Forgetting to run DB migration after pushAlways document pending migrations in AI Handoff. Run with wrangler d1 execute ... --remote.
Testing against production D1Use --local for local dev, --remote only for intentional production migrations
Cloudflare Functions file deleted by FUSE git addCheck git status before committing — "deleted" files in staging area that exist on disk = FUSE corruption. Run git restore --staged . first, then use FUSE-safe method.