dominodatalab/domino-ai-plugin / skills/domino-app-init
domino-app-init
VerifiedScaffold 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.8 KB |
| assets/dash/app.py.template | other | 2.5 KB |
| assets/dash/app.sh | script | 550 B |
| assets/streamlit/app.py.template | other | 1.6 KB |
| assets/streamlit/app.sh | script | 1.5 KB |
| assets/vite-react/.dominoignore | other | 203 B |
| assets/vite-react/.env.example | other | 1.1 KB |
| assets/vite-react/app.sh | script | 1.2 KB |
| assets/vite-react/scripts/build-dist.shexecutable | script | 3.1 KB |
| assets/vite-react/scripts/stamp.shexecutable | script | 701 B |
| assets/vite-react/server.js | script | 4.4 KB |
| assets/vite-react/vite.config.js | script | 1001 B |
assets/dash/app.py.template
View on GitHub"""
Domino Dash application template (Dash 3 or later; app.run_server was removed in Dash 3).
Domino's proxy strips the App's URL prefix before forwarding, so routes are served at "/"
inside the container while the browser requests them under DOMINO_RUN_HOST_PATH.
"""
import os
import requests
from dash import Dash, Input, Output, State, callback, dcc, 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"),
html.Div([
html.P(f"Project: {os.environ.get('DOMINO_PROJECT_NAME', 'n/a')}"),
html.P(f"Started by: {os.environ.get('DOMINO_STARTING_USERNAME', 'n/a')}"),
], style={"color": "gray", "fontSize": "12px"}),
html.Hr(),
html.Div([
html.Label("Feature 1:"),
dcc.Input(id="feature1", type="number", value=0),
html.Label("Feature 2:"),
dcc.Input(id="feature2", type="number", value=0),
html.Button("Predict", id="predict-btn", n_clicks=0),
]),
html.Div(id="prediction-output", style={"marginTop": "20px"}),
])
def predict(features: dict) -> dict:
"""Call a Domino endpoint. MODEL_API_URL and MODEL_API_TOKEN come from the project
environment variables; the token is a Model Access Token created on the endpoint
(Settings > Invocation). Synchronous endpoints use HTTP Basic with the token as
username and password; asynchronous endpoints use Authorization: Bearer instead."""
url = os.environ.get("MODEL_API_URL")
token = os.environ.get("MODEL_API_TOKEN")
if not url or not token:
raise RuntimeError("Set MODEL_API_URL and MODEL_API_TOKEN in the project environment variables")
response = requests.post(url, auth=(token, token), json={"data": features}, timeout=60)
response.raise_for_status()
return response.json()
@callback(
Output("prediction-output", "children"),
Input("predict-btn", "n_clicks"), # only the button triggers the endpoint call
State("feature1", "value"), # State: read on click, not on every keystroke
State("feature2", "value"),
prevent_initial_call=True,
)
def run_prediction(n_clicks, feature1, feature2):
try:
return html.Pre(str(predict({"feature1": feature1, "feature2": feature2})))
except Exception as exc:
return html.P(f"Prediction failed: {exc}", style={"color": "red"})
if __name__ == "__main__":
# Domino requires 0.0.0.0:8888.
app.run(host="0.0.0.0", port=8888, debug=False)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |