Welcome to the Webhook repository! This project provides a secure, multi-tenant webhook system that can operate using in-memory storage, Redis, or Kafka. It features exponential backoff for retry strategies, ensuring reliable message delivery in distributed systems.
Visit the Releases section for downloads.
- Features
- Getting Started
- Installation
- Usage
- Configuration
- Architecture
- Monitoring
- Contributing
- License
- Contact
- Multi-Tenant Support: Handle multiple clients with ease.
- Storage Options: Choose between in-memory, Redis, or Kafka.
- Exponential Backoff: Retry failed webhooks intelligently.
- Encryption: Secure your data with RSA encryption.
- Partitioning: Efficiently manage message distribution with Kafka.
- Monitoring: Integrate with Grafana for real-time metrics.
To get started with the Webhook system, follow the instructions below. You will need Deno installed on your machine. If you haven't done so, please visit the Deno website for installation instructions.
- Deno (version 1.0 or higher)
- Redis or Kafka (if using these as storage options)
Clone the repository to your local machine:
git clone https://github.com/ronixa/webhook.git
cd webhook
Install the necessary dependencies:
deno run --allow-net --allow-read --allow-write --allow-env --unstable main.ts
To start the Webhook system, run the following command:
deno run --allow-net --allow-read --allow-write --allow-env --unstable main.ts
You can now send webhooks to the system. Here’s an example of how to send a webhook using curl:
curl -X POST http://localhost:8000/webhook \
-H "Content-Type: application/json" \
-d '{"event": "user_signup", "data": {"user_id": "12345"}}'
The webhook payload should be in JSON format. Here’s a sample structure:
{
"event": "event_name",
"data": {
"key1": "value1",
"key2": "value2"
}
}
You can configure the Webhook system using environment variables. Here are the available options:
WEBHOOK_PORT
: The port on which the webhook server will listen (default: 8000).STORAGE_TYPE
: The storage type to use (memory
,redis
, orkafka
).REDIS_URL
: The URL for the Redis server (required if using Redis).KAFKA_BROKER
: The address of the Kafka broker (required if using Kafka).ENCRYPTION_KEY
: The RSA key for encrypting webhook data.
Create a .env
file in the root directory with the following content:
WEBHOOK_PORT=8000
STORAGE_TYPE=redis
REDIS_URL=redis://localhost:6379
The Webhook system follows a microservices architecture. Here’s a high-level overview:
- Webhook Receiver: Listens for incoming webhook requests.
- Message Queue: Uses Redis or Kafka for message queuing.
- Worker: Processes the queued messages and sends them to the appropriate endpoint.
- Monitoring: Integrates with Grafana for real-time monitoring.
Integrate with Grafana to visualize the performance of your webhook system. You can set up dashboards to monitor:
- Incoming webhook requests
- Processing times
- Success and failure rates
To set up monitoring, ensure you have Grafana installed and connect it to your data source.
We welcome contributions! To contribute to the Webhook project:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your branch and create a pull request.
Please ensure that your code adheres to the project's coding standards.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or support, feel free to reach out:
- Email: [email protected]
- GitHub Issues: Create an issue
Thank you for checking out the Webhook project! We hope you find it useful for your applications.