🗺️ High-Level System Architecture
The ecosystem splits public-facing ingress points from private internal compute layers:📊 Comprehensive Micro-Worker Catalog
🛡️ The 5-Layer Security Architecture
Security is designed as concentric protective corridors:Layer 1: Edge-Level Firewall & WAF
Cloudflare’s global WAF drop connections immediately at the edge if:- The payload does not originate from verified TradingView webhook IP ranges.
- The request rate exceeds threshold ceilings (10 requests/minute).
Layer 2: Webhook Passkey Authentication
Thehoox gateway validates that the payload apiKey string exactly matches the encrypted webhooks:api_key stored inside your CONFIG_KV namespace. Mismatched signals are instantly dropped with a 401 Unauthorized response.
Layer 3: Service Binding Encrypted Isolation
Internal workers (trade-worker, d1-worker, agent-worker) expose zero public HTTP endpoints. They cannot be targeted or accessed from the public internet. They can only be invoked internally by other V8 isolates using Cloudflare Service Bindings.
Layer 4: Standardized Internal Authorization
To prevent internal bypass or privilege escalation, all internal microservice boundaries enforce a strict bearer authorization check:- All internal workers (
hoox,trade-worker,d1-worker,agent-worker,telegram-worker) are bound to the sameINTERNAL_KEY_BINDINGsecret. - Every service-to-service invocation is audited by the shared
requireInternalAuthmiddleware from@jango-blockchained/hoox-shared/middleware, dropping unauthorized calls.
Layer 5: Durable Object Idempotency Locks
If the network drops after an order fill, TradingView will resend the webhook. The gateway uses a single-threaded Durable Object to lock the request trace ID. If the transaction ID has already been logged, the duplicate is dropped before hitting exchange APIs, preventing double-ordering.📊 Codebase Dependency Graph
Hoox ships with an automated function-level dependency graph extractor that maps every exported symbol, import, call, type reference, and service binding across all 917 source files and 14 workspaces.Generating the Graph
scripts/extract-graph.ts (powered by ts-morph) and scans 917 source files across all 14 workspaces in ~20–25s.
During extraction, an 8-phase live progress bar reports each stage with timing:
Node Types & Color Coding (DOT)
Entry points (top-level workspace exports) are highlighted with double borders.
Edge Color Legend
Rendering to SVG
Key Extraction Rules
- Export-only nodes: Only exported symbols appear in the graph (684 unexported symbols filtered out).
- Call edge fallback: Method calls like
router.postresolve via TypeChecker; when the symbol name (post) doesn’t match a top-level export, the edge falls back to the target file’s first container node. - Self-reference filtering: Calls within the same file are excluded.
- Deduplication: Duplicate edges are collapsed into a single entry.
- Service bindings: Parsed from each worker’s
wrangler.jsoncconfiguration.
🔗 Next Steps
- Worker Communication Specifications — Deep dive into service bindings, zero-TCP routing, and V8 engines.
- Data Flow Maps — Step-by-step sequence charts of trade executions and cron risk evaluations.
- Codebase Dependency Graph — Generate a live architecture map of all exports, calls, and bindings.
docs/enterprise/architecture.mdxdocs/enterprise/multi-tenancy.mdxdocs/enterprise/observability-audit.mdxdocs/enterprise/security-compliance.mdx
OPEN_CORE.md and OPEN_CORE_FEATURE_SPLIT.md.
These build directly on the current retail architecture while unlocking Cloudflare Enterprise features and 2025-2026 primitives.