Deployment Guide#
Deploy your own instance of WatchLLM at the edge.
Edge Worker (Cloudflare)#
The proxy runs on Cloudflare Workers for global low-latency execution.
- Prerequisites: Install Wrangler and login:
pnpm --filter @watchllm/worker install wrangler wrangler login - Configuration: Copy the
wrangler.tomlsample and define your bindings:SUPABASE_URL&SUPABASE_ANON_KEYUPSTASH_REDIS_REST_URL&TOKENOPENROUTER_API_KEYSENTRY_DSN(Optional)
- Deployment: Run the deploy command:
pnpm --filter @watchllm/worker deploy - Custom Domain: Assign a domain (e.g.,
proxy.yourdomain.com) in the Cloudflare dashboard under Workers > Triggers.
Dashboard (Next.js)#
The management console for projects, API keys, and analytics.
- Environment: Sync your
.env.localusing.env.example. - Setup Services:
- Stripe: Configure webhooks for
/api/webhooks/stripe. - Resend: Add your API key for transactional emails.
- Stripe: Configure webhooks for
- Vercel Deployment:
- Connect your repository.
- Set the Root Directory to
dashboard. - Add all environment variables.
- Deploy.
Database Optimization#
WatchLLM uses Supabase (PostgreSQL) for persistence.
- Migrations: Ensure you've run the scripts in
/supabase/migrations. - RLS: Row-Level Security is enabled by default to protect project data.
- Indexes: Critical indexes are provided for
usage_logsto ensure fast analytics.