Skip to content

CI workflow, install/run scripts, and idiot-proof quick start#6

Merged
StewAlexander-com merged 1 commit into
mainfrom
add-ci-and-install-scripts
May 16, 2026
Merged

CI workflow, install/run scripts, and idiot-proof quick start#6
StewAlexander-com merged 1 commit into
mainfrom
add-ci-and-install-scripts

Conversation

@StewAlexander-com
Copy link
Copy Markdown
Owner

Summary

Brings the project to a runnable, testable state with a one-command CI
pipeline and a two-command local setup.

CI (.github/workflows/ci.yml)

  • Backend matrix: pytest on Python 3.10, 3.11, 3.12 against
    backend/requirements-dev.txt. All 89 tests pass locally.
  • Frontend: node --check on every frontend/*.js; JSON parse
    check on frontend/**/*.json and curriculum/**/*.json.
  • Scripts: shellcheck on install.sh / run.sh, then a
    full install + run smoke test that hits /api/health and / with
    TUTOR_SKIP_OLLAMA=1 so CI never needs an LLM.

Idiot-proof install (install.sh, run.sh)

  • Two commands from git clone to a browser tab: ./install.sh then
    ./run.sh.
  • install.sh is idempotent: reuses the venv, never installs system
    packages (Ollama in particular), prints the exact install command if
    Ollama is missing, and offers to pull gemma3:4b only when the
    Ollama daemon is already reachable.
  • run.sh sets TUTOR_SERVE_FRONTEND=1 so the backend serves both the
    REST API and the static PWA on a single port (default 8001). The web
    UI loads even when Ollama is offline — chat replies return a clear
    503 instead of hanging.
  • Env-var overrides for TUTOR_PORT, TUTOR_HOST, TUTOR_MODEL,
    TUTOR_SKIP_OLLAMA, TUTOR_SKIP_MODEL_PULL, TUTOR_NONINTERACTIVE.

Docs

  • docs/install-runtime-workflow.md evaluates five candidate flows
    (manual / Docker / one-shot bootstrap / two scripts / Make) on
    steps, intervention, ease, and risk, and explains the chosen blend.
  • README gains a Quick start section with troubleshooting and explicit
    behaviour when Ollama is not running.

Test plan

  • cd backend && .venv/bin/pytest -q → 89 passed
  • node --check frontend/*.js → all four files parse
  • TUTOR_SKIP_OLLAMA=1 ./install.sh from clean state and from a
    reused venv → both succeed and are idempotent
  • TUTOR_SKIP_OLLAMA=1 ./run.sh → backend reachable on the port;
    /api/health returns status: degraded, / returns the SPA
  • ./scripts/smoke_run.sh → prints smoke ok

🤖 Generated by Computer

- .github/workflows/ci.yml runs pytest across Python 3.10/3.11/3.12,
  syntax-checks frontend JS via node --check, validates JSON, and
  smoke-tests install.sh + run.sh with Ollama mocked out.
- install.sh is idempotent: detects Python >=3.10, creates backend/.venv,
  installs deps, probes Ollama, pulls the default model if the daemon
  is reachable. Never installs system binaries.
- run.sh launches uvicorn with TUTOR_SERVE_FRONTEND=1 so the backend
  serves both the API and the static UI on a single port.
- docs/install-runtime-workflow.md compares five install-to-runtime
  flows and documents the chosen two-script blend.
- README gains an idiot-proof Quick start section with troubleshooting
  and expected behaviour when Ollama is offline.
- scripts/smoke_run.sh exercises /api/health and / for CI and local
  verification.
@StewAlexander-com StewAlexander-com merged commit bac79ad into main May 16, 2026
5 checks passed
@StewAlexander-com StewAlexander-com deleted the add-ci-and-install-scripts branch May 16, 2026 12:58
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