Scaffold a new Domino-ready web application (Vite + React, Streamlit, Dash, Flask, Gradio or FastAPI) with the settings Domino's reverse proxy needs, the mandatory 0.0.0.0:8888 binding, DOMINO_RUN_HOST_PATH prefixes, server-side model endpoint calls, and an app.sh entry point. Use when the user wants to start, initialize, create or scaffold a new app to publish on Domino, or asks for a starter app.sh or starter app for a web framework on Domino.
98%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Applies to Domino 6.3 and Domino Cloud.
Create a web application that works behind Domino's reverse proxy on the first publish.
Every App must be idempotent: it restarts at any time and can run as several replicas at once, so app.sh only starts the server (migrate and seed in a Job), each write is an upsert or carries an idempotency key under a unique constraint, so a retry stores it once, and state lives in a Dataset or database (details).
Collect these before writing files. Skip any the user has already given.
vite-react (default), streamlit, dash, flask, gradio or fastapi.package.json name (React only).MODEL_API_URL and MODEL_API_TOKEN as Domino Project variables, never in the repository. The URL comes from the user; the token is the user's or one you create and store (FRAMEWORKS.md).If the target directory already contains an app, stop and ask before overwriting anything.
Copy the matching template from this skill's assets/ folder into the project:
| Framework | Files to copy |
|---|---|
vite-react | From assets/vite-react/: vite.config.js, app.sh, server.js, scripts/build-dist.sh, scripts/stamp.sh, .env.example, .dominoignore (run npm create vite@9.3.4 first if there is no Vite project yet; server.js needs no packages) |
streamlit | assets/streamlit/app.sh, and assets/streamlit/app.py.template saved as app.py |
dash | assets/dash/app.sh, and assets/dash/app.py.template saved as app.py |
flask, gradio, fastapi | No template; write the files from the snippets below |
Make app.sh and scripts/*.sh executable (chmod +x) and commit the mode (git update-index --chmod=+x app.sh).
Keep these invariants in every generated file:
0.0.0.0 on port 8888. Domino requires both; an App on any other address or port fails to start.DOMINO_RUN_HOST_PATH (Dash requests_pathname_prefix, Gradio root_path). Never build the prefix from project owner, name and run ID.base: './', use HashRouter, and make this the first line of <head> in index.html (the App URL also answers without its trailing slash): <script>if (!location.pathname.endsWith('/')) location.replace(location.pathname + '/' + location.search + location.hash)</script>.Authorization token, not domino-username alone (viewer.py in FRAMEWORKS.md).VITE_ variable, no token in the repo.app.sh never installs or builds; it serves a dated build scripts/build-dist.sh made (why).Add .env, .env.local, node_modules/, build/ and dist/ to .gitignore; keep .env.example. In a DFS Project add node_modules/ and build/ to the .dominoignore at the Project root (Domino reads only that one).
Check that the framework is in the Compute Environment. The App runs in the project's environment, without what you pip install in a Workspace (streamlit: not found, exit 127). Run python -c "import streamlit" (or dash, flask, gradio, fastapi). Vite: the App needs node 18+, the build Node 20.19+ with npm (REACT-VITE-GUIDE.md). If missing: an environment with the package (best), requirements.txt at the project root, or pip install in app.sh for a prototype (trade-offs).
Finish with the post-initialization checklist.
app.py (Dash 3 removed run_server)import os
from dash import Dash, html
app = Dash(__name__, routes_pathname_prefix="/",
requests_pathname_prefix=os.environ.get("DOMINO_RUN_HOST_PATH"))
app.layout = html.Div([html.H1("Domino Dash App")])
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8888, debug=False)app.py and app.shfrom flask import Flask, request
from viewer import viewer_name # viewer.py from domino-apps/FRAMEWORKS.md
app = Flask(__name__)
@app.route("/")
def index():
return f"Hello {viewer_name(request.headers) or 'viewer'}"
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8888, debug=False)#!/bin/bash
set -e
cd "$(dirname "$0")"
python app.pyapp.py (same app.sh as Flask)import os
import gradio as gr
demo = gr.Interface(fn=lambda text: text, inputs="text", outputs="text")
if __name__ == "__main__":
demo.launch(server_name="0.0.0.0", server_port=8888,
root_path=os.environ.get("DOMINO_RUN_HOST_PATH", ""))app.py and app.shfrom fastapi import FastAPI
app = FastAPI()
@app.get("/")
def index():
return {"message": "Domino FastAPI App"}#!/bin/bash
set -e
cd "$(dirname "$0")"
uvicorn app:app --host 0.0.0.0 --port 8888import os, requests
token = os.environ["MODEL_API_TOKEN"]
resp = requests.post(os.environ["MODEL_API_URL"], auth=(token, token), # synchronous endpoint
json={"data": {"feature1": 1.0}}, timeout=60)Asynchronous endpoints take Authorization: Bearer instead.
Tell the user to:
MODEL_API_URL and MODEL_API_TOKEN (if used) in the project's environment variables (see Inputs for where each comes from).bash scripts/build-dist.sh (DIST_DIR=dist in a DFS Project) after every code change. An App runs the project's committed files, not the Workspace's working copy. DFS project: File Changes > Sync to Domino (or the bundled MCP server's upload tool), then check app.sh and app.py under Code. Git-based: git add, git commit, git push, then Sync All Changes to save a Vite build in /mnt/artifacts. Over the API, pin content.dfsCommitId to the uploaded commit (API-APPS.md).app.sh.app.sh, and test: it runs the latest committed code in the real App runtime with the proxy prefix.More: domino-apps (deploy, CI/CD, frameworks), domino-debug-proxy (404s, blank pages, routing), domino-ui-bootstrap (design system).
dominodatalab/domino-claude-plugin
6e5879f
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.