Skip to content

Introduction ​

What Smite is, the problem it solves, and the ideas the rest of this guide builds on.

Smite is a compile-time-first application framework for TypeScript. You describe your application as plain values: an app, its routers, their zod-validated inputs and the handlers that answer them. Smite compiles that description into everything around it (a server, a typed client, an OpenAPI document, serverless handlers) and ships only a small, tree-shakeable runtime.

Philosophy ​

Most Node frameworks discover your application at runtime: decorators run, a container wires providers, routes are registered as the process boots. Everything the framework knows lives in memory, so every tool that wants that knowledge (a client generator, a docs generator, a deploy step) has to boot the app or parse your source.

Smite inverts that. The DSL records what you declare into a semantic graph (the IR) while a build runs. Generators read that graph instead of your source, so their output reflects exactly what the app declared. At runtime the same declarations execute without the graph: the code that builds it is guarded by a compile-time constant and removed from production bundles.

three rules the whole framework follows

  1. Describe, don't wire. Routes, inputs and handlers are values. There are no classes to extend and no decorators to remember.
  2. One schema, every consumer. A zod schema drives runtime validation, the handler's types, the typed client and the OpenAPI document.
  3. Build time is not runtime. Collection happens only under ALLOW_GLOBAL_REGISTRY; executors walk the graph by child references and never touch the registry.

What you get ​

concernhow Smite handles it
HTTP routinghttp.app() and http.router() build an app; serve(app) turns it into a handler
validationper-bucket zod schemas (params, query, headers, body); failures answer 400
cross-cutting logicaspects: middleware, interceptors, guards and response filters
typed clientsthe client() plugin emits a builder-style client from the compiled app
API documentationthe openapi() plugin writes OpenAPI 3.1; swaggerUi serves it
configuration@smitejs/env declares and validates environment variables
domain modelling@smitejs/domain: value objects, entities, specifications, ports, usecases, CQRS
deploymentnode:http locally, AWS Lambda through lambdaify

How to read this guide ​

The guide is ordered: each page assumes the ones before it.

  • Introduction: install Smite, configure the CLI, and see how compile time and runtime fit together.
  • Fundamentals: apps, routes, endpoints, validation, responses, extractors, aspects and serving. Read these in order.
  • Techniques: environment variables, scoped context, logging, OpenAPI, typed clients and AWS, as you need them.
  • Domain-driven design and Functional primitives: the optional toolkits for modelling business logic.
  • Recipes: complete, runnable applications.
  • Internals: how the registrar and the IR work, for contributors and plugin authors.

Every code sample in these docs is a tested snippet: it is extracted from a test file at build time, and the build fails if a snippet goes missing. The link under each sample points at the test that runs it.

Requirements ​

  • Node.js 24 (lts/krypton) or newer
  • TypeScript 5.5+ with moduleResolution: NodeNext
  • zod for schemas

Ready? Continue with First steps.

Released under the MIT License.

/ search•[ ] prev/next•j/k scroll•h home•t theme•guide/introduction