Axeom vs. tRPC
Comparing E2E type safety architectures.
tRPC and Axeom both aim to solve the problem of type safety between the server and the frontend without relying on code generation. However, Axeom does this while remaining a standard, high-performance HTTP engine—eliminating the need for proprietary protocols.
Routing & Protocol
tRPC is a protocol layer that hides HTTP. Axeom is an HTTP engine that embraces it.
import from '@axeom/framework';
const = new ();
// Standard REST API
.('/user', () => {
return { : 1 };
});
import { } from '@trpc/server';
const = .create();
// Proprietary Procedure
const = .router({
: .procedure.query(() => {
return { : 1 };
})
});Validation & Type Safety
tRPC requires Zod. Axeom uses its native s schema, which is lighter and more integrated into the engine registry.
import , { } from '@axeom/framework';
const = new ();
// Native Registry Inference
.('/auth', ({ }) => {
return ; // Typed
}, {
: .({ : .() })
});
import { } from '@trpc/server';
import { } from 'zod';
const = .create();
// Proxy-based inference
const = .router({
: .procedure
.input(.object({ : .string() }))
.mutation(({ }) => )
});Lifecycle (Context)
tRPC's context is built through middleware layers. Axeom uses a Flattened Hook System (onRequest, onResponse) and .derive().
import from '@axeom/framework';
const = new ();
// Direct Hook/Derive patterns
.(() => ({ : "@axeom/framework" }))
.(() => {
.(..);
});
import { } from '@trpc/server';
const = .create();
// Procedure Middleware
const = .procedure.use(({ , }) => {
return ({ : { : '@axeom/framework' } });
});Encapsulation (Modules)
Axeom groups its logic into paths via the fluent API. tRPC groups its logic into nested router objects.
import from '@axeom/framework';
const = new ();
// Path-based grouping
.('/v1', () => {
.('/ping', () => "pong");
});
import { } from '@trpc/server';
const = .create();
// Object-based nesting
const = .router({
: .procedure.query(() => "pong")
});OpenAPI & Documentation
Axeom provides native Swagger support via a plugin. tRPC requires specialized libraries like trpc-openapi and explicit metadata for every route to escape its proprietary format.
import from '@axeom/framework';
import { } from "@axeom/swagger";
const = new ();
// Native Swagger Plugin
.(());
import { } from '@trpc/server';
const = .create();
// Requires trpc-openapi
.procedure
.meta({ : { : 'GET', : '/ping' } })
.input(z.void())
.output(z.string())
.query(() => "pong");Error Handling
tRPC mappings errors to TRPCError codes. Axeom uses standard HTTP statuses or rejections.
import from '@axeom/framework';
const = new ();
// Standard Rejections
.('/err', () => {
throw new ("Failure");
});
import { } from '@trpc/server';
// Proprietary TRPCError
throw new ({
: 'NOT_FOUND',
: '...'
});Beyond E2E Safety
tRPC is restricted to procedure calls. Axeom is a full-scale web engine with plugins for WebSockets, SSE, and more.
import from '@axeom/framework';
import { } from '@axeom/ws';
const = new ();
// WS, SSE, Plugins
.(());
// Procedure calls onlySummary: Why Axeom Wins
| Feature | tRPC | Axeom |
|---|---|---|
| API Format | Proprietary Procedure | Standard REST / HTTP |
| Consumption | TS Client Only (mostly) | Universal (Any HTTP Client) |
| Dependency | Requires TypeBox/Zod | Zero-Dependency Core |
| Extensibility | Limited to Procedures | Unlimited via Plugins |
| Performance | High Overhead (Proxy logic) | Ultra-Fast (Radix Router) |
| OpenAPI | Requires Complex Bridges | Native Plugin Support |