Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 30 additions & 10 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
# Production Environment Variables Template
# Copy this file to .env and fill in your production values
# NEVER commit .env to version control!
# MeshHook environment template
# Copy to .env and fill in real values. NEVER commit .env.

# Supabase Production
DATABASE_URL=postgresql://postgres:[YOUR-PASSWORD]@db.[YOUR-PROJECT-REF].supabase.co:5432/postgres
SUPABASE_URL=https://[YOUR-PROJECT-REF].supabase.co
SUPABASE_ANON_KEY=[YOUR-ANON-KEY]
SUPABASE_SERVICE_ROLE_KEY=[YOUR-SERVICE-ROLE-KEY]
# ---------------------------------------------------------------------------
# Database (Turso / libSQL)
# ---------------------------------------------------------------------------
# Local development — a plain SQLite file, no server required:
# TURSO_DATABASE_URL=file:./meshhook.db
#
# Production — create the database and a token with the Turso CLI:
# turso db create meshhook
# turso db show meshhook --url
# turso db tokens create meshhook
TURSO_DATABASE_URL=libsql://your-database-your-org.turso.io
TURSO_AUTH_TOKEN=your-turso-auth-token

# ---------------------------------------------------------------------------
# Secrets vault
# ---------------------------------------------------------------------------
# Encrypts the secrets table with AES-256-GCM. Generate with:
# openssl rand -hex 32
# Losing this key makes every stored secret unrecoverable; rotating it requires
# re-encrypting existing rows.
SECRETS_ENCRYPTION_KEY=

# ---------------------------------------------------------------------------
# Integrations
# ---------------------------------------------------------------------------
OPENAI_API_KEY=your-openai-api-key

# Application Settings
# ---------------------------------------------------------------------------
# Application
# ---------------------------------------------------------------------------
NODE_ENV=production
PORT=8080
PORT=8080
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ Thumbs.db
# Test coverage
coverage/
.nyc_output/
pnpm-lock.yaml
.env.local
48 changes: 29 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
# MeshHook — Mesh your webhooks. Orchestrate everything.

**MeshHook** is an MIT-licensed, webhook-first workflow engine with a visual builder (SvelteKit/Svelte 5) and Temporal-like durability via **event sourcing on Postgres (Supabase)**.
**MeshHook** is an MIT-licensed, webhook-first workflow engine with a visual builder (SvelteKit/Svelte 5) and Temporal-like durability via **event sourcing on SQLite (Turso)**.

## Stack
- **UI/API**: SvelteKit (Svelte 5)
- **DB/Queues/Realtime/Storage**: Supabase (Postgres, Realtime, Storage)
- **Database**: Turso (libSQL/SQLite) — embeddable locally, replicated in production
- **Workers**: Node.js (or Bun), stateless
- **Queue**: pg-boss or pgmq (Postgres-native)
- **Queue**: SQLite-backed, with visibility timeouts and a dead-letter queue
- **Auth**: self-hosted sessions (scrypt password hashing, opaque session tokens)
- **Live logs**: Server-Sent Events
- **Transforms**: JMESPath
## Why MeshHook?

| Feature | n8n | Windmill | Temporal | MeshHook |
|---------|-----|----------|----------|----------|
| **License** | Fair-code (restrictive) | AGPLv3 | MIT | **MIT** |
| **Primary Use Case** | No-code automation | Script orchestration | Microservice workflows | **Webhook-first workflows** |
| **Durability** | Database polling | Database + queues | Custom event sourcing | **Event sourcing on Postgres** |
| **Durability** | Database polling | Database + queues | Custom event sourcing | **Event sourcing on SQLite** |
| **Visual Builder** | ✅ Drag-and-drop | ❌ Code-first | ❌ Code-first | **✅ Visual + Code** |
| **Webhook-Native** | ⚠️ Supported | ⚠️ Supported | ❌ Not primary | **✅ Built-in** |
| **Self-Hosted** | ✅ Yes | ✅ Yes | ✅ Yes | **✅ Yes** |
| **Database** | MySQL/Postgres | Postgres | Custom | **Postgres (Supabase)** |
| **Database** | MySQL/Postgres | Postgres | Custom | **SQLite (Turso)** |
| **Transforms** | JavaScript | TypeScript/Python | Any language | **JMESPath** |
| **Realtime Logs** | ❌ Polling | ❌ Polling | ❌ Polling | **✅ Supabase Realtime** |
| **Realtime Logs** | ❌ Polling | ❌ Polling | ❌ Polling | **✅ Server-Sent Events** |
| **Deployment** | Complex (multiple services) | Complex (workers + API) | Complex (server + workers) | **Simple (single service)** |
| **Learning Curve** | Low (no-code) | Medium (scripts) | High (SDK required) | **Low (visual + simple)** |

Expand All @@ -30,7 +32,7 @@
- **MIT licensed**: Truly open source, use anywhere without restrictions
- **Event sourcing**: Temporal-like durability without the complexity
- **Visual + Code**: Low-code visual builder with JMESPath for power users
- **Postgres-native**: Leverage Supabase for database, queues, realtime, and storage
- **No infrastructure**: local development is a single SQLite file — no server, no containers


## Quick Start
Expand All @@ -46,19 +48,17 @@
```bash
pnpm run setup
```
Select "Local Development" when prompted. This creates `.env.local` with Supabase local defaults.
Select "Local Development" when prompted. This creates `.env.local` pointing at a
local SQLite file (`file:./meshhook.db`) and generates a secrets encryption key.

3. **Start Supabase locally**
```bash
pnpx supabase start
```
There is no database server to start — the file is created by the migration step.

4. **Run migrations**
3. **Run migrations**
```bash
pnpm run db:migrate
```

5. **Start the orchestrator**
4. **Start the orchestrator**
```bash
pnpm run start
```
Expand All @@ -75,13 +75,20 @@
```bash
pnpm run setup
```
Select "Production" or "Staging" and enter your Supabase credentials.
Select "Production" or "Staging" and enter your Turso database URL and auth token.
Create them first with the Turso CLI:
```bash
turso db create meshhook
turso db show meshhook --url
turso db tokens create meshhook
```

3. **Run migrations**
```bash
pnpm run db:migrate
```
Automatically detects environment and pushes migrations to remote database.
Applies any pending migrations from `migrations/` and records them in
`schema_migrations`. Re-running is a no-op.

4. **Start the server**
```bash
Expand All @@ -92,7 +99,10 @@
## Available Commands

- `pnpm run setup` - Interactive environment configuration (local/staging/production)
- `pnpm run db:migrate` - Run database migrations (auto-detects environment)
- `pnpm run db:migrate` - Apply pending database migrations
- `pnpm run db:status` - Show applied and pending migrations
- `pnpm run db:verify` - Verify the schema matches what the app expects
- `pnpm test` - Run the test suite
- `pnpm run start` - Start the orchestrator worker (production)
- `pnpm mh --help` - CLI help

Expand All @@ -106,7 +116,7 @@
## Documentation

- [`./docs/Environment-Setup.md`](./docs/Environment-Setup.md) - Detailed environment setup guide
- [`./docs/Event-Partitioning.md`](./docs/Event-Partitioning.md) - Event partitioning strategy and maintenance
- [`./docs/Turso-Migration.md`](./docs/Turso-Migration.md) - What changed in the move off Supabase
- [`./docs/PRD.md`](./docs/PRD.md) - Product requirements
- [`./docs/Architecture.md`](./docs/Architecture.md) - System architecture
- [`./docs/diagrams/*.puml`](./docs/diagrams/) - PlantUML diagrams
Expand All @@ -119,4 +129,4 @@ MeshHook runs as a single service on port 8080 that handles:
- Background job execution
- HTTP request execution with retries

All components communicate via Supabase (Postgres) - no inter-service HTTP calls needed.
All components communicate through the Turso database - no inter-service HTTP calls needed.
Loading
Loading