s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All packages
Web & UI v0.57.40

@happyvertical/smrt-app-runtime

Validated local, self-hosted, and cloud runtime composition for s-m-r-t applications, with a SvelteKit entry for server hooks.

Source ↗

What it gives you

Validated local, self-hosted, and cloud runtime composition for s-m-r-t applications, with a SvelteKit entry for server hooks.

  1. 01The local profile owns user data paths, SQLite custody, application-secret creation, and a single-use loopback owner bootstrap
  2. 02Deployed profiles compose provider bindings for database, authentication, assets, and secrets, readiness-checked before startup
  3. 03Application migrations run through an explicit, idempotent prepareDatabase hook; runtime never creates tables implicitly

Private local applications

initializeLocalApplicationRuntime claims a dedicated mode-0700 data root in the OS application-data directory and serializes initializers with a SQLite lock database. The first valid bootstrap claim creates a Person, User, default Tenant, owner Role and Membership, and Session in one transaction. Local MCP tokens are owner-bound, scoped, expiring, and stored only as an HMAC.

Deployed profiles and workers

initializeDeployedApplicationRuntime composes only self-hosted and cloud. createTaskWorker and createScheduleWorker run the jobs package runners in separate processes against the shared PostgreSQL database; the web process does not start them. health is process liveness; readiness probes database, auth, assets, and secrets.

The SvelteKit entry

createSmrtSvelteKitRuntime from the sveltekit subpath returns init and handle for hooks.server.ts. init is the fail-closed startup gate. handle runs URL tenant selection, the signed session, and then publishes tenant context only when the active context matches the verified session tenant.