Indestructible. Lightning Fast.
The batteries-included TypeScript backend framework built on Bun. Zero external dependencies. No over-engineering.
Software engineering got too complicated. We're fixing that.
Express needs 50+ packages for production. Vajra ships everything built-in. JWT, CORS, rate limiting, validation, SSR, WebSocket, AI. Zero external dependencies for core.
Tired of npm update breaking your app? Vajra controls every feature. No third-party package can break your build. Update once, everything works.
Next.js has 4 caching layers. React has "use client", "use server". Vajra keeps it simple. Server renders by default. Islands for interactivity. No magic directives.
Built for Bun from day one. 100K+ requests/sec. Single binary deployment. Cold start under 50ms. 5x faster than Express without trying.
import { Vajra, logger, helmet, cors } from 'vajrajs';
const app = new Vajra();
app.use(logger());
app.use(helmet());
app.use(cors({ origin: '*' }));
app.get('/', (c) => c.json({ hello: 'vajra' }));
app.get('/users/:id', (c) => {
return c.json({ id: c.params.id });
});
app.listen(3000);
// Vajra running on http://localhost:3000
Everything you need for production. Built-in. Not bolted on.
Router (100M ops/sec), Context, Middleware, Zod Validation, Static Files, Cookies, JWT, WebSocket, SSE
Helmet, CSRF Protection, IP Filter (CIDR), Input Sanitization (XSS/SQLi/NoSQLi), HMAC Verification, BOLA Guard
Health Probes (K8s ready), Circuit Breaker, RBAC with Role Hierarchy, W3C Distributed Tracing
Multi-provider LLM (Claude, GPT, Ollama), Agent Orchestration, Tool Calling, Guardrails, Cost Tracking
defineModule(), Event Bus, Saga Transactions, Service Registry. Monolith in dev, microservices in prod.
Islands Architecture, Streaming SSR, defineRoute() with Loaders, Reactive Store, Head Manager. No "use client" confusion.
app.post('/users', validate({
body: z.object({
name: z.string().min(2),
email: z.string().email(),
})
}), async (c) => {
const body = await c.body();
const user = await db.users.create(body);
return c.json(user, 201);
});
const productPage = defineRoute({
async load({ params }) {
return { product: await db.findById(params.id) };
},
meta({ data }) {
return { title: data.product.name };
},
render({ data }) {
return <ProductPage product={data.product} />;
},
cache: { type: 'swr', maxAge: 60 },
});
app.page('/products/:id', productPage);
// Server renders everything. Islands add interactivity.
// JS ships ONLY for this component. Nothing else.
const AddToCart = island('AddToCart', ({ productId }) => {
return (
<button data-id={productId}>
Add to Cart
</button>
);
}, {
hydrate: 'visible', // load | visible | idle | media
});
const redisPlugin = definePlugin({
name: 'redis',
defaults: { url: 'redis://localhost:6379' },
async register(app, config) {
const client = createClient({ url: config.url });
await client.connect();
app.decorate('redis', client);
},
async close(app) {
await app.redis.disconnect();
},
});
await app.plugin(redisPlugin);
const agent = createAgent({
ai: createAI({ provider: 'claude' }),
name: 'support-bot',
tools: {
searchDocs: {
description: 'Search documentation',
parameters: z.object({ query: z.string() }),
handler: ({ query }) => search(query),
},
},
});
app.post('/chat', async (c) => {
return c.json(await agent.run(c.body.message));
});
| Feature | Vajra | Express | Hono | Fastify | Next.js |
|---|---|---|---|---|---|
| SSR (Islands) | Built-in | No | Partial | No | RSC |
| AI / LLM | Built-in | No | No | No | No |
| Security Suite | Built-in | Plugin | Plugin | Plugin | No |
| Rate Limiter | Built-in | Plugin | Plugin | Plugin | No |
| WebSocket | Built-in | Plugin | Plugin | Plugin | No |
| Circuit Breaker | Built-in | No | No | No | No |
| RBAC | Built-in | No | No | No | No |
| Plugin System | Built-in | Middleware | Middleware | Built-in | Config |
| Reactive Store | Built-in | No | No | No | No |
| Dependencies | 0 | 30+ | 0 | 20+ | 50+ |
We don't break things with updates. Your app built on Vajra v0.3 will work on Vajra v1.0. Stability is a feature, not a compromise.
No "use client". No "use server". No 4 caching layers. No magic. You write a function, it runs on the server. You make an island, it runs on the client. That's it.
99% of what you need for production is inside Vajra. JWT, CORS, rate limiting, validation, SSR, WebSocket, AI, microservices. Install one package, build anything.
When you run bun update, nothing breaks. We control every feature. No third-party dependency can ruin your weekend. Sleep well after deploying.
Build a REST API. Use any frontend. React, Vue, Svelte, Angular. Vajra handles the backend, your frontend framework handles the UI.
bun add vajrajs
Server-rendered pages with Islands for interactivity. SEO-friendly, fast TTFB, streaming. No separate frontend build.
bun add vajrajs
Vajra API + React/Vue frontend in one repo. Shared TypeScript types, Zod schemas. Turborepo for builds.
bunx create-vajra --monorepo
Vajra has 380+ tests with zero failures. Security modules are audited against OWASP Top 10. It is being used in production for real projects. However, as v0.x, the API may have minor changes before v1.0.
Yes. When used as an API framework, any frontend works. fetch() or axios calls from any framework. For SSR mode, Vajra has its own JSX runtime for server rendering, with Islands that can use any client framework.
Hono and Elysia are excellent routers. But they don't include security, AI, SSR, microservice modules, or circuit breakers. You'd need 10+ additional packages. Vajra includes everything from day one.
Vajra is built specifically for Bun. It uses Bun's native APIs (Bun.serve, Bun.file, WebSocket). Node.js is not supported. Bun is free, fast to install, and production-ready.
Yes. The core framework has zero npm dependencies. Zod is a peer dependency (you install it if you use validation). Everything else, from JWT to CORS to SSR, is built from scratch inside Vajra.