A full-stack webhook inspection and testing application that allows developers to create temporary URLs (bins) for capturing, inspecting, and analyzing HTTP requests in real-time.
- Terminal 1: Install ngrok
ngrok http --url=amazing-mostly-tadpole.ngrok-free.app 3000
- Terminal 2:
cd server
npm run server:dev
- Terminal 3:
cd client
npm run dev
- Go to localhost:5173 (or whatever vite gives you as the endpoint)
- Create and open a new bin
- Copy the bin address and put that as the webhook
The page will now start receiving webhook packages
If you make a repo have the ngrok endpoint as a webhook, then when you commit it will push information about that commit to Push Bin
- Create Webhook Bins: Generate unique URLs to capture webhooks and HTTP requests
- Real-time Updates: Live record updates via WebSocket connections
- Request Inspection: View detailed request data including:
- HTTP method and headers
- Request payloads and bodies
- Timestamps
- Session Management: Bins are scoped to user sessions via HTTP cookies
- Multi-Database Architecture: Hybrid PostgreSQL + MongoDB for optimal data storage
- Multiple Deployment Modes: Support for local development and AWS RDS with SSL/Secrets Manager
- Runtime: Node.js with TypeScript
- Framework: Express.js 5.1.0
- Databases:
- PostgreSQL (bin metadata, record references)
- MongoDB (webhook payloads and headers)
- Real-time: WebSocket (ws 8.18.3)
- AWS Integration: AWS SDK, AWS Secrets Manager
- Session Management: cookie-parser, cookie-session
- Testing: Vitest 3.2.4
- Framework: React 19.1.1 with TypeScript
- Build Tool: Vite 7.1.2
- Styling: Tailwind CSS 4.1.12
- HTTP Client: Axios 1.11.0
- Icons: React Icons 5.5.0
- Testing: Vitest 3.2.4
request-bin-react/
├── client/ # React frontend application
│ ├── src/
│ │ ├── components/ # React components (Form, Sidebar, BinPage, etc.)
│ │ ├── services/ # API client (webhookApi.ts)
│ │ ├── utils/ # Utility functions and TypeScript types
│ │ └── tests/ # Frontend tests
│ └── package.json
├── server/ # Express backend application
│ ├── src/
│ │ ├── controllers/ # Request handlers
│ │ ├── db/ # Database connections and schemas
│ │ ├── models/ # Mongoose models
│ │ ├── routes/ # API route definitions
│ │ ├── tests/ # Backend tests
│ │ └── utils/ # Server utilities
│ └── package.json
└── README.md
- Node.js (v18 or higher)
- PostgreSQL database
- MongoDB database
# Navigate to the project directory
cd request-bin-react
# Install root dependencies
npm install
# Install server dependencies
cd server
npm install
# Install client dependencies
cd ../client
npm installCreate environment files in both server/ and client/ directories:
NODE_ENV=development
PORT=3000
ARCHITECTURE=single-machine
# PostgreSQL Configuration
PGHOST=localhost
PGPORT=5432
PGDATABASE=request_bin
PGUSER=your_username
PGPASSWORD=your_password
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/request_bin
# AWS Configuration (for production)
AWS_MONGO_SECRET_NAME=your_secret_name
AWS_POSTGRES_SECRET_NAME=your_secret_name
CA_FILE_PATH=path/to/ca-certificate.pemVITE_WEBHOOK_URL=http://localhost:3000/api# From server directory
cd server
psql -U your_username -d request_bin -f src/db/postgres/schema.sql# MongoDB will create collections automatically on first use
# Seed data (optional):
npm run db:seedStart both the backend and frontend:
# Terminal 1 - Start Server
cd server
npm run server:dev
# Terminal 2 - Start Client
cd client
npm run dev-modeThe application will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000/api
- Open the application in your browser
- Enter a bin name and click "Create Bin"
- Copy the generated bin URL
- Send HTTP requests to that URL
- View incoming requests in real-time on the bin page
Test your bin using curl:
# Example webhook
curl -X POST http://localhost:3000/api/your-bin-id \
-H "Content-Type: application/json" \
-d '{"message": "Hello, Request Bin!"}'Or using another service:
# GitHub webhook example
# Add the bin URL as a webhook endpoint in your repository settings| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| GET | /bins |
List all bins for current session |
| GET | /bins/:id |
Get bin details |
| GET | /bins/:id/records |
Get all records for a bin |
| POST | /bins/:id |
Create a new bin |
| POST | /:id |
Create record (webhook capture) |
| POST | /bins/:id/records |
Create record (webhook capture) |
| DELETE | /bins |
Delete all bins for current session |
| DELETE | /bins/:id |
Delete a specific bin |
| DELETE | /bins/:id/records |
Delete all records for a bin |
| DELETE | /bins/:id/records/:id |
Delete a specific record |
- PostgreSQL: Stores bin metadata and record references (lightweight relational data)
binstable: id, session_id, created_atrecordstable: id, method, bin_id, mongo_doc_id, created_at
- MongoDB: Stores flexible request payloads and headers
WebHookPayloadscollection: id, payload, headers
This pattern provides:
- Fast relational queries for bin management
- Flexible document storage for variable webhook data
- Optimal performance for each use case
The application supports four deployment modes via the ARCHITECTURE environment variable:
- single-machine: Local development with standard DB connections
- 3-tier: Traditional 3-tier architecture
- RDS-ssl: AWS RDS with SSL/TLS encryption
- RDS-secret-manager: AWS RDS with credentials via AWS Secrets Manager
cd server
npm run test:watchcd client
npm run test:watch# Reset PostgreSQL test database
cd server
npm run db:reset:test
# Reset PostgreSQL development database
npm run db:reset:developmentFor production deployment with AWS:
- RDS Setup: Create PostgreSQL and MongoDB instances on AWS RDS
- Secrets Manager: Store database credentials in AWS Secrets Manager
- SSL Configuration: Obtain SSL certificates for encrypted connections
- Environment Variables: Set
ARCHITECTURE=RDS-secret-manager - CloudFront: Configure CDN for frontend (optional)
The project includes support for generating signed CloudFront URLs for private S3 content:
node cloudfrontSignedUrl.jsSee cloudfrontSignedUrl.js for configuration details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
ISC
- Debugging Webhooks: Test and debug webhook integrations from services like GitHub, Stripe, Slack
- API Development: Inspect HTTP requests during API development
- Integration Testing: Capture and analyze third-party callback URLs
- Security Testing: Monitor incoming request data for security analysis
- Documentation: Generate examples of webhook payloads from real services