Startup chain
pnpm dev
└─ infisical run --env=dev --path=/
└─ pnpm run dev:local
├─ Vite / SvelteKit localhost:5173
├─ Wrangler image worker localhost:8787
├─ Local anonymous Convex backend 127.0.0.1:3210
└─ Raycast develop → localhost:5173
Infisical injects 12 shared development variables into the parent process. Every child inherits them. The root script then overrides PUBLIC_CONVEX_URL to http://127.0.0.1:3210, forcing the web app and Raycast-facing API onto local Convex.
Service matrix
| Service | Where it runs | Environment |
|---|---|---|
| SvelteKit web | Local Vite server, port 5173 | Infisical dev values exposed through SvelteKit env modules |
| Cloudflare compatibility | adapter-cloudflare platform proxy inside Vite | Bindings modeled from apps/web/wrangler.jsonc |
| Image optimizer | Local Workerd via wrangler dev, port 8787 | Infisical process env; ignored local env files remain fallback only |
| Convex | Local anonymous backend, port 3210 | Generated local Convex state plus two runtime vars pushed by the setup script |
| Clerk | Hosted Clerk development instance | Confirmed pk_test_/sk_test_ credentials |
| Autumn | Hosted development API | Confirmed development/test secret key |
| UploadThing | Hosted API | Token supplied through backend AppConfig |
| PhotoRoom | Hosted API, only when background removal runs | Key inherited by the local image worker |
| Raycast | Local ray develop | Defaults its API URL to the local web server |
Environment flow
Infisical dev project (/)
↓ inject into process
Vite + Wrangler + Convex + Raycast child processes
↓ SvelteKit adapter
$env/dynamic/private + $env/dynamic/public
↓ runtime.ts
explicit Effect ConfigProvider
↓ validate once
AppConfig service
↓
Clerk · Convex · Autumn · UploadThing · signing · webhooks
- SvelteKit remains the source adapter. Backend application code does not read
process.envdirectly. - Effect validates once.
AppConfigparses required values and keeps secrets redacted until an SDK or crypto boundary. - Public values stay public. Clerk’s publishable key and the Convex URL can reach browser code; private keys cannot.
- Local files are fallback only.
.env.localfiles are ignored and optional; the stack was verified without them.
Local vs hosted boundaries
- Local
- Vite web server, Cloudflare platform proxy, image Workerd, KV/R2/Images emulation, Convex backend, Raycast extension.
- Hosted
- Clerk development, Autumn development, UploadThing, and PhotoRoom.
- Not used by
pnpm dev - The configured cloud Convex deployment. The local runner removes cloud deployment variables and substitutes port 3210.
- Hosted Convex option
pnpm dev:hostedskips the local Convex process and points the app at the hosted development deployment.
Local development uses development credentials, but calls to Clerk, Autumn, UploadThing, and PhotoRoom leave the machine. Background removal can invoke PhotoRoom even though its cache and bucket bindings are local.
One wording correction: the web app is not itself running under wrangler dev during pnpm dev. Its package script is vite dev. Use the web package’s preview flow to build and run the complete web Worker through Wrangler.