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
- βοΈ React 19: Modern UI library
- π§ TanStack Router: Type-safe routing
- π TanStack Query: Powerful data synchronization
- π¨ Tailwind CSS v4: Utility-first CSS framework
- π§© Radix UI: Accessible component primitives
- β‘ Vite: Next-generation frontend tooling
π¦ 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-inspector2. Install dependencies
pnpm install3. Start PostgreSQL database
Navigate to the api folder and start the database:
cd api
docker-compose up -d4. 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:migrate6. Seed the database (optional - adds sample webhook data)
In the api folder, run:
pnpm run db:seed7. 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 devThe 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
- β Select multiple webhooks by clicking the checkboxes
- πͺ Click the "Gerar handler" (Generate handler) button
- π€ 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 paginationGET /api/webhooks/:id- Get specific webhook detailsDELETE /api/webhooks/:id- Delete a webhookPOST /api/generate- Generate TypeScript handler from webhook examplesALL /*- 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:
- Create route file in
api/src/presentation/routes/ - Import and register in
api/src/infrastructure/http/fastify/server.ts - Add database operations in
api/src/infrastructure/database/drizzle/
Frontend - Adding a new feature:
- Create feature folder in
web/src/features/your-feature/ - Add components in
your-feature/components/ - Add API schemas in
your-feature/api/ - Add hooks in
your-feature/hooks/ - 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 formatIn 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