Introduction

What Reion is, why it exists, and how to get started.

Introduction to Reion

Reion is a backend API framework for building fast, type-safe HTTP services. It gives you file-based routing, a middleware pipeline, validation with Zod, and a CLI so you can go from zero to a running API in minutes.

This documentation covers what Reion is, why it exists, and how to use it.


What is Reion?

Reion is a Node.js and Bun-ready API framework that focuses on:

  • File-based routing — Define routes by placing files in your app directory; no manual router setup.
  • Type-safe request/response — Validate bodies and responses with Zod and get full TypeScript inference.
  • Middleware pipeline — Compose CORS, logging, and custom logic in a clear order.
  • CLI-first workflow — Use reion create, reion dev, reion build, reion start, and reion add for projects and plugins.

You write your handlers and middleware in TypeScript; Reion handles routing, validation, body parsing, and server lifecycle. It runs on both Node.js (with tsx for .ts route files) and Bun natively.


Why Reion?

  • Ship faster — Minimal config, conventional project layout, and a single CLI. No framework lock-in for your HTTP layer; it's just a server and a router.
  • Type safety — Request/response schemas with Zod mean fewer runtime bugs and better editor support.
  • Flexible runtime — Use Node or Bun. Reion stays close to the platform instead of hiding it.
  • Observability — Built-in request logging (Pino), tracing, and structured logging so you can debug and monitor without extra setup.
  • Extensible — Plugins and an event bus let you add cross-cutting behavior without cluttering route handlers.

Whether you're building a small API or a larger service, Reion gives you structure without forcing a specific architecture.


What does Reion provide?

AreaWhat you get
CLIreion create (scaffold), reion dev (hot reload), reion build, reion start, reion add (plugins) — port, host, app directory, templates
RoutingFile-based route loading, radix-tree matching, and a clear route table
MiddlewareResolve, load, and run middleware in order; CORS and custom middleware supported
ValidationZod-based body and response validation with typed context and error handling
BodyParsing for JSON and other payloads
CORSConfigurable CORS headers and preflight handling
PluginsA plugin API to extend the runtime and lifecycle
EventsAn event bus and file-based event handlers for decoupled logic
TracingTrace spans and a trace store for request flow and performance
LoggingPino-based request logging and a configurable base logger

Who is Reion for?

Reion is for developers who want:

  • A lightweight API framework that doesn't dictate your whole stack.
  • TypeScript-first APIs with validation and good DX.
  • Conventions (file-based routes, standard CLI) without magic.
  • The option to run on Node or Bun with minimal changes.

It fits greenfield APIs, internal tools, and services where you care about clarity and control over the HTTP layer.


How do I get started?

  1. Create a project: run npx reion create my-app (or add reion to an existing app and create appDir/router/** yourself — default appDir is often ./src).
  2. Run the dev server: reion dev (default port 3000, configurable with -p and -H).
  3. Add routes as files under your appDir/router/; Reion will load and serve them.
  4. Build for production: reion build, then run with reion start.

The rest of this documentation goes into setup, routing, validation, middleware, and advanced topics.


What you'll find in these docs

  • Get started — Install Reion, scaffold or wire a project, first routes and production build.
  • Development guide — Folder layout, routes, middleware, security, events.
  • Concepts — Request/response, validation, CLI, plugins API, tracing, and more.
  • Plugins — First-party packages such as Cron and Better Auth.

Use the sidebar to jump to a section, or search (⌘K) to find a topic.

Need help?

If something is unclear or you run into issues, check the relevant section in the sidebar or open an issue in the project repository.