English
Application
This guide covers what the core does and how an application starts:
- What the core actually does
- Minimal bootstrap
- Runtime modes
- Routing and middleware
- Core surface exports
- Module integration
- Production checklist
- Known current limits
- Useful links
- Recommended path
- Positioning
- Application mode
- Minimal bootstrap
- Modes
- Key points
Ream (@c9up/ream) is the framework core: app bootstrap, IoC, providers, HTTP server, middleware pipeline, error handling, lifecycle, and module orchestration (atlas, rune, warden, spectrum, etc.).
Status: actively evolving. The target is a batteries-included, convention-first DX with agnostic modular architecture.
What the core actually does
- Boots and configures the app through
Ignitor. - Loads config and providers.
- Wires router, HTTP kernel, and server.
- Runs lifecycle (
register -> boot -> start -> ready -> shutdown). - Exposes framework primitives (container, middleware, exceptions, services).
Minimal bootstrap
ts
import { Ignitor } from '@c9up/ream'
await new Ignitor({ port: 3333 })
.httpServer()
.routes((router) => {
router.get('/health', (ctx) => {
ctx.response.status(200).json({ ok: true })
})
})
.start()Runtime modes
httpServer()for web/API.console()for CLI commands.testMode()for testing scenarios.
ts
const ignitor = new Ignitor({ port: 3333 }).httpServer()
await ignitor.start()Routing and middleware
ts
await new Ignitor()
.httpServer()
.use(async (ctx, next) => {
const start = Date.now()
await next()
ctx.response.header('x-duration-ms', String(Date.now() - start))
})
.routes((router) => {
router.get('/users/:id', async (ctx) => {
ctx.response.json({ id: ctx.params.id })
})
})
.start()Recommended pipeline order:
- technical middleware (request-id, timing, body parser),
- security middleware (cors, headers, rate limit, shield),
- auth/acl middleware,
- business route/controller logic.
Core surface exports
Core exports include:
Ignitor,Application,Provider,Router,Server,HttpContext,Request,Response,MiddlewareRegistry,errors, oneExceptionclass per code, and the HTTP exception handler,- lifecycle utilities (
HealthCheck, graceful shutdown, hot reload).
Module integration
The core is the orchestrator. Modules remain standalone, but Ream simplifies composition:
atlasORM,- the event bus (core),
wardenauth,runevalidation,spectrumlogging,echocache,bayqueue/jobs.
Production checklist
- set
NODE_ENV=production. - enable security middleware (configured shield/rate limit/cors).
- centralize exception handling with safe output.
- verify graceful shutdown behavior (SIGTERM/SIGINT).
- enforce explicit timeouts (DB, outbound HTTP, jobs).
- include correlation IDs in logs/errors.
- expose health/readiness endpoints.
Known current limits
- API surface is still evolving,
- some documentation areas are still catching up,
- conventions are still being tightened.
Useful links
- Lifecycle guide:
/en/guides/concepts/lifecycle - Providers guide:
/en/guides/concepts/providers - Routing guide:
/en/guides/basics/routing - Middleware guide:
/en/guides/basics/middleware
This section documents @c9up/ream as a practical reference.
Recommended path
- Ignitor and bootstrap
- Application lifecycle
- IoC container
- HTTP kernel and routing
- Errors and exception handling
- Security and operations
Positioning
- Ream orchestrates agnostic modules.
- The core defines framework conventions (providers, lifecycle, middleware).
- Surface is still evolving toward a batteries-included, convention-first DX.
Application mode
ts
async start() {
if (this.app.getMode() !== 'run') return
await startQueueWorkers()
}getMode() is run or warmup. A codegen or listing command sets warmup, so a provider can skip its side effects — starting workers, opening a connection — while still registering every binding. It must never change which bindings exist: the app being inspected has to match the app that runs, or the generated types describe something else. setMode() refuses after boot.
Ignitor is the core entry point: it configures and starts the application.
Minimal bootstrap
ts
import { Ignitor } from '@c9up/ream'
await new Ignitor({ port: 3333 })
.httpServer()
.routes((router) => {
router.get('/health', (ctx) => ctx.response.json({ ok: true }))
})
.start()Modes
httpServer()for web/APIconsole()for commandstestMode()for test scenarios
Key points
useRcFile()to load framework configprovider()for inline providersuse()/named()for global/named middlewareonError()for cross-cutting error handling