chore: wire up electric-proxy for local dev#1463
Conversation
- Add electric-proxy to root `bun dev` filter so it starts with other services - Use `dotenv -e ../../.env` in wrangler dev script to load port from .env - Retarget Caddy HTTP/2 proxy from API to electric-proxy (for SSE multiplexing) - Generate .dev.vars from setup.sh for wrangler worker secrets - Add NEXT_PUBLIC_ELECTRIC_URL to turbo globalEnv and ELECTRIC_PROXY_PORT to globalPassThroughEnv - Gitignore .dev.vars (worktree-specific, generated)
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThese changes integrate Electric proxy infrastructure into the development setup. Port allocations are reorganized with new Electric-specific ports, a new Electric proxy service is added to the build system, environment variables are configured for the Electric proxy, and Caddy's reverse proxy configuration is updated to route through the Electric proxy. Changes
Sequence DiagramsequenceDiagram
participant Client
participant Caddy as Caddy<br/>(Reverse Proxy)
participant ElectricProxy as Electric Proxy<br/>Service
participant API as API<br/>Service
participant Other as Other Services
Client->>Caddy: HTTP Request
Caddy->>ElectricProxy: Route via CADDY_ELECTRIC_PORT
ElectricProxy->>API: Forward via ELECTRIC_PROXY_PORT
API-->>ElectricProxy: Response
ElectricProxy-->>Caddy: Response
Caddy-->>Client: HTTP Response
Note over Caddy,ElectricProxy: New Electric Proxy setup<br/>replaces direct API routing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
Summary
Changes
package.json— Add@superset/electric-proxyto rootbun devfilterapps/electric-proxy/package.json— Usedotenv -e ../../.envto load port, pass--portand--inspector-port 0to wranglerturbo.jsonc— AddNEXT_PUBLIC_ELECTRIC_URLtoglobalEnv,ELECTRIC_PROXY_PORTtoglobalPassThroughEnv.superset/setup.sh— Generate.dev.varsfor wrangler, retarget Caddy from API to electric-proxy, addCADDY_ELECTRIC_PORT(+10) andELECTRIC_PROXY_PORT(+12), setNEXT_PUBLIC_ELECTRIC_URL.gitignore— Add.dev.vars(worktree-specific, generated)Test Plan
bun devstarts electric-proxy on correct port (3052)Summary by CodeRabbit