Skip to content

afaf-tech/patha

Patha - Sovereign Webhook Inspection Engine

Self-hosted webhook debugging and inspection. Capture, inspect, mock, and replay webhooks with real-time updates.

License: MIT Rust PRs Welcome

FeaturesArchitectureGetting StartedWeb Interface


Overview

Patha (from Sanskrit पथ meaning "path" or "route") is a sovereign webhook ingestion, mocking, and inspection engine designed for self-hosted deployment. It's a production-grade alternative to webhook.site that prioritizes:

  • Zero Dependencies: Single binary execution with embedded SQLite
  • Real-time Updates: Server-Sent Events for live webhook monitoring
  • Developer Ergonomics: Beautiful UI with instant payload inspection
  • Security First: SSRF protection, signature verification, local-first design
  • Resource Efficient: Rust + Axum for minimal memory footprint

Features

Core Capabilities

  • Dynamic Endpoint Creation: Generate unique webhook URLs on-demand
  • Real-time Capture: Watch webhooks arrive in real-time via SSE
  • Request Inspection: Detailed view of headers, body, query params
  • Mock Responses: Configure custom responses with path matching
  • Replay System: Resend captured webhooks to local servers
  • Ephemeral Mode: Auto-delete data after TTL expiration
  • SQLite Storage: ACID-compliant persistence with WAL mode

Security Features

  • Standard Webhooks signature verification: Optional HMAC-SHA256 validation
  • SSRF protection: Blocks replay to private IPs and cloud metadata endpoints
  • Rate limiting: 100 requests/minute per IP (configurable)
  • Request size limits: Configurable payload size restrictions
  • Isolated execution environment: Secure self-hosted deployment

Monorepo Structure

patha/
├── apps/
│   ├── web/              # Frontend web interface (HTMX + Tailwind)
│   │   ├── public/
│   │   │   ├── index.html
│   │   │   ├── endpoint-detail.html
│   │   │   ├── request-inspector.html
│   │   │   └── css/
│   │   │       └── styles.css
│   │   ├── package.json
│   │   └── README.md
│   │
│   └── backend/          # Rust backend (Axum + SQLite) ✅
│       ├── src/
│       │   ├── main.rs
│       │   ├── handlers/
│       │   ├── models/
│       │   ├── routes/
│       │   ├── services/
│       │   └── db/
│       ├── migrations/
│       └── Cargo.toml
│
├── packages/             # Shared packages [TODO]
│   └── types/           # Shared TypeScript types
│
└── README.md            # This file

Web Interface

The web interface is built with a Terminal Brutalism aesthetic - combining the raw, technical feel of terminal interfaces with refined modern typography and sophisticated animations.

Screenshots

Dashboard - Real-time Webhook Monitoring

Patha Dashboard

Design System - Component Showcase

Patha Design System

Design Highlights

🎨 Visual Design

  • Terminal-inspired color palette with warm amber/gold accents
  • JetBrains Mono + Manrope typography pairing
  • Scanline animations for real-time webhook arrivals
  • Data-dense layouts optimized for developers

⚡ Technology Stack

  • Pure HTML + HTMX 2.x for dynamic updates
  • Tailwind CSS utility classes
  • Server-Sent Events for real-time streams
  • Zero heavy JavaScript frameworks

📱 Pages

  1. Dashboard - Overview of all endpoints and recent activity
  2. Endpoint Detail - Request history and mock rule management
  3. Request Inspector - Deep dive into webhook payloads

Preview

cd apps/web/public
python -m http.server 8080
# Open http://localhost:8080

Architecture

Data Flow

Webhook Sender → /b/{slug}/{*path} → Fast Path (Sync)
                                        ↓
                                   Memory Cache
                                   Rule Matching
                                        ↓
                                   HTTP Response
                                        ↓
                                   mpsc Channel
                                        ↓
                                   Slow Path (Async)
                                        ↓
                          ┌─────────────┴─────────────┐
                          ↓                           ↓
                    SQLite Write                 SSE Broadcast
                    (WAL Mode)                   (Live Updates)
                          ↓                           ↓
                      patha.db                  Dashboard UI

Technology Stack

Component Technology Rationale
Backend Rust (Axum + Tokio) Zero GC overhead, compile-time safety, low memory footprint
Database SQLite (SQLx) ACID compliance, embedded, single-file deployment
Frontend HTMX 2.x + Tailwind CSS Server-side rendering, minimal client JS, fast updates
Real-time Server-Sent Events Unidirectional streaming, native browser support, firewall-friendly
Packaging rust-embed Bake UI assets into binary for single-file deployment

Getting Started

Prerequisites

  • Rust 1.78+ (for backend)
  • Modern browser (Chrome 90+, Firefox 88+, Safari 14+)

Quick Start

1. Clone the repository

git clone https://github.com/yourusername/patha.git
cd patha

2. Run automated setup

./scripts/setup.sh

3. Start the server

make dev
# or manually:
cd apps/backend && cargo run

4. Access the dashboard

http://localhost:8080

5. Send a test webhook

curl -X POST http://localhost:8080/w/test-endpoint \
  -H "Content-Type: application/json" \
  -d '{"event": "test", "data": "hello world"}'

API Endpoints

Management API

Method Endpoint Description
POST /api/v1/endpoints Create new endpoint
GET /api/v1/endpoints List all endpoints
DELETE /api/v1/endpoints/:id Delete endpoint
GET /api/v1/endpoints/:id/requests Get request history
POST /api/v1/requests/:id/replay Replay a request
POST /api/v1/endpoints/:id/rules Create mock rule
GET /api/v1/stream/:slug SSE stream for endpoint

Webhook Capture

Method Endpoint Description
ANY /b/:slug Capture webhook
ANY /b/:slug/{*subpath} Capture with subpath

Configuration

Environment variables:

PORT=8080
DATABASE_URL=/path/to/patha.db
EPHEMERAL_MODE=false
MAX_PAYLOAD_SIZE=10485760  # 10MB
REDIS_URL=redis://localhost:6379  # Optional

Deployment

Docker (Single Container)

docker build -t patha .
docker run -p 8080:8080 -v ./data:/root/data patha

Cloudflare Tunnel (Wildcard Subdomain)

tunnel: your-tunnel-id
ingress:
  - hostname: "*.yourdomain.com"
    service: http://localhost:8080
  - service: http_status:404

Roadmap

Phase 1: Core MVP ✅ COMPLETE

  • Web interface design
  • Page templates (Dashboard, Endpoint Detail, Inspector)
  • Design system and component library
  • Rust backend implementation
  • SQLite schema and migrations
  • Basic CRUD operations

Phase 2: Real-time Features ✅ COMPLETE

  • Server-Sent Events integration
  • Live webhook capture
  • Request replay system (API ready)
  • Mock response engine

Phase 3: Advanced Features

  • Standard Webhooks verification
  • Advanced filtering and search
  • Export to HAR/Postman/cURL
  • Webhook comparison tool
  • Rate limiting and quotas

Phase 4: Enterprise

  • Multi-user support
  • RBAC and permissions
  • Audit logging
  • High availability mode
  • Metrics and monitoring

Contributing

Contributions welcome! Please read CONTRIBUTING.md first.

License

MIT License - see LICENSE file for details

Acknowledgments

  • Inspired by webhook.site, RequestBin, and Beeceptor
  • Built with Rust, Axum, HTMX, and Tailwind CSS
  • Design philosophy: Terminal Brutalism meets Refined Typography

Built with ❤️ for developers who value sovereignty

DocumentationIssuesDiscussions

About

Sovereign webhook inspection engine for self-hosted deployment. Real-time capture, mock responses, and replay functionality with zero external dependencies.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors