Tools and Frameworks Used to Build OmniRoute Services: A Complete Technical Stack Breakdown

OmniRoute combines Next.js 16, React 18, and Tailwind CSS for the frontend with a custom Open-SSE streaming engine, Zod validation, and better-sqlite3 persistence to create a full-stack LLM proxy platform.

The diegosouzapw/OmniRoute repository implements a TypeScript-first architecture that bridges modern web technologies with specialized AI routing protocols. This analysis examines the exact frameworks, libraries, and custom modules that power the application’s runtime, persistence, and protocol layers.

Frontend and API Runtime Layer

The user interface and public API endpoints rely on Next.js 16 with the App Router pattern, React 18 for component rendering, and Tailwind CSS v4 for styling. The entire codebase is authored in TypeScript 6, ensuring type safety across the boundary between client and server code.

All public API routes reside under src/app/api/v1/, following the Next.js convention where each route.ts file exports HTTP method handlers. For example, the chat completions endpoint imports from the core Open-SSE engine:

import { handleChat } from '@/open-sse/handlers/chat';

export const POST = async (req: Request) => {
  const body = await req.json();
  // Zod validation occurs automatically via shared schemas
  return handleChat(body);
};

The styling configuration is centralized in tailwind.config.cjs, which drives the UI appearance across both the web interface and the embedded desktop application.

Core Streaming and Validation Engine

Beneath the Next.js layer lies the Open-SSE workspace—a custom Server-Sent Events engine that handles real-time streaming, provider routing, and combo logic. This engine runs on Node.js 22+ using native ES Modules and enforces strict contract boundaries via Zod v4.

Every incoming request passes through schema validation before reaching the streaming pipeline. In src/shared/validation/schemas/apiV1.ts, the chat completion schema is defined as:

import { z } from 'zod';

export const chatCompletionSchema = z.object({
  model: z.string(),
  messages: z.array(z.object({ role: z.string(), content: z.string() })),
  stream: z.boolean().optional(),
});

The central routing hub in open-sse/handlers/chat.ts coordinates these validated requests, while open-sse/services/combo.ts implements the 17 distinct routing strategies that distribute traffic across multiple providers:

export async function handleComboChat(comboId: string, request: ChatRequest) {
  const targets = resolveComboTargets(comboId);
  for (const t of targets) {
    try { return await handleSingleModel(t, request); }
    catch (e) { continue; }
  }
  throw new Error('All combo targets failed');
}

Data Persistence with SQLite

For durable state, OmniRoute uses better-sqlite3 with Write-Ahead Logging (WAL) mode enabled. The database stores provider catalogs, combo definitions, usage statistics, and compression settings.

Schema evolution is managed through SQL migrations located in db/migrations/. The migration runner at src/lib/db/migrationRunner.ts executes these files in lexical order:

import Database from 'better-sqlite3';

export function runMigrations(db: Database) {
  const files = fs.readdirSync('db/migrations').sort();
  for (const f of files) db.exec(fs.readFileSync(`db/migrations/${f}`, 'utf8'));
}

This approach has tracked 17 base tables plus 110 incremental schema changes as of the current version.

Protocol Servers and Specialized Subsystems

MCP Server

The Model Context Protocol (MCP) server exposes 94 built-in tools via STDIO, SSE, and HTTP transports. Registration occurs in open-sse/mcp-server/server.ts, where tools are organized into scopes:

import { createMcpServer } from './index';

const server = createMcpServer({
  tools: [listCombosTool, getComboMetricsTool, routeRequestTool],
  scopes: ['core', 'combo', 'routing'],
});

export default server;

A2A Server

The Agent-to-Agent (A2A) subsystem in src/lib/a2a/ implements JSON-RPC 2.0 over SSE, enabling autonomous agents to negotiate tasks and exchange skills through a standardized protocol.

Guardrails and Compression

A custom guardrail framework in src/lib/guardrails/ provides PII redaction and prompt-injection protection. The compression pipeline in open-sse/services/compression/ offers both rule-based and heuristic ("caveman") engines for optimizing token usage.

Authentication

Centralized authorization logic lives in src/server/authz/, handling OAuth flows for external providers and enforcing API-key policies with per-request validation.

Desktop Application and Development Tooling

OmniRoute ships as a cross-platform desktop application using Electron 23. The Electron main process in electron/main.ts bootstraps the same Next.js server used in the web deployment, ensuring feature parity between environments.

The testing strategy employs Vitest for unit tests, Playwright for end-to-end browser automation, and the native Node test runner (node --import tsx/esm --test) for integration scenarios. Continuous integration relies on ESLint and Prettier, orchestrated through the npm run check suite that bundles type-checking, linting, and test execution.

Documentation generation is automated via scripts that scan the provider catalog and combo registry, outputting Markdown files when running npm run check:docs-all.

Summary

  • Frontend: Next.js 16, React 18, Tailwind CSS v4, and TypeScript 6 render the UI and API routes in src/app/api/v1/
  • Streaming Core: Open-SSE engine on Node 22+ with Zod v4 validation handles real-time provider routing
  • Persistence: better-sqlite3 with WAL mode and SQL migrations in db/migrations/
  • Protocols: MCP server with 94 tools and A2A JSON-RPC 2.0 server for agent communication
  • Desktop: Electron 23 wrapper in electron/main.ts packages the application for cross-platform distribution
  • Quality: Vitest, Playwright, ESLint, and Prettier maintain code integrity across the TypeScript/ES Module codebase

Frequently Asked Questions

What frontend framework does OmniRoute use?

OmniRoute uses Next.js 16 with the App Router as its primary frontend and API framework, paired with React 18 for component rendering and Tailwind CSS v4 for styling. This configuration is defined in package.json and tailwind.config.cjs, providing both server-side rendering for the UI and API route handlers in src/app/api/v1/.

How does OmniRoute handle database schema changes?

The project uses better-sqlite3 with a custom migration runner located at src/lib/db/migrationRunner.ts. Migration files stored in db/migrations/ are executed in sorted order, enabling the 17 base tables to evolve through 110 incremental schema changes while maintaining data integrity.

What protocols does OmniRoute support for AI agent communication?

OmniRoute implements two primary protocol servers: the MCP (Model Context Protocol) server in open-sse/mcp-server/server.ts exposing 94 tools over STDIO, SSE, and HTTP; and the A2A (Agent-to-Agent) server in src/lib/a2a/ using JSON-RPC 2.0 over SSE to enable inter-agent task negotiation and skill discovery.

How is the desktop version of OmniRoute packaged?

The desktop application is built with Electron 23, where the main process in electron/main.ts embeds the Next.js server. This architecture allows the Electron wrapper to provide native OS integration while reusing the exact same web codebase and API routes used in the hosted version.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →