Booster Framework
website·Indexed 32 days ago
https://docs.boosterframework.com/An event-driven framework for building scalable applications. It provides a CLI for development and deployment, a GraphQL API for interacting with commands and read models, and a system of 'rockets' to add functionality like file uploads, static site deployment, and webhooks. The framework supports multiple infrastructure providers, including AWS, Azure, and Local.
What's inside Booster
- Booster is an open-source, minimalistic TypeScript framework designed for building event-sourced microservices using CQRS (Command Query Responsibility Segregation) and Event Sourcing (ES) semantics. It analyzes the semantics of the developer's code to automatically provision optimal cloud infrastructure and generate a fully-functional GraphQL API, including schemas and resolvers, reducing the amount of boilerplate code required. Booster is free to use and runs directly within the user's own cloud accounts (supporting AWS and Azure), ensuring that data and deployment remain under the user's control via their own CI/CD scripts.
Overview of the Booster Framework
Booster is a TypeScript-based framework designed for building scalable, reliable, and event-driven applications in the cloud. It utilizes a Domain-Driven Design (DDD) approach and automates infrastructure provisioning, providing a real-time GraphQL API out of the box. The framework is designed to be truly serverless and multicloud, allowing the same application to run across different cloud providers without code changes.Overview of Booster Rockets
Rockets are Booster Framework extensions implemented as npm packages that follow public Booster rocket interfaces. They serve two primary purposes:
- Infrastructure Extensions: Adding provider-specific resources to the application stack.
- Runtime Extensions: Adding new annotations, interfaces, and decorators to implement new abstractions on top of common use cases.
Overview of the Booster Framework component system
The Booster Framework is introducing a component integration mechanism for power users and contributors to extend applications beyond the capabilities of the standard system. This system shifts from dynamic imports specified in JSON configurations to a model where components are written with explicit interfaces using the Effect library and injected directly into projects. This provides improved type safety, dependency injection, structured logging, and better concurrency management.Overview of Entities in Booster
Entities represent the current state of an application, derived by reducing the event stream (the source of truth). For example, while events likeAccountCreatedandMoneyDepositedtrack changes, theBankAccountentity stores the current balance and owner. Booster automatically generates entities on the fly and stores snapshots to avoid reducing the entire event stream every time the state is needed. Entities are eventually consistent due to the asynchronous nature of event processing.Overview of Booster GraphQL API operations
The Booster GraphQL API is auto-generated based on your commands and read models. It maps standard GraphQL operations to Booster components as follows:
- Mutations: Used to send commands (modify data).
- Queries: Used to read read models (retrieve data on-demand).
- Subscriptions: Used to subscribe to read models (receive real-time updates).
Import types and classes across Booster agents using remote imports
Booster Framework provides a mechanism to import types and classes from different agents and repositories without using traditional package managers. This is achieved through a combination of a service endpoint and a TypeScript compiler plugin.
Key components of this system include:
- The
/inspectEndpoint: A service endpoint that provides direct access to.d.tsfiles for project components (commands, events, read-models, etc.), organized by agent. - TypeScript Compiler Plugin: A custom transformer that recognizes a specialized import syntax and dynamically fetches the corresponding type definitions from the
/inspectendpoint.
- The
Best practices for developing custom Booster providers
When developing a custom provider, follow these guidelines to streamline the process:
- Reference Existing Providers: Review the implementation of existing providers to understand the expected patterns and architecture.
- Infrastructure First: Begin implementation with the infrastructure package. Ensuring the infrastructure is deployed first makes subsequent work with the runtime API significantly easier.
- Community Support: Use the official Discord channel for technical support and community guidance during development.
Integrate AI Agents into the Booster Framework architecture
AI agents can be integrated into the framework by following the same structural pattern as traditional agents (containingcommands,events, andread-models), but with internal logic powered by Large Language Models (LLMs). This allows AI agents to autonomously handle specific tasks, predictive analytics, or automated decision-making within their designated domain folder while adhering to the framework's standard communication protocols.Understand Booster framework package architecture
Booster is a monorepo managed usingrushandnpm. Code is split into packages based on whether they run separately (e.g., CLI vs Cloud), are shared by multiple packages, or are vendor-specific specializations. All packages are published to npm under the@boostercloud/prefix.rush buildBooster Framework Principles
Booster operates on several key architectural principles:
- Convention over Configuration: Minimizes boilerplate and configuration to keep the focus on business logic.
- Implicit Serverless: Infers the serverless architecture directly from the code, removing the need for manual infrastructure management.
- Effective Multicloud: Decoupled architecture prevents vendor lock-in and supports multiple cloud providers.
- Abstraction: Provides semantic abstractions over low-level details like SQL, API design, and authentication.
- Extensibility via Rockets: Uses "Rockets" (npm packages) as plugins to provide new abstractions, cloud service support, or pre-built functionalities.
Understand default logging behavior in Booster
By default, Booster uses standard JavaScript console methods based on the configured log level. Logs are typically captured by the cloud provider's default log aggregator (e.g., AWS CloudWatch). The mapping is as follows:
Level.debugmaps toconsole.debugLevel.infomaps toconsole.infoLevel.warnmaps toconsole.warnLevel.errormaps toconsole.error