Release build
The release build packages the API and the web app into a single self-contained executable. It is what the GitHub release workflow produces and what end users download.
Building
From the repo root:
bun run build:releaseThe script does three things in order:
- Builds the SvelteKit web app into
apps/web/build/. - Compiles the Bun API entrypoint into a single executable at
apps/api/dist/rewind. - Bundles the two together into a platform-specific archive under
release/.
The exact output directory looks like:
release/
rewind-<version>-<platform>-<arch>/
rewind # the compiled launcher
web/ # the static web app
rewind-<version>-<platform>-<arch>.tar.gzThe exact platform and arch match the host that ran the build. A build on linux x64 produces rewind-<version>-linux-x64. To cross-compile, pass --target to the bun build invocation in apps/api/package.json.
What the launcher does
rewind is a single-file Bun executable. On startup it:
- Resolves the data directory from
REWIND_DATA_DIRor the platform default. - Opens the SQLite database under that directory (creating it on first run).
- Migrates the schema if needed.
- Starts the Elysia API on
127.0.0.1:8000(orHOST/PORT). - Serves the bundled
web/directory from the same process, so visitinghttp://127.0.0.1:8000lands on the workspace. - Optionally opens the default browser to that URL, after a short delay so the server is ready.
The launcher's bootstrap code is in apps/api/src/index.ts.
What the launcher does NOT do
- It does not install itself. Drop the binary anywhere on your
PATHif you want a system command, or run it from wherever you unpacked the archive. - It does not create a desktop shortcut or a
launchd/systemdunit. Run it manually, or wrap it in your own service definition. - It does not phone home. The binary is fully self-contained: API, web bundle, and Drizzle migrations.
Smoke test
A small smoke script is included to verify the built binary:
bun run scripts/smoke-release.tsIt unpacks the release archive into a temp directory, starts the binary, hits /health, and checks the response. It also exits with a non-zero code on any failure, so it can run in CI.
CLI build (optional)
If you only want the command-line runner (no UI, no server), build it separately:
bun run --filter '@rewind/api' build:cliThis produces apps/api/dist/rewind-cli. The CLI requires a separately-running API to talk to; it does not start its own. See Running a collection for usage.
Versioning
The API exposes its version through the version field in the diagnostic archive. The launcher's version is currently the workspace package version (2.0.0 at the time of writing), hard-coded in apps/api/src/index.ts. The web app reads the same value.
Distribution
Releases are published through the GitHub Actions release.yml workflow. The workflow:
- Builds the web app and the launcher.
- Runs the smoke test against the produced binary.
- Creates a GitHub release with the
.tar.gzand a checksums file. - Attaches the diagnostic script and any release notes.
You can run the same steps locally with bun run build:release followed by bun run scripts/smoke-release.ts and a manual gh release create.
What's next?
- Environment variables — the knobs the launcher reads
- Data and storage — what the launcher writes
- Contributing — making changes that should ship in the next release