Composer
Composer is one typed file that declares every service your app depends on. strata dev reads it to start things locally; strata deploy reads it to provision them in the cloud.
import { compose, postgres, bucket, job, secret } from "@strata/compose";
export default compose({
db: postgres({ version: 17 }),
uploads: bucket({ public: false }),
nightly: job({ schedule: "0 3 * * *", run: "scripts/cleanup.ts" }),
stripeKey: secret("STRIPE_KEY"),
});What each resource becomes
Resource | Locally | In the cloud |
|---|---|---|
| a container on a free port | a managed database |
| a folder under | an S3-compatible bucket |
| runs on | a scheduled Compute task |
| read from | read from the project's vault |
Composer is in early access. Its file format may change before 1.0; strata upgrade will rewrite it for you when it does.
Updated