Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions content/cookbooks/genie-analytics-app/replit-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Build a Genie Analytics App

Help the user build a Databricks-backed Genie analytics app: a full internal app over Unity Catalog data with a SQL KPI dashboard, table previews, a Genie chat panel, and saved questions.

## Data

Use the Databricks connector for SQL verification and table previews. Use Replit's Databricks Genie integration for the conversational analytics panel.

Ask for:

- Unity Catalog catalog name
- Unity Catalog schema name
- the primary table(s) to analyze
- the Genie space (or table set) to use for natural-language questions
- SQL Warehouse, if not already configured by the connector

If the user does not already have a Genie space, ask whether they want to continue with SQL-only dashboard and previews, configure a Genie space in Databricks first, or use the PAT fallback for direct Genie API access if available.

## Additional Secrets

If the user is on the PAT fallback path and wants direct Genie API access, also ask for:

- `DATABRICKS_GENIE_SPACE_ID` — the Genie space ID to use for conversational analytics. The user can list their Genie spaces with the Databricks CLI — for example, `databricks api get /api/2.0/genie/spaces` — and copy the ID of the space they want to use.

## Features

Build a polished full-stack web app with:

- Multi-tab layout: **Dashboard**, **Tables**, **Ask Genie**, **History**
- Dashboard tab with SQL-driven KPI cards, trend charts, and a free-form filter row
- Tables tab with one preview card per selected table: row count, freshness, schema, and sample rows
- Ask Genie tab with a chat panel for natural-language analytics questions, suggested-question chips generated from the selected tables, and SQL preview/citations when Genie returns query-backed answers
- History tab listing the current session's Genie conversations with the ability to re-run a question or copy its SQL
- A persistent saved-questions sidebar in the Ask Genie tab (kept in browser local storage; no extra Databricks tables required)
- Shareable conversation links so a teammate can open the same question with the same Genie answer
- Empty states, loading states, reconnect states, and clear connection/permission errors

## Build Order

1. Resolve Databricks access per the general routing above.
2. Verify warehouse access with `SELECT current_user()`.
3. Ask for catalog, schema, tables, and Genie space.
4. Build the app shell with the four tabs and shared navigation.
5. Build the Tables tab (preview cards) backed by SQL warehouse queries.
6. Build the Dashboard tab (KPI cards + trend charts) backed by SQL warehouse queries.
7. Add the Genie conversational analytics panel in the Ask Genie tab, with suggested-question chips and SQL preview/citations.
8. Add the History tab and the saved-questions sidebar (local storage).
9. Add shareable conversation links.
10. Run the app in Replit Preview.
11. Help the user deploy with Replit Deployments.
58 changes: 58 additions & 0 deletions content/cookbooks/operational-data-analytics/replit-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Build an Operational Data Analytics App

Help the user build a Databricks-backed operational analytics app over Unity Catalog tables: an internal dashboard for monitoring operational metrics, trends, anomalies, and business KPIs.

## Data

Use the Databricks connector (or PAT fallback) to execute SQL against the user's SQL Warehouse.

Ask for:

- Unity Catalog catalog name
- Unity Catalog schema name
- the operational table or gold aggregate table to analyze
- SQL Warehouse, if not already configured by the connector

If the user does not have an operational analytics table yet, offer to create a small demo table:

```sql
CREATE TABLE IF NOT EXISTS <catalog>.<schema>.operational_metrics (
metric_date DATE,
business_unit STRING,
region STRING,
metric_name STRING,
metric_value DOUBLE,
target_value DOUBLE,
status STRING,
updated_at TIMESTAMP
);
```

## Features

Build a polished full-stack web app with:

- KPI dashboard with current value, target, variance, and trend for each selected metric
- Filters for date range, business unit, region, and metric
- Time-series charts and target comparison charts
- Detail table for drilling into metric rows
- Saved SQL query panel so the user can see and adjust the queries powering the dashboard
- Genie-powered analytics panel for questions like "Which regions are missing target?" and "What changed week over week?"
- Empty states, loading states, clear connection/permission errors

## Build Order

1. Resolve Databricks access per the general routing above.
2. Verify warehouse access with `SELECT current_user()`.
3. Ask for catalog, schema, and target table.
4. Inspect the target table schema if available.
5. Create demo data only if the user wants a sandbox table.
6. Build the dashboard and filter controls.
7. Wire analytics queries to Databricks SQL.
8. Add Genie conversational analytics when available.
9. Run the app in Replit Preview.
10. Help the user deploy with Replit Deployments.

## Notes

This template consumes Unity Catalog tables that already exist or demo tables created through SQL. It does not provision external storage, Lakehouse Sync, or Lakeflow Declarative Pipelines for this Replit version.
76 changes: 76 additions & 0 deletions content/examples/content-moderator/replit-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Build a Content Moderation Console

Help the user build a Databricks-backed content moderation console: an internal app for reviewing submitted content, tracking moderation decisions, and analyzing policy violations.

## Data

Use the Databricks connector (or PAT fallback) to execute SQL against the user's SQL Warehouse.

Ask for:

- Unity Catalog catalog name
- Unity Catalog schema name
- SQL Warehouse, if not already configured by the connector

Create or reuse this table:

```sql
CREATE TABLE IF NOT EXISTS <catalog>.<schema>.moderation_submissions (
submission_id STRING,
content_text STRING,
content_type STRING,
source_channel STRING,
submitted_by STRING,
submitted_at TIMESTAMP,
moderation_status STRING,
policy_category STRING,
severity STRING,
model_score DOUBLE,
reviewer STRING,
reviewer_note STRING,
reviewed_at TIMESTAMP,
updated_at TIMESTAMP
);
```

If the table is empty, offer to seed it with realistic demo submissions across multiple content types, policy categories, and moderation statuses.

## Additional Secrets

If the user wants Databricks Model Serving for automatic scoring, also ask for:

- `DATABRICKS_MODEL_SERVING_ENDPOINT` — the Model Serving endpoint URL.

Model Serving is opt-in; only configure it when the user explicitly asks for AI scoring.

## Features

Build a polished full-stack web app with:

- Moderation dashboard: pending reviews, approved/rejected counts, average severity, review throughput, policy category distribution
- Submission queue with search, filters, severity badges, policy category badges, and moderation status tabs
- Submission detail page with full content, model score, suggested category, reviewer decision controls, and reviewer notes
- Review workflow with approve, reject, escalate, and "needs more context" actions
- Analytics charts powered by SQL Warehouse queries
- Genie-powered analytics panel for questions like "Which policy categories are increasing?" and "Which reviewers have the longest queues?"
- Optional AI scoring flow using Databricks Model Serving when `DATABRICKS_MODEL_SERVING_ENDPOINT` is configured
- Empty states, loading states, clear connection/permission errors

## Build Order

1. Resolve Databricks access per the general routing above.
2. Verify warehouse access with `SELECT current_user()`.
3. Ask for catalog and schema.
4. Create or verify the `moderation_submissions` table.
5. Seed demo data if needed.
6. Build the moderation dashboard and submission queue.
7. Build the submission detail and review workflow.
8. Wire reads, writes, and analytics queries to Databricks SQL.
9. Add Genie conversational analytics when available.
10. Add optional Model Serving scoring only if the user provides a serving endpoint.
11. Run the app in Replit Preview.
12. Help the user deploy with Replit Deployments.

## Notes

If Model Serving fails or is unavailable, keep the moderation queue and SQL dashboard functional and ask whether to continue without AI scoring, configure a serving endpoint, or switch to manual-only moderation.
64 changes: 64 additions & 0 deletions content/examples/inventory-intelligence/replit-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Build an Inventory Intelligence App

Help the user build a Databricks-backed inventory intelligence app: an internal tool for monitoring stock levels, demand, replenishment risk, supplier performance, and inventory value.

## Data

Use the Databricks connector (or PAT fallback) to execute SQL against the user's SQL Warehouse.

Ask for:

- Unity Catalog catalog name
- Unity Catalog schema name
- SQL Warehouse, if not already configured by the connector

Create or reuse this table:

```sql
CREATE TABLE IF NOT EXISTS <catalog>.<schema>.inventory_items (
sku STRING,
product_name STRING,
category STRING,
location STRING,
supplier STRING,
on_hand INT,
reorder_point INT,
target_stock INT,
unit_cost DOUBLE,
trailing_30_day_demand INT,
forecast_30_day_demand INT,
replenishment_status STRING,
updated_at TIMESTAMP
);
```

If the table is empty, offer to seed it with realistic inventory records across categories, locations, and suppliers.

## Features

Build a polished full-stack web app with:

- Inventory dashboard: stockouts, at-risk SKUs, overstock, total inventory value, replenishment workload
- Item table with search, filters, status pills, and editable replenishment status
- Reorder recommendation panel using SQL-derived logic from on-hand quantity, reorder point, and forecast demand
- Supplier and location performance charts
- Category-level inventory value and risk charts
- Genie-powered analytics panel for questions like "Which suppliers have the most at-risk SKUs?" and "What should we reorder this week?"
- Empty states, loading states, clear connection/permission errors

## Build Order

1. Resolve Databricks access per the general routing above.
2. Verify warehouse access with `SELECT current_user()`.
3. Ask for catalog and schema.
4. Create or verify the `inventory_items` table.
5. Seed demo data if needed.
6. Build the inventory dashboard and item table.
7. Wire updates and analytics queries to Databricks SQL.
8. Add Genie conversational analytics when available.
9. Run the app in Replit Preview.
10. Help the user deploy with Replit Deployments.

## Notes

If the user wants AI forecasting from Databricks Model Serving, ask whether to add Databricks PAT access for that specific feature. Otherwise, Model Serving is out of scope for this Replit version.
62 changes: 62 additions & 0 deletions content/examples/saas-tracker/replit-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Build a SaaS Subscription Tracker

Help the user build a Databricks-backed SaaS Subscription Tracker: an internal app for tracking SaaS tools, owners, costs, billing cycles, status, categories, and renewal dates.

## Data

Use the Databricks connector (or PAT fallback) to execute SQL against the user's SQL Warehouse.

Ask for:

- Unity Catalog catalog name
- Unity Catalog schema name
- SQL Warehouse, if not already configured by the connector

Create or reuse this table:

```sql
CREATE TABLE IF NOT EXISTS <catalog>.<schema>.subscriptions (
id STRING,
name STRING,
vendor STRING,
category STRING,
owner STRING,
cost DOUBLE,
billing_cycle STRING,
status STRING,
renewal_date DATE,
notes STRING,
created_at TIMESTAMP
);
```

If the table is empty, offer to seed it with realistic demo subscriptions.

## Features

Build a polished full-stack web app with:

- Dashboard: total monthly spend, annualized spend, renewals due soon, active subscriptions, spend by category
- Genie-powered conversational analytics panel for questions like "Which renewals are coming up this month?" and "Which teams have the highest SaaS spend?"
- Subscription table with search and filters
- Add/edit/delete subscription flow
- Renewal timeline
- Category and owner breakdown charts
- Empty states, loading states, clear error handling

## Build Order

1. Resolve Databricks access per the general routing above.
2. Verify warehouse access with `SELECT current_user()`.
3. Ask for catalog and schema.
4. Create or verify the `subscriptions` table.
5. Seed demo data if needed.
6. Build the app UI.
7. Wire CRUD and analytics queries to Databricks SQL.
8. Add Genie conversational analytics when available.
9. Run the app in Replit Preview.
10. Help the user deploy with Replit Deployments.

## Notes

Genie is the preferred path for conversational analytics. If Replit's Databricks Genie integration is unavailable, keep the SQL dashboard functional and ask the user whether to configure Genie access, continue without it, or switch to the original Databricks DevHub workflow.
61 changes: 61 additions & 0 deletions content/examples/vacation-rentals/replit-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Build a Vacation Rentals Operations Console

Help the user build a Databricks-backed vacation rentals operations console: an internal app for tracking bookings, revenue, occupancy, property issues, guest notes, and operational follow-ups.

## Data

Use the Databricks connector (or PAT fallback) to execute SQL against the user's SQL Warehouse.

Ask for:

- Unity Catalog catalog name
- Unity Catalog schema name
- SQL Warehouse, if not already configured by the connector

Create or reuse this table:

```sql
CREATE TABLE IF NOT EXISTS <catalog>.<schema>.vacation_rental_bookings (
booking_id STRING,
property_id STRING,
property_name STRING,
market STRING,
guest_name STRING,
check_in DATE,
check_out DATE,
nights INT,
revenue DOUBLE,
channel STRING,
status STRING,
issue_status STRING,
owner_note STRING,
updated_at TIMESTAMP
);
```

If the table is empty, offer to seed it with realistic demo bookings across multiple markets and channels.

## Features

Build a polished full-stack web app with:

- Operations dashboard: revenue, occupancy, average daily rate, open issues, upcoming check-ins
- Booking queue with search, filters, status updates, issue status updates, and owner notes
- Property performance table by market and property
- Calendar-style upcoming arrivals and departures panel
- Revenue and occupancy charts powered by SQL Warehouse queries
- Genie-powered analytics panel for questions like "Which markets are underperforming?" and "Which properties have the most open issues?"
- Empty states, loading states, clear connection/permission errors

## Build Order

1. Resolve Databricks access per the general routing above.
2. Verify warehouse access with `SELECT current_user()`.
3. Ask for catalog and schema.
4. Create or verify the `vacation_rental_bookings` table.
5. Seed demo data if needed.
6. Build the operations dashboard and booking queue.
7. Wire updates and analytics queries to Databricks SQL.
8. Add Genie conversational analytics when available.
9. Run the app in Replit Preview.
10. Help the user deploy with Replit Deployments.
Loading