Skip to content

Introduction

Slingshot is a backend framework that generates the boring parts so you can focus on the interesting parts.

Define a data model — you get CRUD routes, validation, OpenAPI docs, and storage wiring. Write custom routes where you need them. Organize everything into typed packages that compose cleanly as your app grows.

For a working code example, see the splash page or jump straight to the Quick Start. This page is the conceptual map; the next page after this one (First Steps) walks the project shape and boot lifecycle.

  • Generated CRUD — define a model, get GET, POST, PATCH, DELETE routes
  • Operations — add domain actions like publish, archive, complete alongside CRUD
  • Typed events — packages communicate through typed events, not imports
  • Realtime — WebSockets and SSE are built-in, not bolted on
  • Auth and permissions — sessions, OAuth, MFA, RBAC, and resource-level access control
  • Background jobs — tasks and workflows that run off the request path
  • Swappable storage — memory, SQLite, Postgres, MongoDB, Redis — change one line
  • OpenAPI — every route shows up in generated API docs automatically
app.config.ts (defineApp)
└── Packages (definePackage)
├── Entities (defineEntity) → generated CRUD, operations, storage
├── Domain routes (route.*) → custom endpoints
└── Public surface (definePackageContract)
├── publishes capabilities → typed cross-package services
└── publishes entity refs → narrowed adapters for other packages
  1. App configapp.config.ts exports defineApp({...}) as default. The CLI discovers the file and boots the server. Config covers security, databases, runtime, and secrets.
  2. Packages — each feature area is a package with its own routes, middleware, and entities.
  3. Entities — define a model, get generated routes, operations, and storage that works across backends.
  4. Package Contracts — when another package consumes yours, declare a typed public surface so the boundary is explicit and validated at boot.
  5. Core features — events, realtime, auth, permissions, and jobs plug into the same model.

The canonical journey (recommended for most readers):

  1. Quick Start — get a running app in three steps
  2. Composing an App — packages, routes, contracts, events, plugins
  3. Authoring Routes — per-route concerns: validation, DTO, idempotency
  4. Working with Data → Security → Realtime → Operations → Production

The sidebar follows this order. Walk down it once and you’ll have seen every layer of the framework.

If you learn best by doing:

  1. Quick Start — paste, run, curl, done
  2. Core Features — pick the feature you need

If you learn best by understanding the model:

  1. Authoring Model — how apps, packages, and entities fit together
  2. App Roots and Runtime — the framework assembly layer
  3. Package-First Authoring — organizing code into packages
  4. Entity System — the entity authoring and customization story

If you learn best from examples:

  1. Examples — complete apps covering SaaS, forums, collaboration, and more
  2. Guides — production concerns like security, testing, deployment, and scaling