Production-ready TypeScript framework for Bun with decorators, dependency injection, and type safety. Spring Boot-inspired.
bun add @cinnabun/core reflect-metadata- Dependency Injection — constructor and field injection with singleton scope
- Decorator-driven routing —
@GetMapping,@PostMapping,@PutMapping,@DeleteMapping,@PatchMapping - Validation — Zod-based request validation via
@Validate() - Guards — access control with
@UseGuard() - Interceptors — request/response transformation with
@UseInterceptor() - Middleware — class-based middleware via
@UseMiddleware() - WebSocket — message broker with
@EnableWebSocketMessageBroker,@MessageMapping,@SendTo - Plugin system — lifecycle hooks (
onInit,onReady,onShutdown) - Module system — organize code with
@Module() - Lifecycle hooks —
@PostConstruct()and@PreDestroy()
// src/main.ts
import "reflect-metadata";
import {
CinnabunApp,
CinnabunFactory,
RestController,
Service,
GetMapping,
Param,
} from "@cinnabun/core";
@Service()
class GreetingService {
greet(name: string) {
return `Hello, ${name}!`;
}
}
@CinnabunApp({ port: 3000, scanPaths: [] })
@RestController("/api")
class App {
constructor(private greetingService: GreetingService) {}
@GetMapping("/")
index() {
return { message: "Welcome to Cinnabun!" };
}
@GetMapping("/hello/:name")
hello(@Param("name") name: string) {
return { message: this.greetingService.greet(name) };
}
}
CinnabunFactory.run(App);bun run src/main.tsSee the main Cinnabun README and docs/ for architecture, API reference, and implementation guides.
- Bun v1.0+
- TypeScript with
experimentalDecoratorsandemitDecoratorMetadataenabled
MIT