Skip to main content

Architecture

Hile is intentionally split into small packages. Choose only the package that owns the boundary you are implementing.

Project Startup And Lifecycle

Read Core lifecycle when the task mentions:
  • service container
  • boot files
  • startup/shutdown
  • auto-loaded services
  • hile start
  • graceful exit
Packages: @hile/core, @hile/bootstrap, @hile/cli, @hile/logger, @hile/ioredis, @hile/typeorm.

HTTP APIs

Read HTTP API when the task mentions:
  • REST endpoints
  • Koa middleware
  • controllers
  • Zod validation
  • response formatting
  • file-system routes
Packages: @hile/http, @hile/loader. For an HTTP gateway that delegates to a Micro service, also read HTTP over Micro. The gateway keeps the public listener and policy; the package preserves the selected HTTP semantics across Micro.

Business Logic And Context

Read Model and context when the task mentions:
  • reusable domain logic
  • pipeline middleware
  • request/work-unit context
  • logger context bindings
  • context propagation into micro calls or queue jobs
Packages: @hile/model, @hile/context.

Messaging And Microservices

Read Messaging and Micro when the task mentions:
  • WebSocket/IPC/worker messaging
  • defineMicroMessage or transport-neutral defineMessage
  • service registry
  • Application.call
  • streaming RPC
  • pub/sub topics
Packages: @hile/message-modem, @hile/message-ws, @hile/message-ipc, @hile/message-worker-thread, @hile/message-loader, @hile/micro, @hile/micro-contract, @hile/http-over-micro, @hile/micro-dynamic-configs, @hile/reloader. Read Typed Micro contracts for defineMicroContract, createMicroClient, typed defineMicroMessage(operation, handler), loadMicroContract, explicit local execution, activation, and draining. The contract keeps explicit fixed paths checked against filesystem routes; it does not generate routes, publish a runtime catalog, or replace native dynamic/streaming interfaces.

Redis Reliability

Read Redis reliability when the task mentions:
  • distributed locks
  • idempotency
  • rate limits
  • durable queues
  • retries
  • DLQ
  • singleflight
Packages: @hile/redis-lock, @hile/redis-idempotency, @hile/redis-rate-limit, @hile/redis-stream-queue.

Boundary Rule

Use @hile/model for reusable business behavior, @hile/http or @hile/http-next for request boundaries, @hile/micro for RPC, and @hile/redis-stream-queue for durable background work.