Skip to content

Soda documentation

Soda is a class-based web framework for Bun: modules, dependency injection and decorators like Nest, on Bun’s native router, with standard TC39 decorators.

These pages describe the main branch. Soda is 0.x: the API may change between minor versions.

Guide

  1. Getting started: create a project, run it, the files it contains
  2. Controllers: routes, paths, arguments, responses, server-sent events
  3. Validation: schemas, parsers, bodies, forms and uploads, error responses
  4. Providers and modules: inject(), providers, tokens, modules, lifecycle
  5. Request pipeline: middleware, guards, interceptors, exception filters, CORS
  6. Configuration: typed environment, validated at startup
  7. Authentication: JWT, cookies, the current user
  8. WebSockets: gateways, messages, rooms
  9. Rate limiting: limits per client and route
  10. OpenAPI: the document and Swagger UI from your routes
  11. CQRS: commands, queries and events, handled across modules
  12. Logging: the logger, levels, JSON output
  13. Testing: the application over HTTP, replaced providers
  14. Production: build, shutdown, proxies, limits, Docker
  15. Checking and inspecting: soda check, every startup problem at once; soda inspect, the application as data

Recipes

Coming from Nest

From Nest maps each Nest feature to Soda’s, and says what differs.