> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hoox.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Internal Endpoints Map

> Architectural routing flow and service-binding topology for the Hoox microservice mesh, with the canonical endpoint directory living under the API reference.

> **This document is now a stub focused on the routing flow. For complete endpoint specifications, see [`/docs/devops/api/endpoints`](../api/endpoints).**

This page captures the **architectural context** for routing across the Hoox microservice monorepo — the Mermaid routing diagram, the internal-auth header contract, and the request-trace propagation story. The exhaustive endpoint directory (per-worker route tables, JSON payloads, and success-response examples) lives in the canonical reference.

***

## 🏗️ Interactive Compute & Routing Flow

All external webhooks flow through the public `hoox` gateway, which authenticates payloads and routes them to private workers inside localized V8 engine isolates:

```mermaid theme={null}
graph TD
    %% Ingress
    Client[TradingView / User] -->|1. Public HTTPS Ingress| GW[hoox Gateway]

    %% Gateway Service Bindings
    GW -->|2. Service Binding| TW[trade-worker]
    GW -->|2. Service Binding| TGW[telegram-worker]
    GW -->|2. Async Failover Queue| Q[trade-execution Queue]

    %% Internal Workers Services
    TW -->|3. Service Binding| D1W[d1-worker]
    TW -->|3. Service Binding| W3[web3-wallet-worker]
    TGW -.->|RAG Queries| VEC[(Vectorize Index)]
    Q -->|4. Async Consumer| TW
    D1W -.->|SQLite read/write| DB[(D1 Database)]
```

***

## 🔐 Internal Authorization Contract

Every internal HTTP request between V8 isolates **must** transmit the standard bearer header:

```http theme={null}
X-Internal-Auth-Key: <INTERNAL_KEY_BINDING>
```

This shared secret is provisioned per-worker as an encrypted `wrangler secret` and validated by the `requireInternalAuth` middleware from `@jango-blockchained/hoox-shared/middleware`. Public webhook and dashboard endpoints use payload-embedded API keys or session cookies instead — see the canonical [`/docs/devops/api/endpoints`](../api/endpoints) for the full auth matrix.

***

## 🛰️ Request-Trace Propagation

<Tip>
  Every internal-to-internal transaction automatically inherits the `requestId`
  trace UUID generated by the gateway. This trace ID is attached as the
  `X-Request-Id` header, allowing you to trace a single webhook alert across D1
  database writes, R2 log outputs, and Telegram alerts instantly!
</Tip>

***

### 🔗 Next Steps

* **[Complete API Reference](../api/endpoints)** — The canonical endpoint directory with full request/response examples for every worker.
* **[Service Binding Mesh](communication)** — Deep dive into the Zero-Trust service-binding topology and the public/internal isolation boundary.
* **[System Storage Architecture](storage)** — Review R2 log offloading, D1 SQLite ledger layout, and Vectorize RAG indexes.
