Home Business Customer Operations Technology Database Brand Glossary Promos Notes Decisions

On This Page

Architecture Overview

Tech Stack

LayerTechnologyPurpose
FrontendReact + Vite + TypeScriptCustomer portal
BackendSupabase (PostgreSQL + Edge Functions)Database, auth, serverless
HostingVercelFrontend deployment
PaymentsStripeBilling, subscriptions
SchedulingCalendlyAppointment booking
AuthSupabase Auth (Magic Links)Passwordless authentication
StorageSupabase StorageItem photos

Infrastructure

ServiceDetails
Supabase Projectgmjucacmbrumncfnnhua
Supabase URLhttps://gmjucacmbrumncfnnhua.supabase.co
Regionus-east-1
DatabasePostgreSQL 17.6.1
Vercel TeamStorageValet

Vercel Projects

ProjectURLRepo
storage-valet-websitewww.mystoragevalet.comsv-website
sv-portalportal.mystoragevalet.comsv-portal
sv-wikiwiki.mystoragevalet.comsv-wiki

Repository Structure

Integrated System (4 repos, tightly coupled)

These repos share a common Supabase backend and must be considered together:

~/code/sv-portal     # Customer-facing React app
~/code/sv-edge       # Supabase Edge Functions (Deno/TypeScript)
~/code/sv-db         # Database migrations (SQL)
~/code/sv-docs       # System documentation

Standalone Projects

RepoPurposeURL
sv-websiteMarketing site, signup flowwww.mystoragevalet.com
sv-wikiInternal docs (AI + human reference)wiki.mystoragevalet.com

These repos have NO Supabase integration, NO shared code with the portal.

sv-portal (Customer Portal)

Overview

Routes (Non-Negotiable)

RoutePurpose
/loginMagic link authentication
/dashboardItem inventory + booking management
/scheduleService scheduling flow
/accountUser settings

Key Components

src/
├── components/
│   ├── ItemCard.tsx        # Individual item display
│   ├── BookingsList.tsx    # Booking management
│   ├── AddItemModal.tsx    # Item creation
│   └── EditItemModal.tsx   # Item editing
├── pages/
│   ├── Login.tsx           # Auth page
│   ├── Dashboard.tsx       # Main inventory view
│   ├── Schedule.tsx        # Booking flow
│   └── Account.tsx         # User settings
└── lib/
    └── supabase.ts         # Supabase client

Commands

cd ~/code/sv-portal
npm run dev          # Start development server (localhost:5173)
npm run build        # Build for production
npm run typecheck    # TypeScript validation
vercel --prod        # Deploy to production

sv-edge (Edge Functions)

Overview

Functions

FunctionPurposeTrigger
stripe-webhookProcess Stripe eventsWebhook
calendly-webhookProcess Calendly eventsWebhook
create-checkout-sessionInitialize Stripe checkoutPortal
create-portal-sessionStripe billing portalPortal
bookings-listFetch user bookingsPortal
update-booking-itemsUpdate booking itemsPortal

Deployment (CRITICAL)

⚠️ ALWAYS use --no-verify-jwt flag for webhooks

cd ~/code/sv-edge

# Individual function
supabase functions deploy stripe-webhook --no-verify-jwt
supabase functions deploy calendly-webhook --no-verify-jwt

# Or use the deploy script (recommended)
./deploy-and-test.sh

Webhook URLs

WebhookURL
Stripehttps://gmjucacmbrumncfnnhua.supabase.co/functions/v1/stripe-webhook
Calendlyhttps://gmjucacmbrumncfnnhua.supabase.co/functions/v1/calendly-webhook

Integrations

Stripe

ItemValue
ModeLIVE
Product$299/month subscription
Trial14-day complimentary on all new subscriptions
Setup FeeNone (eliminated)
Webhook Versionv3.8
Events Processedcheckout.session.completed, customer.subscription.updated, invoice.payment_succeeded, invoice.payment_failed

Calendly

ItemValue
Eventsinvitee.created, invitee.canceled
IntegrationWebhook only (no outbound API calls)
Signal vs TruthCalendly is signal; database is canonical

Supabase Storage

ItemValue
Bucketitem-photos (private)
AccessSigned URLs (1-hour expiry)
Max Size20MB per file
Allowed Typesimage/jpeg, image/png, image/webp
Max Photos5 per item

Security

Authentication

Row Level Security (RLS)

All customer tables are protected by RLS:

Billing Protection

Billing fields on customer_profile are protected:

Secrets Management

Policy

Never paste secrets into chat, docs, or commits. 1Password CLI (op) is the source of truth.

Deployment

Portal (Vercel)

cd ~/code/sv-portal
npm run build        # Verify build passes
vercel --prod        # Deploy to production

Auto-deploys from GitHub main branch.

Edge Functions

cd ~/code/sv-edge
./deploy-and-test.sh
# OR manually:
supabase functions deploy <function-name> --no-verify-jwt

Database Migrations

cd ~/code/sv-db
supabase db push --linked

Requires: Docker Desktop running

Git Configuration

SettingValue
Author Emailzach@mystoragevalet.com
Author NameZachary Brown

Use only real, verified email addresses. Fabricated emails cause Vercel permission failures.

Architecture Constraints (Non-Negotiable)

  1. 4 routes only: /login, /dashboard, /schedule, /account
  2. Supabase backend only — no custom API servers
  3. Stripe Hosted flows only — no custom card UI
  4. Single pricing tier: $299/month
  5. Magic links only — no password auth
  6. RLS on all tables — zero cross-tenant access
  7. Private storage bucket — signed URLs, 1h expiry

Common Issues & Solutions

IssueSolution
Webhook 401Deploy with --no-verify-jwt
Migration not appliedRun supabase db push --linked
Docker not runningStart Docker Desktop
RLS blocking queryCheck user_id matches auth.uid()