Skip to content

feat: OmniBioAI Web version for app.omnibioai.org#4

Merged
man4ish merged 3 commits into
mainfrom
feat/web-app
Jul 18, 2026
Merged

feat: OmniBioAI Web version for app.omnibioai.org#4
man4ish merged 3 commits into
mainfrom
feat/web-app

Conversation

@man4ish

@man4ish man4ish commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Web version of OmniBioAI Studio

Ships the existing React UI as a browser SPA at app.omnibioai.org, isolated from the Electron build.

Changes

  • src/ui/lib/web/{platform,webApi,session}.js — standalone web-only modules, not imported by any Electron-shared file. session.js uses relative /auth/* paths instead of a direct http://<lan-ip>:8001 fetch (which a real browser can't reach); swapped in only under --mode web via a vite.config.js resolve.alias.
  • vite.config.js — mode-gated: outDir only becomes dist/web and the alias only applies when mode === 'web'. Electron's build:ui verified unchanged (still outputs to dist/ with the original session.js).
  • Login.jsx, OAuthLinkConfirm.jsx, App.jsx, RoleManagement.jsx, session.js — the OAuth/session-layer work this branch builds on.
  • Dockerfile.web, docker/nginx-web.conf — multi-stage build serving the SPA as static files. No backend proxying in nginx-web.conf — that stays nginx-router.conf's job.
  • docker-compose.yml (build-from-source) / docker-compose.release.yml (image-only) — web-ui service added to each, following this repo's existing split (workbench/control-center use the same pattern: build in the dev compose, image-only in release).
  • docker/nginx-router.conflocation / now proxies to web-ui instead of workbench, making the SPA visible at the domain root. Only that one location block changed — /_svc/workbench (used by Workbench.jsx, Services.jsx, Launch.jsx) is untouched.
  • .github/workflows/build-web.yml — builds and pushes ghcr.io/omnibioai/omnibioai-web on push to main.

Testing

  • npm run web:build ✅ and npm run build:ui (Electron) ✅ — verified independently, distinct output trees, confirming isolation held.
  • docker build -f Dockerfile.web . ✅ — two real bugs found and fixed while testing this (not caught by the host-only npm run web:build, since it doesn't reflect a clean container filesystem):
    • @omnibioai/ui is consumed as prebuilt dist/ output, but .dockerignore excludes **/dist from the build context — added an explicit build step for that package.
    • packages/omnibioai-ui/package-lock.json is out of sync with its own package.json (missing @omnibioai/design-tokens) — used npm install instead of npm ci for that one sub-package rather than hand-patching a vendored lockfile from a separately-maintained package.
  • Container run + curl ✅ — serves the real index.html at /, /_health responds, unknown paths fall through to index.html (200) via SPA routing.
  • nginx -t on nginx-router.conf parses every directive correctly; the only failure is upstream DNS resolution (workbench:8000 etc.), expected when test-running a single container outside the real compose network.

Not yet done

  • Not tested against the full running docker-compose stack (auth, OAuth redirect round-trip, CORS) — only the SPA container in isolation.
  • No image published yet — ghcr.io/omnibioai/omnibioai-web:latest will exist once this CI workflow runs on main.

Deploy

After merge:

docker compose pull web-ui
docker compose up -d web-ui nginx-router

Visit: https://app.omnibioai.org

man4ish added 3 commits July 18, 2026 05:29
Adds a `--mode web` Vite build target that ships the existing React UI
as a browser SPA, kept strictly isolated from the Electron build:

- src/ui/lib/web/{platform,webApi,session}.js — new, standalone web-only
  modules. None are imported by existing Electron-shared files; session.js
  (relative /auth/* paths instead of a direct http://<lan-ip>:8001 fetch,
  which a real browser can't reach) is swapped in only under `--mode web`
  via a vite.config.js resolve.alias, so ../lib/session.js and every file
  that imports it are untouched.
- vite.config.js — mode-gated: outDir only becomes dist/web and the alias
  only applies when mode === 'web'; the default (Electron-facing) build
  path is unchanged (verified: build:ui still outputs to dist/ using the
  original direct-IP session.js).
- package.json web/web:build/web:preview now pass --mode web explicitly.
- docker/nginx-web.conf, Dockerfile.web — static SPA serving for a new
  web-ui container (no backend proxying — that stays nginx-router.conf's
  job).
- docker-compose.yml, docker/nginx-router.conf — new web-ui service +
  upstream. `location /` intentionally left pointed at workbench for now;
  repointing it to serve the SPA at the domain root is a separate,
  deliberate follow-up once nothing else depends on workbench being there.

Verified both build modes independently: `npm run build:ui` (Electron)
and `npm run web:build` (web) both succeed and produce distinct, correct
output trees.
- docker/nginx-router.conf — location / now proxies to web-ui instead of
  workbench, making the SPA visible at the domain root. Only that one
  location block changed; /_svc/workbench (used by Workbench.jsx,
  Services.jsx, Launch.jsx) is untouched — a naive global replace of
  every `proxy_pass http://workbench;` would have broken that route too,
  since the same string appears in both places.

- Dockerfile.web — fixes two build failures found while actually testing
  `docker build`, not just `npm run web:build` on the host:
  1. @omnibioai/ui is consumed as prebuilt dist/ output, but .dockerignore
     excludes **/dist from the build context, so the copied package had
     none. Added an explicit build step for it before the app build.
  2. packages/omnibioai-ui/package-lock.json is out of sync with its own
     package.json (missing @omnibioai/design-tokens) — `npm ci` refuses a
     mismatched lockfile by design. Used `npm install` for that one
     sub-package instead of hand-patching a vendored lockfile from a
     separately-maintained package.
  Verified: `docker build -f Dockerfile.web .` succeeds, the container
  runs, serves the real index.html at /, responds on /_health, and falls
  through unknown paths to index.html (200) via SPA routing.

- .github/workflows/build-web.yml — builds and pushes
  ghcr.io/omnibioai/omnibioai-web on push to main. Adds an explicit
  `permissions: packages: write` block; without it GITHUB_TOKEN can't
  push to ghcr.io and the job 403s.

- docker-compose.release.yml (not docker-compose.yml) gets the image-only
  web-ui service. This repo's existing convention: docker-compose.yml
  builds every service from source (workbench/control-center both keep
  build: active with # image: commented out); docker-compose.release.yml
  is the image-only production compose (workbench there has image: with
  no build: block at all). web-ui follows that same split — its
  build-from-source version stays in docker-compose.yml from the prior
  commit, unchanged.
@man4ish
man4ish merged commit 1ac2c8b into main Jul 18, 2026
2 checks passed
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.

1 participant