Skip to content

Slingshot

Define a data model. Get a full API. Scale to events, realtime, auth, permissions, and jobs.
app.config.ts
import { defineApp, defineEntity, definePackage, entity, field } from '@lastshotlabs/slingshot';
const Task = defineEntity('Task', {
namespace: 'app',
fields: {
id: field.string({ primary: true, default: 'uuid' }),
title: field.string(),
done: field.boolean({ default: false }),
},
});
export default defineApp({
port: 3000,
packages: [definePackage({ name: 'app', entities: [entity({ config: Task })] })],
});
Terminal window
slingshot start

Five routes, request validation, OpenAPI docs, and swappable storage — from one definition.

Generated CRUD

Define a model with defineEntity. Get GET, POST, PATCH, DELETE routes with validation and OpenAPI docs.

Operations

Add domain actions like publish, archive, complete alongside CRUD. Each generates a typed, documented route.

Events and the Event Bus

One event triggers many effects — welcome email, search index, admin notification. No coupling between packages.

Realtime

SSE for live updates. WebSockets for chat and collaboration. Both built in.

Auth and Permissions

Sessions, OAuth, MFA, passkeys, RBAC, and resource-level access control.

Swappable Storage

Memory for dev, SQLite for prototyping, Postgres for production. Same entity code.