Skip to Content
Heels LogoHeelsDocs
Getting Started

System Architecture

Under the hood of the Heels high-throughput event processing platform.

System Architecture

Heels is engineered as a decoupled, multi-service architecture designed for ultra-low ingestion latency, strict data durability, and resilient multi-channel fan-out.

Rendering diagram...

Service Breakdown

1. service-publisher

The ingestion gateway for all incoming form submissions and API calls:

  • Exposes POST /events/:integration_id.
  • Validates the request Origin or Referer against the integration's whitelist.
  • Checks token bucket rate limits in Redis.
  • Parses JSON or application/x-www-form-urlencoded payloads (up to 10 MB).
  • Saves the raw event to PostgreSQL and immediately enqueues a lightweight message into the Redis Stream events:incoming.
  • Returns an immediate HTTP 202 Accepted to the client in under 5ms.

2. service-worker

The background consumer daemon responsible for outbound notifications:

  • Operates in a Redis Streams consumer group with explicit acknowledgement (XACK).
  • Fetches active channels for the target integration.
  • Concurrently dispatches formatted messages to:
    • Telegram Bot API: Formats keys into markdown messages with escape sanitization.
    • Webhooks: Constructs JSON payloads and signs them using HMAC-SHA256 in the X-Heels-Signature header.
    • Email: Sends notifications via configured SMTP servers or transactional providers (Resend, SendGrid).
  • Records delivery status, response codes, error traces, and round-trip latency in PostgreSQL.

3. service-api

The management REST API powering the developer dashboard:

  • User authentication (JWT tokens, password hashing with Argon2).
  • Project and integration CRUD endpoints.
  • Real-time telemetry, analytics, and event delivery logs.
  • Channel credential testing (e.g. testing Telegram bot connectivity before saving).

4. db-lib & utility-helper

Shared Rust libraries:

  • db-lib: Database connection pooling via SQLx, migrations, and strongly-typed queries.
  • utility-helper: Centralized cryptographic hashing, environment variable loading, and error wrappers.

Monorepo Layout

package.json
content/docs/ (MDX documentation)
Cargo.toml
Dockerfile
Makefile

On this page