Skip to content

What is Xeno.JS?

Xeno.JS is an application architecture framework for TypeScript.

It helps you structure applications around explicit boundaries between application logic, domain logic, dependencies, and infrastructure.

Xeno.JS is not an HTTP framework and does not replace the framework you use to expose your application.

Your HTTP framework handles HTTP. Xeno.JS handles the application.

You can use Xeno.JS with the transport, UI framework, or runtime that fits your application.


As a TypeScript application grows, more responsibilities start to accumulate:

  • business rules
  • use cases
  • database access
  • external services
  • authentication and authorization
  • validation
  • background jobs
  • caching
  • logging
  • HTTP or other transports

Without clear architectural boundaries, these responsibilities tend to become increasingly coupled.

Controllers start containing business logic. Domain logic starts depending on infrastructure. Dependencies become difficult to understand. Changing one part of the system can require changes across unrelated parts.

The problem is not TypeScript itself.

The problem is that the application architecture is often implicit.

Xeno.JS makes that architecture explicit in code.


Xeno.JS sits at the application layer rather than at the transport layer.

A simplified view is:

┌─────────────────────────────┐
│ HTTP / CLI / Worker / UI │
├─────────────────────────────┤
│ Presentation │
├─────────────────────────────┤
│ Xeno.JS Application Layer │
│ │
│ Commands / Queries │
│ Application Services │
│ Pipelines │
│ Dependency Injection │
│ Request Context │
├─────────────────────────────┤
│ Domain │
├─────────────────────────────┤
│ Infrastructure │
└─────────────────────────────┘

The transport is responsible for receiving and returning data.

The application layer is responsible for executing application use cases.

The domain contains business rules.

Infrastructure provides the concrete implementations required by the application.

Xeno.JS provides the architectural primitives that connect these layers while keeping their boundaries explicit.


Xeno.JS brings together several application-level building blocks that are commonly assembled separately in TypeScript projects.

These include:

  • explicit dependency injection
  • application scopes and dependency lifetimes
  • commands and queries
  • execution pipelines
  • request context
  • application and domain contracts
  • modular application composition

The goal is not simply to provide more utilities.

The goal is to give these pieces a coherent application architecture.


Xeno.JS does not require your application to adopt a specific HTTP framework.

You can keep the transport layer that already fits your system and use Xeno.JS underneath it.

For example:

Fastify ──┐
Express ──┤
Hono ─────┼──> Xeno.JS application
CLI ──────┤
Worker ───┘

This separation allows the application architecture to remain independent from the way a request enters the system.

The same principle can also be applied on the frontend through the Xeno.JS ecosystem.


A framework for the application, not just the transport

Section titled “A framework for the application, not just the transport”

Traditional TypeScript frameworks often start from the transport:

Request
↓
Controller
↓
Service
↓
Database

Xeno.JS starts from the application instead:

Transport
↓
Application Use Case
↓
Domain
↓
Infrastructure

The distinction is important.

An HTTP framework answers questions such as:

How do I receive an HTTP request?

Xeno.JS focuses on questions such as:

How is this application use case executed? Which dependencies does it require? Which boundaries should it cross? Which cross-cutting behaviors should run around it? How can the application remain independent from its transport?


Xeno.JS is particularly relevant when an application has meaningful business logic and its architecture needs to remain understandable as the system grows.

It can be useful when you want:

  • explicit application boundaries
  • explicit dependencies instead of hidden framework behavior
  • a consistent model for commands and queries
  • clear separation between domain and infrastructure
  • reusable application logic across different transports
  • an architecture that can evolve without coupling everything to a single framework

For a small application with very little business logic, introducing an application architecture framework may not be necessary.

Xeno.JS is designed for applications where architecture itself becomes an important part of the problem.


Xeno.JS is built around a simple idea:

Make application architecture explicit in code.

Instead of allowing application boundaries to emerge implicitly as the codebase grows, Xeno.JS provides explicit primitives for defining those boundaries from the beginning.

The next pages explain the reasoning behind this approach and how the architecture is structured.


Xeno.JS is an MIT-licensed open source project. It can grow thanks to the support of these awesome people. If you’d like to join them, please read more at support section