@getstrata/core
Database models, HTTP utilities, authentication, queues, mail, storage, and security for Strata applications. Requires Bun >=1.4.4; tested on Bun 1.4.4.
Start an application with the generator:
bunx create-strata my-app
To add the runtime library to an existing project:
bun add @getstrata/core
Use focused public subpaths. Ordinary models extend defineModel; fields supply both runtime metadata and inferred attribute types:
import { defineModel, field } from "@getstrata/core/database/model";
export class Note extends defineModel({
table: "notes",
fields: { id: field.number(), body: field.string() },
}) {
static $fillable = ["body"] as const;
static $timestamps = false;
}
Register the class with the application, then query through the current execution's database.model(Note). Inside a transaction, use its supplied database session. Schema changes belong in migrations.
Other public APIs include FormRequest from @getstrata/core/http/formRequest, Policy from @getstrata/core/auth/policy, and response helpers from @getstrata/core/http/response. Testing controls live on @getstrata/core/testing.
See the project README and the guides for databases, authentication, tenancy, queues, storage, and media.