Skip to content

Local Development ​

Prerequisites ​

Install:

You also need local access to the backing services you plan to use:

  • Google Application Default Credentials with access to the GCS data bucket
  • a Google Cloud Storage bucket for app data
  • optional Google Cloud Text-to-Speech access for summary audio
  • a YouTube Data API key when you ingest YouTube sources
  • an OpenAlex API key when you use authenticated OpenAlex search
  • a local or private OpenAI-compatible ASR service when podcast feeds do not publish transcripts

For local GCP credentials, use:

bash
gcloud auth application-default login

Clone the repo:

bash
git clone https://github.com/ThorbenWoelk/dAstIll.git
cd dAstIll

Start And Stop ​

The local stack consists of:

  • a SvelteKit frontend on 3543 by default
  • a Rust backend on 3544 by default
  • a VitePress docs frontend on 4173 by default

From the repo root:

bash
./start_app.sh

./start_app.sh stops any running dAstIll services first, then restarts the stack from a clean state.

Detached mode:

bash
./start_app.sh --detach

Detached startup writes supervisor output to start_app.log and service logs to backend.log, frontend.log, and docs.log.

Mac launcher ​

The shared backend env uses PROCESSING_ROLE=local-fetcher. Run ./scripts/link_shared_env.sh to add this setting to an older local config. The running backend fetches YouTube transcripts requested through the shared GCS bucket even when no browser is open. Hosted Cloud Run uses PROCESSING_ROLE=remote and generates/evaluates the articles. Set combined explicitly only for a standalone development instance. Existing articles remain available while the Mac is offline; new YouTube requests wait for it to return.

Install the caption fallback on macOS with brew install yt-dlp deno, then run ./scripts/link_shared_env.sh to record executable paths that are missing from the shared env. If YTDLP_PATH is already set, check that it names the installed executable (command -v yt-dlp). Restart the local backend after changing these values. A missing extractor defers the job instead of marking the video as having no transcript.

On a Mac with Xcode command line tools, install the local control app from the repo root:

bash
./scripts/install_macos_launcher.sh

Open dAstIll Local from Spotlight, Launchpad, or ~/Applications. Its window and menu bar item show the reader, backend, docs, and local transcription service status. Start runs ./start_app.sh --detach; Stop runs ./end_app.sh. Restart starts the stack again after stopping it. The launcher also opens the reader and start_app.log.

When the Mac wakes from sleep, the launcher restarts a stack that was running before sleep. This resets stale frontend and backend connections so an open browser tab can reconnect. A stack stopped with Stop stays stopped after wake.

Quitting the launcher leaves the services running. The launcher controls this checkout and uses the default local ports (3543, 3544, 4173, and 5092). Reinstall it after moving the checkout. Starting automatically after login is a separate setting; this launcher starts the stack when you press Start.

The installer also adds a post-commit hook to this checkout. Each successful Git commit rebuilds and replaces dAstIll Local.app. If the launcher is open, the installer reopens it in the background. The backend, reader, docs, and transcription processes keep running during the launcher update. Commits from another worktree leave this checkout's installed launcher alone.

Stop everything cleanly:

bash
./end_app.sh

Startup verifies the backend health endpoint and the initial workspace bootstrap response before it reports success. If the bootstrap probe fails because local GCP credentials or GCS_DATA_BUCKET are missing, startup stops and prints a hint about the credential source it found. Other bootstrap failures also stop startup; check backend.log.

Process ownership, backend startup internals, worker loops, and shared runtime state are covered in Runtime Topology.

When you use ./start_app.sh, it also augments local CORS config so the backend accepts both the web frontend and the Tauri Android shell.

Default docs URL:

text
http://localhost:4173

The app header includes a Docs link. In local development it falls back to http://localhost:4173. Deployed frontend builds read the docs URL from frontend build config.

Smoke Test Inputs ​

For a quick local ingest check, the workspace add-source input accepts:

  • YouTube handles and channel URLs
  • openalex: <query>
  • podcast: <feed-url>
  • site: <page-url> or a plain non-YouTube page URL

Shared Env Files ​

The recommended local env layout is:

text
~/.config/dastill/
  backend.env
  frontend.env

./start_app.sh and ./scripts/link_shared_env.sh use this shared directory by default. Use the repo-root env example files for the supported override keys.

Create or link the shared files from the repo root:

bash
./scripts/link_shared_env.sh

What it does:

  • migrates an existing worktree-local backend/.env or frontend/.env into the shared directory when the shared file does not exist yet
  • creates backend/.env and frontend/.env symlinks that point at the shared files
  • seeds missing shared files from backend/.env.example and frontend/.env.example

Env precedence for local development is:

  1. shell environment variables
  2. worktree-local backend/.env or frontend/.env
  3. shared ~/.config/dastill/backend.env or ~/.config/dastill/frontend.env

Use the repo-root backend/.env.example and frontend/.env.example as the current variable lists. Keep those example files as the place for exhaustive keys, defaults, and inline comments.

Runtime Modes ​

./start_app.sh starts the backend, the reader frontend, and the docs.

  • .github/runtime-mode.env mirrors the release workflow mode. The reader looks the same in both modes; there is no separate maintenance page.
  • LOCAL_APP_MAINTENANCE_MODE=1 skips backend startup for frontend-only work. The reader then shows its error state until a backend is reachable.

Frontend E2E specs mock the backend, so bun run test:e2e only needs the frontend dev server. Playwright starts it when nothing is listening on port 3543.

Backend Env ​

Local backend startup reads the shared machine-local file at ~/.config/dastill/backend.env by default. If you want a one-off worktree override, backend/.env still works and wins over the shared file. Shell environment variables win over both file-based sources.

Local startup needs GCS_DATA_BUCKET and valid Google Application Default Credentials for the GCS provider. Set GOOGLE_APPLICATION_CREDENTIALS only when you need to force a specific service account key file. If it is unset, the Google client libraries use the local ADC store created by gcloud auth application-default login.

Smoke tests can opt into the in-memory object store with:

env
OBJECT_STORE_PROVIDER=memory
ALLOW_IN_MEMORY_OBJECT_STORE=true

That provider is for tests and local process-only checks. It does not persist data across restarts.

Set optional tracing, operator access, and project-scoped API keys in ~/.config/dastill/backend.env. Use backend/.env.example for the current key names.

YouTube API keys are tied to the Google Cloud project that created them. If you change projects, create a fresh key in the target project and update ~/.config/dastill/backend.env. Production secret rotation follows the production deployment flow.

Local ASR ​

For local podcast transcription, enable local ASR in ~/.config/dastill/backend.env and point it at localhost or 127.0.0.1. Use backend/.env.example for the current key names.

./start_app.sh then starts ./scripts/start_local_asr.sh --detach before the backend. The helper expects Homebrew whisper-cpp and ffmpeg, downloads ggml-base.en.bin into ~/.cache/dastill/asr/, and serves:

text
http://127.0.0.1:5092/v1/audio/transcriptions

Stop it with ./end_app.sh together with the rest of the local stack.

Postman Debugging ​

The backend exposes a live OpenAPI document for local debugging.

When you run the full stack with ./start_app.sh, import this URL into Postman:

text
http://localhost:3544/api/openapi.json

If you run the backend binary by itself instead of ./start_app.sh, the default port is 3001:

text
http://localhost:3001/api/openapi.json

Use the live OpenAPI URL as the source of truth during debugging. It reflects the running backend. The checked-in backend/openapi.postman.yaml file is only a snapshot artifact and should not be treated as the authoritative contract for local debugging.

Android ​

The Android shell is covered in Android Operations.