Documentation Index
Fetch the complete documentation index at: https://domoinc-arun-raj-connectors-domo-479695-remove-crime-report.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Intro
This tutorial walks through building an AI-powered book recommender with React, TypeScript, Ant Design, and Domo’s AI Service Layer. You’ll learn how to:
- Scaffold a Vite + React + TypeScript app with the DA CLI
- Search a public API (Open Library) with debounced queries as the user types
- Call Domo’s AI text generation endpoint with a structured system prompt and parse the JSON response
- Build a polished Ant Design form and results view
Prerequisite: Complete the Setup and Installation guide and run
domo login before starting. Your Domo instance needs access to the AI Service Layer.Step 1: Install the DA CLI and scaffold the app
The DA CLI clones the @domoinc/vite-react-template — a Vite + React + TypeScript project preconfigured with the Domo proxy, ESLint, Prettier, Vitest, Storybook, and
da generate scaffolding.
Install the CLI globally:
da new prompts for a package manager (pick pnpm), clones the template, writes your app name, initializes git, and installs dependencies.
Add the runtime dependencies we’ll use beyond the scaffold:
- Ant Design (
antd) — the UI component library we’ll use for the select inputs and buttons. ryuu.js— the Domo JS client for calling Domo platform APIs (the AI Service Layer in this case) through the dev-server proxy.
Step 2: Add static assets
Drop the background image and divider graphic into
public/static/:
bookshelf.jpeg— full-bleed backgroundchapter_divider.png— decorative divider under the heading
public/static/, or swap in your own. Vite serves anything in public/static/ at the /static/ path at runtime.
Step 3: Publish the initial design and wire the proxy
Calls to Domo APIs (including the AI Service Layer) go through the dev-server proxy, which needs a
proxyId to authorize requests. That means we need to publish a skeleton, create a proxy card, and paste the IDs back into manifest.json.
First, set the app metadata. Replace public/manifest.json with:
pnpm build and domo publish from the build/ folder. The output prints a link to the new App Design.
In the Domo UI:
- Open the App Design link — or go to More → Asset Library and find your design.
- Click New Card. This app doesn’t use a dataset, so you can save the card without selecting one — we just need it to generate a
proxyId. - Save the card.
id and the card’s proxyId from the design page, and add both to public/manifest.json:
Step 4: Build the App component
The whole app lives in one component:
src/components/App/App.tsx. It has three responsibilities:
- Search Open Library as the user types — debounced, so we don’t hammer the API.
- Collect preferences — favorite books (multi-select), genre, mood, and length.
- Submit to Domo’s AI service and render a grid of recommendations.
App.tsx already — replace its contents with:
export const App: FC = () => {:
matchingBooks is what the dropdown currently shows; allBooks is a running union of every book we’ve fetched so far, so when the user selects one from an old search we can still resolve it by key.
Debounced Open Library search.
fetch here hits Open Library directly — it’s a public API, no Domo proxy involved.
Step 5: Call the Domo AI service
Domo’s AI Service Layer exposes
/domo/ai/v1/text/generation for text generation. We pass three things:
input— the structured user querypromptTemplate.template— wraps the input (the${input}placeholder is replaced server-side)system— the system prompt that forces JSON-only output
choices[0].output string that we strip of any code-fence wrapping and parse as JSON.
Step 6: Render the form and results
Still inside
App:
App.module.scss in the sample repo or write your own.
Step 7: Test locally
proxyId is set, domo.post('/domo/ai/v1/text/generation', ...) is authenticated through the proxy to your real Domo instance — you should see real recommendations come back in a few seconds.
Step 8: Publish
Next steps
- Stream results incrementally by swapping
/domo/ai/v1/text/generationfor the streaming variant and parsing partial chunks. - Persist favorite-book lists per user with an AppDB collection (see the Todo App tutorial).
- Swap Open Library for Google Books or any other search API — the debounce pattern is the same.
- Continue with Mapbox World Map or Todo App with AppDB.