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

# Architecture

> How Hile packages compose across lifecycle, HTTP, models, microservices, and Redis primitives.

# Architecture

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

## Project Startup And Lifecycle

Read `packages/core-lifecycle.md` 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 `packages/http.md` when the task mentions:

* REST endpoints
* Koa middleware
* controllers
* Zod validation
* response formatting
* file-system routes

Packages: `@hile/http`, `@hile/loader`.

## Business Logic And Context

Read `packages/model-context.md` 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 `packages/messaging-micro.md` when the task mentions:

* WebSocket/IPC/worker messaging
* `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-dynamic-configs`, `@hile/reloader`.

## Redis Reliability

Read `packages/redis-reliability.md` 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.
