GitHunt
IS

isaqu3d/webhook-inspector

A full-stack TypeScript tool for capturing, inspecting, and debugging webhooks in real-time with AI-powered handler generation.

πŸ” Webhook Inspector

A complete tool for testing and understanding webhooks in real-time. Intercept, analyze, and debug HTTP requests while developing integrations with services like Stripe, GitHub, video platforms, and moreβ€”all in a secure environment with a modern interface.

✨ Features

  • πŸ“‘ Real-time Webhook Capture: Automatically capture and store all incoming webhook requests
  • πŸ”Ž Detailed Request Inspection: View complete request details including headers, query parameters, body, and metadata
  • πŸ€– Smart Handler Generation: AI-powered TypeScript + Zod handler generation based on captured webhook examples
  • 🎨 Modern UI: Clean, dark-themed interface built with Tailwind CSS and Radix UI
  • πŸ”’ Type-Safe API: Full TypeScript support with Zod validation throughout the stack
  • ♾️ Infinite Scroll: Efficiently browse through large numbers of captured webhooks
  • πŸ” Search & Filter: Quickly find specific webhooks in your history

πŸ› οΈ Tech Stack

Backend

  • ⚑ Fastify: Fast and low overhead web framework
  • πŸ—„οΈ Drizzle ORM: TypeScript ORM with PostgreSQL
  • βœ… Zod: TypeScript-first schema validation
  • 🐘 PostgreSQL: Reliable relational database
  • πŸ€– @ai-sdk/google: AI integration for handler generation

Frontend

πŸ“¦ Installation

Prerequisites

  • Node.js 18+ and pnpm
  • Docker and Docker Compose (for PostgreSQL)
  • Google AI API key (for handler generation feature)

Setup

1. Clone the repository

git clone git@github.com:isaqu3d/webhook-inspector.git
cd webhook-inspector

2. Install dependencies

pnpm install

3. Start PostgreSQL database

Navigate to the api folder and start the database:

cd api
docker-compose up -d

4. Configure environment variables

Create a .env file in the api directory:

DATABASE_URL="postgresql://docker:docker@localhost:5432/webhooks"
PORT=3333
NODE_ENV=development
GOOGLE_GENERATIVE_AI_API_KEY="your-google-ai-api-key"

5. Run database migrations

In the api folder, run:

pnpm run db:migrate

6. Seed the database (optional - adds sample webhook data)

In the api folder, run:

pnpm run db:seed

7. Start the development servers

In separate terminal windows:

# Terminal 1 - API Server
# In the api folder, run:
cd api
pnpm run dev

# Terminal 2 - Web Frontend
# In the web folder, run:
cd web
pnpm run dev

The API will be available at http://localhost:3333 and the web interface at http://localhost:5173.

πŸš€ Usage

Capturing Webhooks

Send any HTTP request to your Webhook Inspector instance and it will automatically capture and store the details:

# Example: Capture a POST request
curl -X POST http://localhost:3333/webhook/stripe \
  -H "Content-Type: application/json" \
  -d '{"event": "payment_intent.succeeded", "amount": 1000}'

All captured webhooks will appear in the sidebar and can be clicked to view full details.

Generating Handlers

  1. βœ… Select multiple webhooks by clicking the checkboxes
  2. πŸͺ„ Click the "Gerar handler" (Generate handler) button
  3. πŸ€– The AI will analyze the webhook patterns and generate a type-safe TypeScript handler with:
    • Zod schemas for validation
    • Type definitions for each event
    • Individual handler functions
    • Main routing function

Database Management

In the api folder, run:

# Open Drizzle Studio (database GUI)
pnpm run db:studio

# Generate new migration
pnpm run db:generate

# Apply migrations
pnpm run db:migrate

πŸ“š API Documentation

Interactive API documentation is available at http://localhost:3333/docs when the server is running.

Main Endpoints

  • GET /api/webhooks - List captured webhooks with pagination
  • GET /api/webhooks/:id - Get specific webhook details
  • DELETE /api/webhooks/:id - Delete a webhook
  • POST /api/generate - Generate TypeScript handler from webhook examples
  • ALL /* - Catch-all route that captures incoming webhooks

πŸ“ Project Structure

This project follows professional architectural patterns for scalability and maintainability.

Backend (Clean Architecture)

api/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ domain/                          # Business logic
β”‚   β”‚   β”œβ”€β”€ entities/                    # Core entities
β”‚   β”‚   └── value-objects/               # Value objects
β”‚   β”‚
β”‚   β”œβ”€β”€ infrastructure/                  # Technical implementations
β”‚   β”‚   β”œβ”€β”€ database/
β”‚   β”‚   β”‚   └── drizzle/
β”‚   β”‚   β”‚       β”œβ”€β”€ migrations/          # Database migrations
β”‚   β”‚   β”‚       β”œβ”€β”€ schemas/             # Drizzle ORM schemas
β”‚   β”‚   β”‚       β”œβ”€β”€ index.ts             # Database connection
β”‚   β”‚   β”‚       └── seed.ts              # Database seeding
β”‚   β”‚   β”œβ”€β”€ ai/                          # AI service integrations
β”‚   β”‚   └── http/
β”‚   β”‚       └── fastify/
β”‚   β”‚           β”œβ”€β”€ plugins/             # Fastify plugins
β”‚   β”‚           └── server.ts            # Server configuration
β”‚   β”‚
β”‚   β”œβ”€β”€ presentation/                    # API layer
β”‚   β”‚   β”œβ”€β”€ routes/                      # API route handlers
β”‚   β”‚   β”œβ”€β”€ controllers/                 # Controllers
β”‚   β”‚   └── validators/                  # Request validators
β”‚   β”‚
β”‚   β”œβ”€β”€ shared/                          # Shared code
β”‚   β”‚   β”œβ”€β”€ config/                      # Configuration (env)
β”‚   β”‚   β”œβ”€β”€ errors/                      # Error handlers
β”‚   β”‚   β”œβ”€β”€ types/                       # TypeScript types
β”‚   β”‚   └── utils/                       # Utility functions
β”‚   β”‚
β”‚   └── main.ts                          # Application entry point
β”‚
β”œβ”€β”€ drizzle.config.ts
└── package.json

Frontend (Feature-based Architecture)

web/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                             # Application setup
β”‚   β”‚   β”œβ”€β”€ providers/                   # React providers
β”‚   β”‚   └── routes/                      # TanStack Router routes
β”‚   β”‚
β”‚   β”œβ”€β”€ features/                        # Feature modules
β”‚   β”‚   β”œβ”€β”€ webhooks/
β”‚   β”‚   β”‚   β”œβ”€β”€ api/                     # API schemas & queries
β”‚   β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ sidebar/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ webhook-details/
β”‚   β”‚   β”‚   β”‚   └── webhook-list/
β”‚   β”‚   β”‚   β”œβ”€β”€ hooks/                   # Feature-specific hooks
β”‚   β”‚   β”‚   └── types/                   # Feature types
β”‚   β”‚   β”‚
β”‚   β”‚   └── handler-generation/
β”‚   β”‚       β”œβ”€β”€ api/
β”‚   β”‚       β”œβ”€β”€ components/
β”‚   β”‚       └── hooks/
β”‚   β”‚
β”‚   β”œβ”€β”€ shared/                          # Shared resources
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/                      # Reusable UI components
β”‚   β”‚   β”‚   └── layout/                  # Layout components
β”‚   β”‚   β”œβ”€β”€ hooks/                       # Shared hooks
β”‚   β”‚   β”œβ”€β”€ lib/                         # Utilities & configs
β”‚   β”‚   β”œβ”€β”€ types/                       # Global types
β”‚   β”‚   └── constants/                   # Constants
β”‚   β”‚
β”‚   β”œβ”€β”€ styles/                          # Global styles
β”‚   β”‚   └── themes/                      # Theme files
β”‚   β”‚
β”‚   └── main.tsx                         # Application entry point
β”‚
└── package.json

🎯 Architecture Benefits

Backend (Clean Architecture)

  • βœ… Separation of Concerns: Business logic isolated from infrastructure
  • βœ… Testability: Easy to write unit tests for each layer
  • βœ… Flexibility: Switch databases or frameworks without affecting business logic
  • βœ… Scalability: Add new features without modifying existing code

Frontend (Feature-based)

  • βœ… Modularity: Each feature is self-contained and independent
  • βœ… Colocation: Related code lives together (components, hooks, types)
  • βœ… Maintainability: Easy to find and modify code
  • βœ… Reusability: Shared components and utilities are centralized

πŸ“ Adding New Features

Backend - Adding a new route:

  1. Create route file in api/src/presentation/routes/
  2. Import and register in api/src/infrastructure/http/fastify/server.ts
  3. Add database operations in api/src/infrastructure/database/drizzle/

Frontend - Adding a new feature:

  1. Create feature folder in web/src/features/your-feature/
  2. Add components in your-feature/components/
  3. Add API schemas in your-feature/api/
  4. Add hooks in your-feature/hooks/
  5. Create routes in web/src/app/routes/ if needed

🎨 Code Formatting

Both packages use Biome for consistent code formatting.

In the api folder, run:

pnpm run format

In the web folder, run:

pnpm run format

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

MIT License - feel free to use this project for your own purposes.

πŸ™ Acknowledgments

Built with modern web technologies and professional architectural patterns:

  • Clean Architecture on the backend for maintainability and testability
  • Feature-based Architecture on the frontend for scalability
  • Type-safety throughout the entire stack with TypeScript and Zod
  • Best practices for a seamless developer experience

Made with ❀️ by developers, for developers

isaqu3d/webhook-inspector | GitHunt