Harbor is a macOS menu bar application built with Tauri that acts as a powerful companion for Supabase development. It synchronizes your local SQL schema definitions with your remote Supabase project, watches for file changes in real-time, and provides tools for managing your entire Supabase workflow.
- Schema Synchronization — Detects changes in your local schema files and pushes them to your Supabase project.
- Split Schema Files — Organises your schema into separate files by object type (tables, functions, policies, etc.) for cleaner version control.
- Introspection — Reads the current state of your remote database to ensure accurate diffing.
- Pull & Push — Pull the remote schema down or push local changes up, with a clear diff preview before applying.
- Safety Checks — Warns you before applying destructive changes (like dropping tables or columns).
- File Watching — Automatically watches your project directory for changes and keeps everything in sync.
- Edge Functions — Deploy Supabase Edge Functions directly from the app.
- Seed Data — Run seed SQL files against your database.
- SQL Editor — Write and execute SQL queries against your project with an integrated editor.
- Logs Viewer — View Postgres, Auth, and Edge Function logs from your Supabase project.
- Templates — Import project templates to bootstrap new Supabase projects.
- Deep Linking — Supports
harbor://deep links for integrating with external tools. - Native Notifications — macOS notifications for sync events and deployment results.
Harbor securely stores sensitive credentials — your Supabase Personal Access Token and OpenAI API Key — using the native macOS Keychain via the keyring crate with the apple-native backend. Secrets never touch the filesystem.
The project is a Tauri v2 app with a React + TypeScript frontend (Vite, Tailwind CSS) and a Rust backend.
The backend is structured around the lifecycle of a schema change:
-
Parsing (
parsing/) — Reads local SQL files and converts them into structured Rust types (e.g.,TableInfo,FunctionInfo) representing the desired schema state. -
Introspection (
introspection/) — Queries the remote Supabase database to build an in-memory representation of the live schema (tables, columns, extensions, policies, triggers, etc.). -
Diff (
diff/) — Compares the Introspected (remote) state against the Parsed (local) state. Determines exactly what needs to change and flags destructive operations. -
Generator (
generator/) — Takes the diff output and produces the SQL statements (CREATE,ALTER,DROP) to transition the database to the desired state. Also handles splitting schemas into categorised files. -
Commands (
commands/) — Exposes backend capabilities to the frontend via Tauri commands (project management, syncing, deploying, auth, SQL execution, logs, templates, etc.). -
Watcher (
watcher.rs) — File system watcher usingnotifythat monitors project directories for changes and triggers sync events. -
State (
state.rs) — Application state management, including project data, keychain access, schema caching, and watcher lifecycle. -
Supabase API (
supabase_api.rs) — HTTP client for the Supabase Management API (schema introspection, edge function deployment, log queries, etc.).
- Components (
components/) — React components for the project list, diff sidebar, pull sidebar, settings, SQL editor, logs viewer, seed runner, and more. - API Layer (
api.ts) — TypeScript bindings to Tauri commands. - Types (
types.ts) — Shared TypeScript type definitions.
-
Install dependencies:
pnpm i
-
Start the dev server:
pnpm tauri dev
This will compile the Rust backend and launch the app in your menu bar.