@grupodiariodaregiao/bunstone
v0.3.1
Published
Bunstone is a high-performance, decorator-based web framework for [Bun](https://bun.sh), inspired by NestJS and built on top of [ElysiaJS](https://elysiajs.com). It brings powerful Dependency Injection, CQRS, Sagas, and modular architecture to the Bun eco
Readme
Bunstone Framework
Bunstone is a high-performance, decorator-based web framework for Bun, inspired by NestJS and built on top of ElysiaJS. It brings powerful Dependency Injection, CQRS, Sagas, and modular architecture to the Bun ecosystem.
🚀 Quick Start
Scaffold a new project in seconds:
bunx @grupodiariodaregiao/bunstone my-app
cd my-app
bun dev🏗️ Core Concepts
Modular Architecture
Organize your application into modules using the @Module decorator.
@Module({
imports: [UserModule, AuthModule],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}Dependency Injection
Bunstone features a recursive DI container that handles singletons and nested dependencies automatically.
@Injectable()
export class AppService {
getHello() {
return "Hello World!";
}
}
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
}🛠️ Features
- CQRS: Built-in Command, Query, and Event buses.
- Sagas: Reactive event-to-command streams.
- Guards & JWT: Easy route protection and JWT integration.
- Zod Validation: Automatic request body/param validation.
- Scheduling: Decorator-based Cron jobs and Timeouts.
- Adapters: Built-in support for Form-Data, File Uploads, and Caching.
- Testing: Dedicated testing module for integration and E2E tests with mocking capabilities.
📚 Examples
We have a set of examples demonstrating various features of the framework:
| Example | Description | | --------------------------------------------------------- | ------------------------------------ | | Basic App | Modules, Controllers, and simple DI | | Routing & Params | Extracting data and Zod validation | | Guards & Auth | JWT and custom Guard implementations | | CQRS | Command Bus and Handlers | | SQL Database | Database registration and usage | | Scheduling | Periodic tasks and delayed execution | | Adapters | Cache and Form-Data handling | | OpenAPI | Swagger documentation setup |
📖 Documentation
Visit our Documentation Website (if hosted) or run it locally:
bun run docs:devGuide
- Dependency Injection
- Routing & Parameters
- CQRS & Sagas
- Guards & JWT
- Scheduling (Cron/Timeout)
- Adapters
- Testing
📄 License
MIT
