Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ajaysmb/bifrost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

79 Commits

Repository files navigation

Bifrost

Bifrost mobile app

Bifrost is a local workstation bridge: you run the backend + frontend on your laptop, expose them over Tailscale, and then a mobile client (or any other Tailnet device) connects through the private mesh. The backend hosts command execution/agent sessions, WebSockets, and local session discovery; the frontend is a Vite-powered React UI that authenticates via Firebase (optional dev bypass) and speaks to /ws.

Requirements

  • Node 18+ (uses npm workspaces for packages/backend and packages/frontend)
  • PostgreSQL available locally (you are responsible for creating the bifrost and bifrost_test databases that the backend expects)
  • A Firebase project if you want real authentication
  • node-pty native build tools on macOS/Linux/Windows (on mac install xcode-select --install; on Linux install build-essential, Python, etc.)
  • Tailscale installed and logged in on the devices you plan to use

Environment configuration

Populate each package’s .env from its .env.example.

Backend (packages/backend/.env)

Variable Purpose
FIREBASE_PROJECT_ID Firebase project ID for token verification
FIREBASE_SERVICE_ACCOUNT_KEY Optional raw JSON service account
GOOGLE_APPLICATION_CREDENTIALS Optional path to the service-account JSON file
ALLOWED_EMAILS Comma-separated list of allowed Firebase emails
AUTH_DISABLED Set true for dev-only bypass mode; false for real auth
DATABASE_URL / TEST_DATABASE_URL Connection strings for your bifrost and bifrost_test databases
WORKSPACE_BASE Directory under which per-session folders live
WORKSPACE_MODE isolated for per-session dirs, host to reuse the base path
COMMAND_TIMEOUT_S, OUTPUT_MAX_BYTES, TERMINAL_MODE Execution guardrails (keep TERMINAL_MODE=headless on mac)
AGENT_PROVIDER, SECURITY_PROFILE, CLAUDE_CODE_PATH, CODEX_PATH Default agent runtime & CLI paths
PORT Backend HTTP/WebSocket port

Frontend (packages/frontend/.env)

Variable Purpose
VITE_AUTH_DISABLED true to skip Firebase sign-in (matches backend AUTH_DISABLED=true)
VITE_SHOW_EXECUTION_LOG Toggle visibility of the execution log panel
VITE_FIREBASE_* The usual Firebase Web config values (apiKey, authDomain, etc.) used when auth is enabled

Database setup

Create the PostgreSQL databases manually or via createdb bifrost bifrost_test. Point DATABASE_URL/TEST_DATABASE_URL at those names. Then run:

npm install
npm run build --workspace=packages/frontend
npm run dev:backend

This installs dependencies, builds the frontend so packages/frontend/dist exists, and starts the backend (which runs migrations on boot).

Running the app

  1. npm run dev:backend (from repo root) starts the Fastify server on the port configured in packages/backend/.env.
  2. If you make frontend changes, run npm run build --workspace=packages/frontend before running the backend so packages/frontend/dist exists for static hosting.

Tailscale setup

  1. Install Tailscale on every device that needs access (laptop + mobile).
  2. Log in with the same account so they share a Tailnet. The backend listens on 0.0.0.0, which means it accepts connections from any interface; Tailscale provides the private IP you share with the mobile client.
  3. On the mobile device, open the browser/app and point it to http://<your-laptop-tailnet-ip>:<backend-port>/ui (use the backend port from .env and the tailscale status address). The WebSocket connection is made from the frontend to the same origin, so both backend and frontend must be reachable through Tailscale.
  4. If you expose the backend port over the public internet, Tailscale is no longer the gatekeeper—keep that port private to avoid unwanted access.

Notes

  • If you enable AUTH_DISABLED=true, the backend and frontend both bypass Firebase entirely. In that mode, any Tailnet device that can reach the backend can send /ws commands unrestricted.
  • Document the FIRBASE credential paths and CLAUDE_CODE_PATH/CODEX_PATH to match whatever binaries live on your machine.

About

BIFROST

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /