Skip to main content

Deployment

WEFA deploys as two services: a Vercel frontend (PWA) and a Fly.io API server (packages/api).

Frontend (Vercel)

The React PWA in packages/app deploys to Vercel. vercel.json configures SPA routing, security headers, and CSP.

Client-Side Environment Variables

VariablePurpose
VITE_API_BASE_URLAPI server URL (https://api.wefa.app in production)
VITE_SIGNALING_URLSWebSocket signaling relay (wss://api.wefa.app)
VITE_YJS_TRANSPORTYjs transport mode (webrtc/websocket/hybrid)
VITE_APPKIT_PROJECT_IDReown AppKit project ID
VITE_PIMLICO_SPONSORSHIP_POLICY_IDPimlico sponsorship policy
VITE_PASSKEY_RP_IDWebAuthn relying party ID

API Server (Fly.io)

The Hono server in packages/api deploys to Fly.io at api.wefa.app. It handles both HTTP API routes and WebSocket signaling.

API Endpoints

EndpointPurpose
GET /Health check
POST /api/creatures/traitsGenerate creature traits (OpenAI gpt-4o-mini)
POST /api/creatures/imageGenerate creature sprite (OpenAI gpt-image-1)
POST /api/creatures/modelStart Meshy Image-to-3D task
GET /api/creatures/model?taskId=Poll Meshy task status
POST /api/environment/inferInfer biome from GPS (Open-Meteo)
POST /api/plants/identifyPlant identification (Plant.ID by Kindwise)
POST /api/auth/pimlicoPimlico bundler/paymaster proxy
ws://WebSocket signaling relay (y-webrtc)

Server-Side Secrets

Set via fly secrets set:

SecretPurpose
OPENAI_API_KEYCreature traits + image generation
MESHY_API_KEYImage-to-3D model generation
PLANTID_API_KEYPlant identification + health assessment
PIMLICO_API_KEYSmart account sponsorship proxy

Deploy

cd packages/api
fly deploy

CI/CD

GitHub Actions (.github/workflows/ci.yml) runs on PRs to main:

  • Lint (Biome + Oxlint)
  • Typecheck
  • Unit tests (app + api)
  • Build
  • Lighthouse audit