CodexaCodexa

Introduction

A modular, plugin-first toolkit for building Deno backends, with an HTTP layer that also runs on Bun, Cloudflare Workers, and Node.js.

Codexa Core targets Deno as its primary runtime, but keeps its HTTP layer runtime neutral by design. Every request handler is a plain function that accepts a standard Request and returns a standard Response. This is what lets the same application run on Bun and Cloudflare Workers unchanged, and on Node.js with a small Fetch API adapter.

Instead of one large bundle, the framework ships as small, focused packages. A project imports only the parts it needs:

  • An HTTP layer built on a radix tree router
  • An OpenAPI 3.1 generator
  • A typed frontend SDK generator powered by OpenAPI route metadata
  • Environment and database configuration
  • An event bus
  • A key value store
  • A cache
  • A storage manager for local disk, S3, Cloudinary, and ImageKit
  • A command line tool, installed and used separately, for pulling plugin source from a Git repository

Plugin first

Every capability in Codexa Core, from a single health check route to a full authentication system, is built as a plugin. A plugin owns its routes, middleware, version header, and lifecycle hooks. It exposes services to other plugins only when it explicitly chooses to.

import { createApp, definePlugin } from '@codexa/core/http';

const healthPlugin = definePlugin({
  name: 'health',
  setup(scope) {
    scope.route({
      method: 'GET',
      path: '/health',
      handler: (ctx) => ctx.json({ ok: true }),
      options: { name: 'health.check', tags: ['public', 'health'] },
    });
  },
});

const app = createApp('api').install(healthPlugin);

Deno.serve(app.dispatch);

Another plugin can only reach health if it lists health in dependsOn, and only through whatever health exposes with exposeService. This ownership model keeps a large application predictable as more plugins are added.

See Plugins for the full plugin shape, and Typed Config & Services for how one plugin exposes a typed service to another.

Runs wherever the Fetch API runs

This portability comes from app.dispatch, the single function every runtime hands a request to. Pass it directly to whichever server or platform you deploy to.

Deno.serve(app.dispatch);

dispatch also works without a server. Call await app.dispatch(new Request('http://localhost/health')) directly inside a test, a background job, or another framework's route handler.

JSR's own compatibility check confirms this for Node.js, Deno, Bun, and browsers. Cloudflare Workers support is demonstrated in the framework's source, though JSR has not yet run its automated check for that platform.

Subpath imports

Each capability below is its own subpath, so a project that only needs the HTTP layer never loads the MongoDB driver or the Redis client.

ImportPurpose
@codexa/core/httpPlugin first HTTP framework, built on the Fetch API and a radix tree router
@codexa/core/openapiOpenAPI 3.1 document generator, built from route metadata
@codexa/core/sdkFrontend SDK generator, built from the same OpenAPI route metadata
@codexa/core/configEnvironment variables, MongoDB, Redis, and storage configuration
@codexa/core/busLocal or Redis backed event bus
@codexa/core/storeMemory, Redis, or Deno KV key value store
@codexa/core/cacheNamespaced cache built on top of a store
@codexa/core/storageLocal disk, S3, Cloudinary, and ImageKit storage manager
@codexa/core/providersRe-exported third party packages Codexa Core depends on
@codexa/core/loggerStructured logger
@codexa/core/cryptoID generation and password hashing
@codexa/core/hashSHA and HMAC helpers
@codexa/core/deviceUser agent parsing
@codexa/core/ttlDuration string parsing, such as turning '15m' into seconds
@codexa/core/responseStandard response payload builders
@codexa/core/queryQuery string parsing
@codexa/core/cliThe codexa plugin and codexa sdk commands, for installing plugins and generating SDK packages

Where the code lives

Codexa Core is published on JSR as @codexa/core, currently at version 1.0.5 with a JSR score of 100 percent. The source lives on GitHub at Codexa-by-HQ/codexa-core, under the MIT license.

On this page