Balda
Balda is a runtime-agnostic backend framework that lets you write once and run anywhere—Node.js, Bun, and Deno—without changing a single line of code.
Why Balda?
- Cross-Runtime: One codebase runs on Node.js, Bun, or Deno using their native APIs (
http.createServer,Bun.serve,Deno.serve) - TypeScript-First: Full type safety with excellent IntelliSense support
- Decorator-Based: Clean, self-documenting code with decorators for routes and middleware
- Batteries Included: Controllers, validation, serialization, middleware, cron jobs, queues, GraphQL, and more
- Auto-Generated Docs: Swagger/OpenAPI documentation generated from your code
- Performance Focused: Minimal overhead with lean abstractions
Quick Example
import { Server, controller, get } from "balda";
const server = new Server({
port: 3000,
plugins: {
// Without body parser plugin, the body won't be parsed and will be undefined
bodyParser: {
json: {
sizeLimit: "100kb",
},
},
},
});
@controller()
class HelloController {
@get("/")
hello(req, res) {
res.json({ message: "Hello, Balda!" });
}
}
server.listen();
Get Started
- Install Balda in your preferred runtime
- Follow the Quick Start to build your first API
- Explore Core Concepts to understand how Balda works
Features
- Controllers - Organize routes with classes and decorators
- Middleware - Global, controller-level, or route-level middleware support
- Validation - Zod schemas for request/response validation
- Plugins - CORS, body parsing, rate limiting, compression, and more
- GraphQL - Built-in GraphQL support with type safety
- Queues - Background job processing with multiple providers
- Cron Jobs - Scheduled task execution
- CLI - Project generators and development tools
- Testing - Built-in mock server for easy testing