[**Documentation**](../../../README)

***

[Documentation](../../../README) / [@zerotal/core](../README) / index

# index

The Zerotal kernel — the IoC container, application lifecycle, HTTP router and
pipeline, service providers, events, facades, and the common request helpers
that every Zerotal app builds on.

`@zerotal/core` is the one package every app depends on. This root entry
carries only the hot, cheap kernel used across the framework — `Application`,
the [Container](classes/Container), [HttpContext](classes/HttpContext), the [Router](variables/Router), middleware,
providers, [events](classes/Emitter), facades, and helpers. Heavier or cohesive
subsystems live behind explicit subpaths so importing the kernel never drags
them in:

| Subpath | What it provides |
| --- | --- |
| `@zerotal/core/contracts` | Interface-only seams packages implement and the kernel consumes (session, transaction, authenticatable user) |
| `@zerotal/core/carbon` | Date/time via Carbon (pulls the Temporal polyfill) |
| `@zerotal/core/http` | Outbound HTTP client, URL building, uploads, API resources, content negotiation |
| `@zerotal/core/view` | Server-side JSX runtime + authoring helpers |
| `@zerotal/core/env` | Typed environment-variable schema |
| `@zerotal/core/config` | Config manager/loader + app config shapes |
| `@zerotal/core/security` | `Crypt` + `Hash` |
| `@zerotal/core/logger` | Structured logging (`Log`, channels) |
| `@zerotal/core/lock` | Distributed locks |
| `@zerotal/core/commands` | Built-in CLI commands |
| `@zerotal/core/dev` | Dev-only build/reload tooling (owns `Bun.build`) |
| `@zerotal/core/assets` | Asset URL helper + versioning |
| `@zerotal/core/health` | Health checks |
| `@zerotal/core/metrics` | HTTP request metrics |

## Examples

**Bootstrap an application**

```ts
// bootstrap/app.ts
import { Application } from "@zerotal/core";
import providers from "./providers.ts";

const app = Application.create({ providers, env: "web" });
await app.start();
```

**Define routes and a controller**

```ts
import { Router } from "@zerotal/core";

Router.get("/", (ctx) => ctx.html("<h1>Hello</h1>"));
Router.get("/users/{id}", (ctx) => ctx.json({ id: ctx.params.id }));
```

## Remarks

Zerotal runs on **Bun ≥ 1.1** — Node.js is not supported. The framework uses
`Bun.sql`, `Bun.CryptoHasher`, `Bun.build`, and other Bun-native APIs
throughout.

## Application lifecycle

- [AppBooted](classes/AppBooted)

## Console

- [CommandRan](classes/CommandRan)

## Contracts

- [AuthenticatedUser](interfaces/AuthenticatedUser)

## Extension registries

- [ContextRegistry](interfaces/ContextRegistry)

## HTTP

- [RequestHandled](classes/RequestHandled)
- [OutgoingRequestCompleted](classes/OutgoingRequestCompleted)
- [RequestFailed](classes/RequestFailed)
- [MiddlewareSkipped](classes/MiddlewareSkipped)

## Naming & URLs

- [route](functions/route)

## Other

### env

Re-exports [env](../helpers/functions/env)

***

### requireEnv

Re-exports [requireEnv](../helpers/functions/requireEnv)

***

### setAppEnv

Re-exports [setAppEnv](../helpers/functions/setAppEnv)

***

### basePath

Re-exports [basePath](../helpers/functions/basePath)

***

### tap

Re-exports [tap](../helpers/functions/tap)

***

### tapAsync

Re-exports [tapAsync](../helpers/functions/tapAsync)

***

### pipe

Re-exports [pipe](../helpers/functions/pipe)

***

### pipeAsync

Re-exports [pipeAsync](../helpers/functions/pipeAsync)

***

### rescue

Re-exports [rescue](../helpers/functions/rescue)

***

### rescueSync

Re-exports [rescueSync](../helpers/functions/rescueSync)

***

### data\_get

Re-exports [data_get](../helpers/functions/data_get)

***

### FileRouteHandler

Renames and re-exports [FileHandler](type-aliases/FileHandler)
