Skip to content

Bootstrap script#160

Open
jspada200 wants to merge 6 commits into
mainfrom
bootstrapScript
Open

Bootstrap script#160
jspada200 wants to merge 6 commits into
mainfrom
bootstrapScript

Conversation

@jspada200
Copy link
Copy Markdown
Collaborator

Summary

New contributors have reported difficulty getting the stack running locally. This PR adds a single interactive bootstrap.sh script at the repo root that automates the entire first-time setup in one command.

The script handles:

  • Prerequisite checks — verifies npm and docker are installed and the Docker daemon is running, with actionable error messages for each failure
  • Config file setup — backs up any existing files (timestamped .bak.*) then copies all three example configs: docker-compose.local.yml, docker-compose.local.vexa.yml, and frontend/packages/app/.env
  • LLM provider setup — interactive prompt for OpenAI or Gemini API key (skippable, leaves placeholder with a reminder)
  • Transcription service setup — presents three options: remote vexa.ai free tier (recommended), self-hosted Whisper service (with step-by-step instructions), or skip (automatically injects SKIP_TRANSCRIPTION_CHECK=true so Vexa starts cleanly)
  • Frontend dependencies — runs npm install in frontend/
  • Vexa API key generation — starts the Vexa services, waits for the admin API to be ready, creates a local dev user, generates an API token, and writes VEXA_API_KEY into docker-compose.local.yml automatically
  • Full stack startup — runs the equivalent of make start-local in detached mode

The script is re-runnable: if config files already exist they are backed up before being overwritten. The .gitignore files are updated to exclude the .bak.* files the script produces.

Compatible with macOS and Linux.

Testing

  • I have tested these changes locally
  • I have run all relevant automated tests
  • I have verified this does not break existing workflows
  • For changes that can be tested in UI, I have included screenshots or gif animations of the changes.

How I Tested

Ran ./bootstrap.sh on Linux (WSL2) end-to-end:

  1. Selected OpenAI as LLM provider and entered a key — confirmed written to docker-compose.local.yml
  2. Selected remote transcription (option 1) and entered a vexa.ai key — confirmed written to docker-compose.local.vexa.yml
  3. Observed npm install complete successfully
  4. Observed Vexa services start and the admin API become ready on :8056
  5. Confirmed user creation (HTTP 201) and token generation via the Vexa admin API
  6. Confirmed VEXA_API_KEY injected into docker-compose.local.yml
  7. Confirmed full stack started with docker compose up --build -d

Also verified:

  • Re-running the script backs up existing config files rather than silently overwriting them
  • Selecting "skip" for transcription appends SKIP_TRANSCRIPTION_CHECK=true to docker-compose.local.vexa.yml and Vexa starts without the 403 error
  • Bash syntax validated with bash -n bootstrap.sh
  • Admin API port corrected to 8056 (the gateway port accessible from the host; 8057 is internal Docker-network only)

jspada200 and others added 2 commits May 15, 2026 13:15
Adds a single interactive script at the repo root that walks a new
contributor through the full local setup in one command:

- Checks that npm and Docker (daemon running) are present
- Backs up and copies all three example config files
  (docker-compose.local.yml, docker-compose.local.vexa.yml, frontend .env)
- Interactively prompts for the LLM provider and API key (OpenAI / Gemini / skip)
- Interactively prompts for the transcription backend:
  remote vexa.ai free tier, self-hosted Whisper service, or skip
  (adds SKIP_TRANSCRIPTION_CHECK=true when skipped)
- Runs npm install for the frontend
- Starts the Vexa services, waits for readiness, creates a local user,
  generates a Vexa API key, and writes it into docker-compose.local.yml
- Starts the full DNA stack detached (equivalent to make start-local)

Compatible with macOS and Linux. Re-runnable: existing config files are
backed up with a timestamp suffix before being overwritten.

Also updates .gitignore files to exclude the .bak.* backup files the
script creates.

Signed-off-by: James Spadafora <spadjv@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: James Spadafora <spadjv@gmail.com>
@jspada200 jspada200 requested review from camerontarget14 and loorthu and removed request for camerontarget14 May 15, 2026 22:16
camerontarget14 and others added 4 commits May 20, 2026 14:42
1. Updated usage comment to document both `./bootstrap.sh` and
   `./bootstrap.sh --start`
2. Added Node.js version check to `check_prerequisites` — verifies
   `node` is present and is v18+, not just that `npm` exists
3. Added `python3` check to `check_prerequisites` — it was used in three
   inline heredocs but never verified
4. Added `wait_for_dna()` — polls `http://localhost:8000/docs` every 3
   seconds (up to 40 retries) after the stack starts, giving real
   confirmation the API is up
5. Added `print_summary()` — extracted the final status block from
   `main` so both code paths share it; updated the "restart with" hint
   to use `./bootstrap.sh --start`
6. Rewrote `main()` to accept a `--start` flag — skips all interactive
   setup (config copying, LLM/transcription prompts, `npm install`, Vexa
   bootstrapping) and just runs prerequisites → start stack → health
   check

---

**`QUICKSTART.md`**

1. Added step 8 to the bootstrap step list: "Poll the DNA API until it
   is ready and confirm all services are up"
2. Added a "Day-to-day use" note with `./bootstrap.sh --start` after the
   first-run instructions

Signed-off-by: Cameron Target <camerontarget@gmail.com>
Signed-off-by: Cameron Target <camerontarget@gmail.com>
Signed-off-by: Cameron Target <camerontarget@gmail.com>
@camerontarget14
Copy link
Copy Markdown
Collaborator

camerontarget14 commented May 22, 2026

@jspada200 added a couple things to this, let me know what you think! First commit message covers everything if you just want to take a skim over that. But then I added prodtracking provider configuration too.

Tested in a Mac environment, stood up application and tested all features involving configured settings (SG, Vexa, Open AI API)

Screenshot 2026-05-22 at 10 00 12 AM

Copy link
Copy Markdown
Collaborator

@camerontarget14 camerontarget14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This is sweet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants