Skip to content

chore: wire up electric-proxy for local dev#1463

Merged
saddlepaddle merged 1 commit into
mainfrom
fix/electric-proxy-local-dev
Feb 13, 2026
Merged

chore: wire up electric-proxy for local dev#1463
saddlepaddle merged 1 commit into
mainfrom
fix/electric-proxy-local-dev

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Feb 13, 2026

Summary

Changes

  • package.json — Add @superset/electric-proxy to root bun dev filter
  • apps/electric-proxy/package.json — Use dotenv -e ../../.env to load port, pass --port and --inspector-port 0 to wrangler
  • turbo.jsonc — Add NEXT_PUBLIC_ELECTRIC_URL to globalEnv, ELECTRIC_PROXY_PORT to globalPassThroughEnv
  • .superset/setup.sh — Generate .dev.vars for wrangler, retarget Caddy from API to electric-proxy, add CADDY_ELECTRIC_PORT (+10) and ELECTRIC_PROXY_PORT (+12), set NEXT_PUBLIC_ELECTRIC_URL
  • .gitignore — Add .dev.vars (worktree-specific, generated)

Test Plan

  • bun dev starts electric-proxy on correct port (3052)
  • Caddy proxies HTTPS → wrangler dev for HTTP/2 multiplexing
  • Electric shape requests work end-to-end in desktop app
  • Typecheck, lint, tests all pass

Summary by CodeRabbit

  • Chores
    • Updated development environment configuration to integrate Electric proxy service.
    • Reorganized port allocation and reverse proxy setup for improved service communication during development.

- 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)
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 13, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

These 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

Cohort / File(s) Summary
Development Environment Setup
.gitignore, .superset/setup.sh
Added .dev.vars to gitignore. Refactored .superset/setup.sh to rename CADDY_API_PORT to CADDY_ELECTRIC_PORT, introduce ELECTRIC_PROXY_PORT allocation, update env file generation with new port variables, generate Electric proxy config at apps/electric-proxy/.dev.vars, and rewrite Caddyfile to proxy via Electric proxy instead of direct API proxy.
Electric Proxy Integration
apps/electric-proxy/package.json, package.json, turbo.jsonc
Modified Electric proxy dev script to use dotenv with configurable ELECTRIC_PROXY_PORT. Added @superset/electric-proxy filter to root dev script in Turbo. Added NEXT_PUBLIC_ELECTRIC_URL and ELECTRIC_PROXY_PORT to Turbo global environment variables.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A proxy hops forth with grace,
Electric pathways light the space,
Ports rebound, new routes appear,
Caddy conducts with crystal clear!
Infrastructure blooms, hop hooray! 🌟

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/electric-proxy-local-dev

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@saddlepaddle saddlepaddle merged commit 509134e into main Feb 13, 2026
5 of 7 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 13, 2026

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) View Branch
Fly.io Electric (Fly.io) View App
Fly.io Streams (Fly.io) View App
Vercel API (Vercel) Open Preview
Vercel Web (Vercel) Open Preview
Vercel Marketing (Vercel) Open Preview
Vercel Admin (Vercel) Open Preview
Vercel Docs (Vercel) Open Preview

Preview updates automatically with new commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant