Skip to content

Add one-liner bootstrap: bash scripts/start.sh to build + start backend and frontend end to end #207

@harshitsinghbhandari

Description

@harshitsinghbhandari

Problem

Bringing the project up from a fresh clone is currently a multi-step, easy-to-fumble sequence spread across the README (build backend, start daemon, then a separate frontend install/approve/dev). A couple of footguns make it worse for new users:

  • The frontend needs pnpm approve-builds before pnpm dev will launch. A plain pnpm install prints Ignored build scripts: electron, electron-winstaller and does not download the Electron runtime (node_modules/electron/dist/ is absent), so electron-forge start fails. This is non-obvious.
  • frontend/pnpm-workspace.yaml tries to pre-approve this via allowBuilds: electron: true, but allowBuilds is not a valid pnpm key (the real one is onlyBuiltDependencies). pnpm silently ignores it, so the manual approve step is still required. Worth fixing that key as part of this, or documenting why the manual step stays.

Proposal

Add a one-liner bootstrap script runnable as:

bash scripts/start.sh

that takes a fresh checkout to a running app end to end:

  1. Build the backend: cd backend && go build -o /tmp/ao ./cmd/ao (or a repo-local bin path).
  2. Start the daemon: /tmp/ao start and wait for /readyz.
  3. Frontend deps: cd frontend && pnpm install.
  4. Approve Electron's build script (the step plain pnpm install skips).
  5. Launch: pnpm dev.

The interactive snag to handle

pnpm approve-builds is interactive — it opens a prompt to tick which packages may run scripts, so it needs a TTY and can't be dropped into a non-interactive script as-is. The script should use a non-interactive equivalent instead. Verified working option:

pnpm rebuild electron   # runs electron's postinstall; downloads dist/Electron.app

(or fix frontend/pnpm-workspace.yaml to use onlyBuiltDependencies: [electron, electron-winstaller] so the build is approved at install time and no extra step is needed).

Notes

  • Prereqs to check/document up front: Go 1.25+, pnpm, zellij on PATH, gh/GITHUB_TOKEN for the SCM observer.
  • The daemon binds 127.0.0.1:3001 by default and fails fast if the port is taken — the script should surface that clearly if a daemon is already running.
  • pnpm dev does not start the daemon; the script ordering (daemon first) matters.

All of the above (the ignored-build-scripts behavior, the dead allowBuilds key, and the pnpm rebuild electron fix) was verified locally on pnpm 10.11.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions