This demo project shows the initial setup for Webhooker using a Rails API backend and a React frontend. The code is split into two folders:
backend– Ruby on Rails (API only)frontend– React + Vite (TypeScript)
- Ruby 3.4+
- Node.js 20+ (use
npm install --legacy-peer-depsif your Node version is below 22) - PostgreSQL
cd backend
bundle install
bin/rails db:create # creates local databases
bin/rails serverThe CORS initializer config/initializers/cors.rb is ready to be updated to allow requests from the frontend (default Vite port is 5173).
cd frontend
npm install
npm run devThe app will start on http://localhost:5173 and will use Axios (to be added) to talk to the Rails API.
Once both backend and frontend are running, open http://localhost:5173 in your browser. Enter the uuid of a webhook session in the input box at the top to load captured events.
- Left pane: list of events with a search box.
- Right pane: details for the selected event.
- Replay: click the "Replay" button to open a modal and send the request payload to a new URL.
After starting the Rails server, you can test the webhook receiver by sending a
POST request to /webhooks/:uuid where :uuid is any unique identifier. For
example:
curl -X POST http://localhost:3000/webhooks/test-uuid -d '{"ping": true}' \
-H 'Content-Type: application/json'Each request will create a WebhookSession (if it does not already exist) and a
corresponding Event record storing the headers and body.
To view captured requests for a session:
curl http://localhost:3000/events/<session_uuid>Replay a captured event to a new URL by supplying the target url parameter:
curl -X POST http://localhost:3000/events/<event_id>/replay \
-d "url=http://example.com/target"The Inspector UI now includes a Send Test Webhook form. Enter a session UUID
and raw JSON payload, then click "Send" to POST the data directly to
/webhooks/:uuid. The response status and body are displayed under the form, and
the new request will appear in the event list automatically.
Create a new webhook session (optional name parameter for a persistent session):
curl -X POST http://localhost:3000/sessions -d "name=my-session"The response returns a uuid to use with /webhooks/:uuid. Anonymous sessions
expire after 7 days. Accessing an expired session will return 410 Gone.
curl -X POST http://localhost:3000/sessionsDetailed request and response examples for all endpoints are available in
api-docs.md.
These instructions cover the project setup described in the PRD. The webhook receiver corresponds to Issue #1, the event listing and replay API to Issue #4, and the in-browser webhook sender to Issue #7 in ISSUES.md. The API documentation file was added for Issue #8.
A minimal QA script and manual test plan are provided under the qa/ folder for Issue #9.
- Start the Rails API server and the React development server.
- Run
bash qa/e2e_test.sh(or followqa/manual-test-plan.md) to create a session, send a test webhook, list events, and replay it tohttp://httpbin.org/post. - Open the Inspector UI at http://localhost:5173 and verify the test webhook appears and replays successfully.
The repository includes a render.yaml for deploying the app to Render.
The Docker build now compiles the React app automatically. For local testing you can still build and copy the files manually:
cd frontend
npm install --legacy-peer-deps
npm run build
cp -r dist/* ../backend/public/Create a Render web service using backend/Dockerfile and set the RAILS_MASTER_KEY
from backend/config/master.key. During deploy the service runs bundle exec rails db:migrate.