Kontyra Docs
Framework•v0.1.0-alpha•Under Active Development

Zenor Framework

An independent, zero-budget, high-performance full-stack web framework built by Kontyra Technologies. Engineered around pure web standards, native Virtual DOM streaming SSR, radix-trie routing, and zero mandatory cloud platform lock-ins.

01. Core Philosophy

Powerful Internally. Simple Externally.

Most modern JavaScript frameworks have grown needlessly complex—forcing developers into paid cloud platforms, proprietary edge runtimes, and convoluted bundling configurations. Zenor returns to foundational web principles:

Pure Web Standards

Built natively on Request, Response, Headers, and ReadableStream primitives. Runs in any compliant runtime.

Zero Third-Party Bundles

Features its own micro Virtual DOM and streaming renderer. No mandatory external framework dependencies.

Radix-Trie File Routing

Predictable file-system discovery with O(k) parameter resolution for static, dynamic, and catch-all routes.

Zero Cloud Lock-In

Free to self-host, deploy as a standalone Node.js daemon, run on bare-metal servers, or run in Docker containers.

02. Monorepo Architecture

The Kontyra Monorepo Packages

Zenor is organized as a modular TypeScript monorepo where each layer is strictly decoupled:

PackageVersionRole & Capability
@kontyra/core0.1.0Canonical types, config schemas (defineConfig), and human diagnostic logs.
@kontyra/router0.1.0Radix-tree router with param extraction (:id) and wildcard catch-all matching.
@kontyra/renderer0.1.0Native h() Virtual DOM node creation, renderToString(), and streaming SSR.
@kontyra/runtime0.1.0Web Standard execution pipeline, middleware chains, and security header enforcement.
@kontyra/runtime-node0.1.0High-performance Node.js HTTP/HTTPS server bridge with full duplex stream support.
@kontyra/server0.1.0File-system route scanner, multipart body parser, and HTTP helpers (json, redirect).
@kontyra/database0.1.0Pluggable database interface with in-memory store and adapters for SQLite and PostgreSQL.
@kontyra/cli0.1.0Developer CLI engine powering zenor dev, zenor build, and zenor doctor.
create-zenor0.1.0Zero-configuration project scaffolding CLI.
03. Getting Started

Scaffold a New Zenor App in 5 Seconds

Run the official project generator via npx:

bash
# 1. Scaffold a fresh Zenor project
npx create-zenor my-app

# 2. Enter workspace
cd my-app

# 3. Start high-speed local dev server
npm run dev

Project Directory Layout

text
my-app/
├── public/               # Static public assets (favicon, images, robots.txt)
├── routes/
│   ├── index.js          # Home page (SSR HTML / Native Virtual DOM)
│   ├── about.js          # Static page (/about)
│   ├── users/
│   │   └── [id].js       # Dynamic parameterized route (/users/:id)
│   └── api/
│       ├── hello.js      # JSON API endpoint (/api/hello)
│       └── todos.js      # In-memory database CRUD API (/api/todos)
└── package.json
04. Routing Engine

Radix-Trie File System Routing

Zenor maps files inside the routes/ folder directly to HTTP routes using a radix-tree index:

  • • routes/index.js $\rightarrow$ GET /
  • • routes/posts/[slug].js $\rightarrow$ GET /posts/:slug (accessed via ctx.params.slug)
  • • routes/docs/[...catchall].js $\rightarrow$ GET /docs/* (wildcard catch-all match)
  • • routes/api/auth.js $\rightarrow$ ANY /api/auth (method-specific handlers)
05. Native Component Renderer

Lightweight Streaming Virtual DOM

Pages export a default component rendered via Zenor's native hyperscript function h():

javascript
import { h } from '@kontyra/renderer';

export default function UserProfilePage(ctx) {
  const { id } = ctx.params;

  return h('div', { class: 'container mx-auto py-12' },
    h('h1', { class: 'text-3xl font-bold text-white' }, `User Profile #${id}`),
    h('p', { class: 'text-gray-400' }, 'Rendered server-side with native Zenor VDOM streaming.'),
    h('ul', { class: 'mt-4 space-y-2' },
      h('li', null, '• Native streaming to HTTP socket'),
      h('li', null, '• Zero external bundle dependencies')
    )
  );
}
06. API Route Handlers

Web-Standard API Endpoints

API routes return standard Web API Response objects with typed bodies and custom status codes:

javascript
// routes/api/status.js
export function server(ctx, req) {
  return new Response(
    JSON.stringify({
      status: 'operational',
      framework: 'Zenor by Kontyra',
      timestamp: new Date().toISOString(),
      uptime: process.uptime(),
    }),
    {
      status: 200,
      headers: { 'Content-Type': 'application/json' },
    }
  );
}
07. Pluggable Database

Universal Database Interface (@kontyra/database)

Zenor ships with an embedded in-memory memory driver for zero-setup prototyping, which seamlessly transitions to SQLite or PostgreSQL without modifying your application queries:

javascript
import { getDatabase } from '@kontyra/database';

const db = getDatabase(); // In-memory by default, or configured via zenor.config.js

export async function server(ctx, req) {
  if (req.method === 'POST') {
    const body = await req.json();
    const item = await db.collection('tasks').insert(body);
    return Response.json(item, { status: 201 });
  }

  const items = await db.collection('tasks').find();
  return Response.json(items);
}
08. Zenor CLI Tooling

Integrated Command-Line Suite

The zenor CLI provides developer diagnostics and lifecycle controls:

$ zenor dev
Starts development server with live watch and route re-indexing.
$ zenor build
Compiles production assets and optimizes static assets.
$ zenor start
Boots high-performance Node.js production server daemon.
$ zenor doctor
Performs deep workspace health check, type validations, and port scans.
$ zenor routes
Displays full terminal ASCII tree of all registered HTTP route endpoints.