Rule: Migrate Google AI Studio prototype to Domo App Platform Custom App (static dist deploy)
You are converting a project that began in Google AI Studio (often Cloud Run / preview oriented) into a Domo App Platform Custom App deployed as static assets via the Domo CLI.
The required deployment contract is:
- must produce a self-contained folder
- must work (Domo serves the app from a subpath, not from site root)
- The app must load assets correctly and not break on refresh/navigation
Detect AI Studio origin
Treat the project as "AI Studio-origin" if you see any of:
- README mentions Google AI Studio / Gemini API / "Build" mode / Cloud Run
- cloudbuild.yaml, Dockerfile, or Cloud Run deploy instructions
- use of
process.env.GEMINI_API_KEY
or placeholders described as "provided by AI Studio"
- structure that runs via a server/container rather than static hosting
If detected, apply the steps below.
Primary objective
Make the project a conventional front-end that:
- runs locally with
- produces production files with into
- can be hosted from a non-root subpath (Domo App Platform)
- does NOT require any server runtime to render the UI
Step 1 — Ensure a standard build pipeline exists
Open
and ensure scripts exist and are correct for the chosen toolchain:
-
If it is Vite:
-
If it is CRA:
- outputs by default (NOT acceptable for our contract)
- Either:
A) migrate to Vite (preferred for App Platform), OR
B) update Domo publish docs/commands accordingly (only if user explicitly wants CRA)
Default to Vite if uncertain.
Acceptance criteria:
- succeeds
- creates with and
Step 2 — Fix base path so assets work in Domo (subpath hosting)
Domo App Platform does NOT host your app at
. It’s under a nested path.
Therefore asset paths MUST be relative or explicitly configured.
-
If Vite: set base to relative
-
If other bundler: ensure the equivalent "public path" is relative.
Acceptance criteria:
- Opening the built from a nested path still loads JS/CSS assets (no 404s).
- No hardcoded absolute asset paths like unless you know the host root.
Step 3 — Make routing robust for static hosting
If the app uses React Router (or any client router):
- Prefer HashRouter for App Platform unless you know the platform provides SPA rewrites.
- If switching to HashRouter is too invasive, document that refresh on deep routes will 404 unless Domo is configured with a rewrite rule.
Default action:
- If router is present and no rewrite control is known: switch to .
Acceptance criteria:
- Built app can navigate and refresh without server rewrites.
Step 4 — Environment variables and secrets: remove AI Studio-only assumptions
AI Studio can "magically" provide placeholders (e.g., Gemini API key) during its hosted run.
In Domo App Platform, the browser cannot safely hold secrets.
Rules:
- Do NOT ship any raw API keys in client code.
- If the UI needs Gemini/LLM calls:
- Prefer Domo AI APIs via domo.js if available/allowed, OR
- Proxy through a backend (e.g., Domo Code Engine) that injects secrets server-side.
- Replace patterns with toolchain-native env usage:
- Add documenting required variables (non-secret only).
Acceptance criteria:
- No committed secrets.
- No runtime crashes from missing AI Studio env injection.
Step 5 — Domo deploy contract
Ensure the final developer workflow is:
If a Domo manifest/config file is required by the App Platform project (e.g.,
), ensure it is located where Domo expects it OR copied into
during build.
If the platform expects the manifest in the root but publishes
, implement one of:
- Copy required config/manifest into as part of build (postbuild script)
- Or adjust publish strategy if the user’s established standard differs
Default:
- Add a script to copy required app platform files into if they are missing there.
Acceptance criteria:
- contains everything needed to publish and run.
- from inside works without manual file copying.
Output requirements (what you must deliver as the assistant)
After applying changes, provide:
- A short list of files changed
- The exact commands to run locally
- A "done checklist" confirming:
- build produces
- assets load under subpath
- routing works (hash router or documented rewrite need)
- no secrets in client
Be decisive; implement changes rather than asking follow-up questions unless blocked by missing files.