# Nation dashboard presets: guide for Claude

You're helping someone make a **preset** for a Nation-style e-commerce Analytics dashboard. (Nation is an AI-native storefront app; this dashboard copies its Analytics page.) A preset is **one JSON file**. The person uploads it at <https://nation-analytics-demo.vercel.app> with the **New** button, and the site draws the whole dashboard from it: KPI tiles, a running-total sales chart, the sales breakdown, channels, products, the conversion funnel, customers, devices, countries, referrers and recent orders.

Each preset also gets a **public link** that shows only the cards the file allows, as a fixed snapshot of its period (see "The public link" below).

Your job: turn their request (for example *"a store that made $20,000 in 30 days, growing steadily"*) into one JSON file that follows this guide exactly. A complete working example is at the end.

## What to hand back

- The file holds one JSON object and nothing else: no comments, no trailing commas. Put it in a single ```` ```json ```` block (or a `.json` file) the person can save and upload. A line or two of explanation outside the block is fine.
- Numbers are plain JSON numbers: no `$`, no thousands separators, no numbers in quotes.
- If you can run code, generate the daily arrays with a short script and check the rules below before answering. It is far more reliable than typing 150 numbers by hand.
- If the request leaves something open (store type, products, period), choose something believable and say in one line what you chose.

## What you provide and what the dashboard computes

You give **daily figures** for two periods: the current one and the one it's compared with. The page computes every total and percentage from them, so the cards always agree with each other. Don't try to pass totals; there are no fields for them.

| Shown on the dashboard | Computed as |
|---|---|
| Total sales | sum of `current.sales` |
| Orders | sum of `current.orders` |
| Conversion rate | sum of orders ÷ sum of sessions × 100 |
| Average order value | total sales ÷ orders |
| Customers | sum of `newCustomers` + sum of `returningCustomers` (each day counts the customers who ordered that day) |
| "Previous period" figures | the same sums over `previous` |
| % change badges | (current ÷ previous − 1) × 100; shows "—" when the previous figure is 0 |
| **Total sales over time** chart | running total of `current.sales`: it only ever rises, steeply on big days and nearly flat on quiet ones. The dashed line is the running total of `previous.sales` |
| Net sales | total sales − shipping − taxes |
| Gross sales | net sales + discounts + returns |
| Sessions (funnel, devices, referrers) | sum of `current.sessions` |
| Sales per country | total sales × share ÷ 100 |
| Sessions per referrer | sessions × share ÷ 100 |
| Units sold | sum of `products[].units` |
| Best-seller share | largest product revenue ÷ total sales |
| Daily AOV and conversion lines | 5-day rolling ratios of the daily arrays |
| "Last N days" | N = number of days in the daily arrays |

## Field reference

All fields are required unless marked *optional*.

| Field | Type | Meaning and limits |
|---|---|---|
| `schema` | string | Exactly `"nation-dashboard-preset/v1"` |
| `name` | string ≤ 80 | Title of the preset in the gallery, e.g. `"Brewlark: $20K, steady growth"` |
| `description` | string ≤ 200, *optional* | One line shown when hovering the gallery card |
| `currencySymbol` | string ≤ 3, *optional* | Default `"$"` |
| `store.name` | string ≤ 40 | Store name in the sidebar; its first letter is the store's avatar |
| `store.account` | string ≤ 60, *optional* | Shown at the bottom of the sidebar, e.g. `"hello@brewlark.store"` |
| `store.visitorsNow` | whole number, *optional* | "N visitors right now" (drifts a little on screen) |
| `period.start` | `"YYYY-MM-DD"` | First day of the current period |
| `period.previousStart` | `"YYYY-MM-DD"`, *optional* | First day of the comparison period. Default: the N days right before `start` |
| `public.cards` | array of card ids, *optional* | Which cards the public link shows (ids under "The public link"). Default: the four tiles, `salesOverTime`, `salesByChannel`, `salesByProduct` |
| `public.asOf` | `"YYYY-MM-DD"`, *optional* | The "figures as of" date on the public link; on or after the period's last day. Default: the period's last day |
| `current.sales` | array of numbers | Money taken each day (≥ 0, at most 2 decimals) |
| `current.orders` | array of whole numbers | Orders each day |
| `current.sessions` | array of whole numbers | Store visits each day |
| `current.newCustomers` | array of whole numbers | First-time customers who ordered that day |
| `current.returningCustomers` | array of whole numbers | Repeat customers who ordered that day |
| `previous.*` | same five arrays | The comparison period, same length as `current` |
| `breakdown.current` | object | `discounts`, `returns`, `shipping`, `taxes`: money totals for the current period |
| `breakdown.previous` | object | Same four fields for the previous period |
| `funnel.addedToCart` | whole number | Sessions that added something to the cart (current period) |
| `funnel.reachedCheckout` | whole number | Sessions that reached checkout |
| `channels` | 1–6 × `{name, share}` | Share of sales by channel, %. Must add up to 100. The first one is drawn green, the rest grey. Typical names: Online store, Instagram, TikTok, ChatGPT, Google, Facebook |
| `channelHighlights.fastestGrowing` | string ≤ 30 | Name of the fastest-growing channel |
| `channelHighlights.fastestGrowth` | number | Its growth, % (shown as "+184%") |
| `channelHighlights.socialShare` | number 0–100 | Sum of the social channels' shares in `channels` (Instagram, TikTok, Facebook, Pinterest, YouTube, X), % |
| `channelHighlights.aiShare` | number 0–100 | Share of the AI-assistant channel in `channels` (e.g. ChatGPT), % (labelled "From ChatGPT"); 0 if there is none |
| `products` | 1–6 × `{name, revenue, units, icon?, image?}` | Top products for the current period. `name` ≤ 60, `revenue` money after discounts, `units` whole number. `icon`: a Phosphor icon name (list below). `image`: an `https://` picture URL, used instead of the icon |
| `productStats.sellThrough` | number 0–100 | Sell-through, % |
| `aovStats.itemsPerOrder` | number ≥ 1 | Shown with 1 decimal |
| `aovStats.thresholdAmount` | number | e.g. `60` → "Orders $60+" |
| `aovStats.shareOverThreshold` | number 0–100 | Share of orders above that amount, % |
| `aovStats.largestOrder` | money | Largest single order |
| `devices` | 1–4 × `{name, share}` | Share of sessions by device, %. Must add up to 100. Usually Mobile, Desktop, Tablet |
| `countries` | 1–6 × `{code, name, share}` | Share of sales by country, %. `code` is a 2-letter uppercase code like `"US"`. Shares add up to 100 or less |
| `referrers` | 1–6 × `{name, share, icon?}` | Share of sessions by source, %. Add up to 100 or less. `icon` is one of: `instagram`, `tiktok`, `google`, `chatgpt`, `facebook`, `pinterest`, `youtube`, `x`, `reddit`, `email`, `direct`, `other` |
| `recentOrders` | 0–10 × object | Newest first, as of the end of the period. `number` whole: sequential order numbers counting down; the newest ≈ 1000 + every order the store has ever had. `when` ≤ 20 chars ("Just now", "14 min ago", "2 hr ago"). `customer` ≤ 40. `item` ≤ 60: use a product's exact name to show its icon. `quantity` whole ≥ 1. `total` money ≈ price × quantity + tax + shipping. `fulfilled` `true`/`false`: the newest one or two are usually not fulfilled yet |

**Product icons** that exist: `t-shirt`, `hoodie`, `pants`, `dress`, `sock`, `sneaker`, `high-heel`, `baseball-cap`, `watch`, `sunglasses`, `diamond`, `handbag`, `backpack`, `wallet`, `notebook`, `book-open`, `book-open-text`, `pen-nib`, `calendar-dots`, `palette`, `paint-brush`, `scissors`, `coffee`, `wine`, `cookie`, `pizza`, `hamburger`, `ice-cream`, `bowl-food`, `jar`, `leaf`, `flower`, `plant`, `drop`, `sparkle`, `pill`, `first-aid-kit`, `heart`, `baby`, `dog`, `cat`, `bone`, `paw-print`, `lamp`, `armchair`, `couch`, `bed`, `cooking-pot`, `headphones`, `device-mobile`, `laptop`, `camera`, `game-controller`, `guitar`, `lego`, `puzzle-piece`, `bicycle`, `barbell`, `basketball`, `football`, `tent`, `mountains`, `sun`, `umbrella`, `gift`, `package`, `tag`. Without `icon` or `image`, a package icon is shown.

## The public link

Every preset has a public link, `https://nation-analytics-demo.vercel.app/s/<id>` (the globe button on its gallery card opens it). The full dashboard at `/p/<id>` shows everything; the public link is the version meant for sharing:

- It shows only the cards in `public.cards`, always in the dashboard's own layout order, and the server sends it only the data those cards need.
- It reads as a fixed snapshot, never as live data: the period is written out ("Oct 1–30, 2026, compared with Sep 1–30, 2026"), a line says the figures are as of `public.asOf`, and nothing on it ticks or says "Just now".
- Customer names, order times, the live visitor count, `store.account` and the preset's `name` never appear on it, even when `recentOrders` is public.

**Turning sections on and off:** to show a section on the public link, add its id (from the table below) to `public.cards`; to hide it, remove the id. This only affects the public link; the full dashboard at `/p/<id>` always shows every section.

Ask the person which metrics they're comfortable sharing. If they don't say, list the four tiles, `salesOverTime`, `salesByChannel` and `salesByProduct`, and leave out `recentOrders`, `salesBreakdown` and `conversionFunnel`.

| Card id | What it shows |
|---|---|
| `totalSalesTile` | Total sales tile, with its change and a small running-total line |
| `ordersTile` | Orders tile |
| `conversionRateTile` | Conversion rate tile |
| `averageOrderValueTile` | Average order value tile |
| `salesOverTime` | The running-total sales chart against the previous period |
| `salesBreakdown` | Gross sales, discounts, returns, net sales, shipping, taxes, total |
| `salesByChannel` | Channel donut with the fastest-growing channel, social share and ChatGPT share |
| `averageOrderValue` | Daily average order value chart with items per order, share of large orders and the largest order |
| `salesByProduct` | Top products with revenue, units sold, best-seller share and sell-through |
| `conversionFunnel` | Sessions → added to cart → reached checkout → orders |
| `customersOverTime` | New and returning customers per day |
| `sessionsByDevice` | Mobile, desktop and tablet split of sessions |
| `salesByCountry` | Sales per country |
| `sessionsByReferrer` | Sessions per traffic source |
| `recentOrders` | Latest orders: number, item, total, payment and fulfilment (on the public link, no customer names or times) |

## Rules the site enforces

An upload that breaks any of these is refused, with a list of what to fix.

1. `schema` is exactly `"nation-dashboard-preset/v1"`.
2. All ten daily arrays (`current` and `previous`, five each) have the same length, between 7 and 90 days.
3. Every daily value is ≥ 0. `sales` has at most 2 decimals; the other arrays are whole numbers.
4. On every day of both periods:
   - `orders` ≤ `sessions`
   - `newCustomers` + `returningCustomers` ≤ `orders`
   - a day with orders has sales above 0, and a day with sales has at least 1 order.
5. `current.sales` adds up to more than 0.
6. In each `breakdown` period, `shipping` + `taxes` ≤ that period's total sales.
7. Funnel: total sessions ≥ `addedToCart` ≥ `reachedCheckout` ≥ total orders.
8. `channels` and `devices` shares add up to 100 (±0.5). `countries` and `referrers` add up to 100 or less.
9. `products` revenues add up to no more than total sales.
10. `aovStats.largestOrder` ≥ the average order value (total sales ÷ orders).
11. Text lengths, list sizes and icon names are as in the field reference.
12. `public.cards` uses only the card ids listed under "The public link", each at most once; `public.asOf` is on or after the period's last day.

A previous period with no sales at all is accepted; its % changes show as "—".

## Making the numbers believable

**Hit the requested total exactly.** Work in cents: make a weight for each day, scale the weights to the target in cents, round each day down, and put the leftover cents on the last day. Check the sum in cents, not with a floating-point sum, which can print 19999.999….

**Dates.** The current period usually ends today or yesterday; `recentOrders` describe the last hours of the period. `previousStart` can be left out when the comparison period is the N days right before.

**Choose the growth shape from the request:**

- *Steady growth* (default growth vs the previous period: +25% to +50%): daily sales rise smoothly from about 75% to about 125% of the current daily average, with ±8% noise and a light weekly rhythm (weekends about +10%). Give the previous period a gentle rise too, from about 85% to about 115% of its own average, so it ends close to where the current period starts. The running total curves gently upward with no jumps.
- *Spiky or viral*: quiet days at 30–50% of the average, spike days at 2.5–3.5× (a TikTok video taking off, a weekend sale, a creator post), and 1–2 elevated days after each spike. The running total shows flat stretches and steep steps. This is what the Folionest example does.
- *Flat or mature*: daily sales stay within ±15% of the average, and the previous period looks much the same.
- *Slowing down*: daily sales fall over the period. The running total still only rises, just more slowly.
- *New store*: for a store that opened partway through the previous period, use 0 on every day before launch, in all five previous arrays.

**The other numbers:**

- *Previous period*: previous total ≈ current total ÷ (1 + growth).
- *Orders*: total orders = total sales ÷ a believable average order value ($25–$120 for most online stores). Spread them roughly in proportion to daily sales, letting the day's average order value wander ±10%, as whole numbers with at least 1 on every day that has sales.
- *Sessions*: conversion (orders ÷ sessions) is usually 1–4%. Daily sessions loosely follow daily sales.
- *Customers*: each day's new + returning count is a little below that day's orders. Over the period, customers come out about 5–10% below orders. Returning share: a new store goes from 0 to about 15% over the period; an established store holds 20–35%.
- *Breakdown*: work it out in this order and round to whole dollars.
  1. shipping ≈ orders × $2–4 (0 with free shipping)
  2. net = (total − shipping) ÷ (1 + tax rate), with a tax rate of 5–8%
  3. taxes = total − shipping − net
  4. gross = net ÷ (1 − discount rate − return rate), with discounts 5–12% and returns 1–4% of gross
  5. discounts = gross × discount rate
  6. returns = gross − net − discounts

  The dashboard recomputes net and gross from these four numbers, so small rounding is fine.
- *Funnel*: `addedToCart` ≈ 6–10% of sessions, `reachedCheckout` ≈ 40–50% of `addedToCart`, and never below total orders.
- *Products*: 3–6 items. Units ≈ revenue ÷ price. Listing only the top products is fine, so revenues may add up to less than the total.
- *The small figures*:
  - `store.visitorsNow`: about 1–3% of an average day's sessions
  - `productStats.sellThrough`: 55–85%
  - `channelHighlights.fastestGrowth`: 20–200%
  - `aovStats.itemsPerOrder`: 1.1–2.0, close to total units ÷ orders when the products cover most sales
  - `aovStats.thresholdAmount`: about 1.3 × the average order value, rounded to 10
  - `aovStats.shareOverThreshold`: 15–35%
  - `aovStats.largestOrder`: 3–5 × the average order value
- *Consistency*: product names in `recentOrders` match `products[].name`; `socialShare` and `aiShare` match the shares in `channels`; `aovStats` fit the average order value.

## Checklist before you answer

- [ ] `schema` is `"nation-dashboard-preset/v1"`, and every required field is present.
- [ ] Ten daily arrays of the same length. Check in cents: sum of `current.sales` equals the requested total.
- [ ] Every day passes: orders ≤ sessions, customers ≤ orders, sales > 0 exactly on days with orders.
- [ ] Funnel order holds: sessions ≥ added to cart ≥ reached checkout ≥ orders.
- [ ] Channels and devices add up to 100; countries and referrers add up to 100 or less.
- [ ] Product revenues ≤ total sales; largest order ≥ average order value.
- [ ] `public.cards` lists only what the person is happy to show publicly.
- [ ] Plain JSON: no comments, no trailing commas, numbers not in quotes.

## Complete example: the built-in "Folionest" preset

A stationery store that opened on September 14 and took **$6,084 in its first full month** (October 1–30, 2026), with spikes on October 9 (a TikTok video), October 17–18 (a weekend sale) and October 24 (a creator post). The comparison period is September 1–30, which is zero until launch day. Its public link shows the four tiles, the sales chart, channels, products and countries.

```json
{
  "schema": "nation-dashboard-preset/v1",
  "name": "Folionest: $6K in its first full month",
  "description": "A stationery store that launched mid-September and reached $6,084 in 30 days, with spikes from a TikTok video, a weekend sale and a creator post.",
  "currencySymbol": "$",
  "store": { "name": "Folionest", "account": "hello@folionestshop.com", "visitorsNow": 6 },
  "period": { "start": "2026-10-01", "previousStart": "2026-09-01" },
  "public": {
    "cards": ["totalSalesTile", "ordersTile", "conversionRateTile", "averageOrderValueTile", "salesOverTime", "salesByChannel", "salesByProduct", "salesByCountry"]
  },
  "current": {
    "sales": [73.09, 114.21, 117.69, 43.31, 35.11, 87.71, 108.57, 106.24, 480.16, 296.86, 209.68, 161.24, 56.08, 36.38, 86.72, 186.57, 490.4, 341.29, 147.52, 89.95, 72.44, 241.56, 232.64, 737.93, 437.02, 194.08, 138.79, 133.21, 227.86, 399.69],
    "orders": [2, 2, 3, 1, 1, 2, 2, 2, 10, 6, 4, 3, 1, 1, 2, 4, 10, 7, 3, 2, 2, 5, 5, 16, 9, 4, 3, 3, 5, 9],
    "sessions": [115, 152, 155, 86, 78, 129, 147, 145, 412, 290, 227, 190, 99, 79, 128, 210, 419, 321, 179, 131, 115, 251, 244, 569, 385, 216, 172, 167, 241, 360],
    "newCustomers": [2, 2, 3, 1, 1, 2, 2, 2, 9, 5, 4, 3, 1, 1, 2, 4, 8, 5, 3, 2, 2, 4, 4, 12, 7, 3, 2, 2, 4, 6],
    "returningCustomers": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 3, 1, 1, 1, 1, 1, 2]
  },
  "previous": {
    "sales": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60.09, 50.24, 36.55, 45.11, 59.7, 73.4, 75.2, 107.69, 65.58, 86.21, 62.99, 129.65, 99.8, 155.44, 88.17, 97.54, 144.64],
    "orders": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 3, 2, 2, 1, 3, 2, 4, 2, 2, 3],
    "sessions": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 93, 76, 87, 104, 120, 122, 157, 111, 134, 108, 180, 149, 205, 137, 147, 195],
    "newCustomers": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 3, 2, 2, 1, 3, 2, 4, 2, 2, 3],
    "returningCustomers": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  },
  "breakdown": {
    "current": { "discounts": 579, "returns": 128, "shipping": 374, "taxes": 323 },
    "previous": { "discounts": 176, "returns": 22, "shipping": 96, "taxes": 76 }
  },
  "funnel": { "addedToCart": 474, "reachedCheckout": 212 },
  "channels": [
    { "name": "Online store", "share": 48 },
    { "name": "Instagram", "share": 22 },
    { "name": "TikTok", "share": 17 },
    { "name": "ChatGPT", "share": 8 },
    { "name": "Google", "share": 5 }
  ],
  "channelHighlights": { "fastestGrowing": "TikTok", "fastestGrowth": 184, "socialShare": 39, "aiShare": 8 },
  "products": [
    { "name": "Linen Desk Folio, Sand", "revenue": 1886, "units": 31, "icon": "notebook" },
    { "name": "A5 Leather Journal Cover", "revenue": 1460, "units": 31, "icon": "book-open-text" },
    { "name": "Weekly Planner Refill 2027", "revenue": 1156, "units": 45, "icon": "calendar-dots" },
    { "name": "Canvas Document Wallet", "revenue": 913, "units": 24, "icon": "wallet" },
    { "name": "Brass Pen Loop, Set of 2", "revenue": 669, "units": 35, "icon": "pen-nib" }
  ],
  "productStats": { "sellThrough": 68 },
  "aovStats": { "itemsPerOrder": 1.3, "thresholdAmount": 60, "shareOverThreshold": 21, "largestOrder": 186 },
  "devices": [
    { "name": "Mobile", "share": 74 },
    { "name": "Desktop", "share": 23 },
    { "name": "Tablet", "share": 3 }
  ],
  "countries": [
    { "code": "US", "name": "United States", "share": 64 },
    { "code": "CA", "name": "Canada", "share": 12 },
    { "code": "GB", "name": "United Kingdom", "share": 10 },
    { "code": "AU", "name": "Australia", "share": 8 },
    { "code": "DE", "name": "Germany", "share": 6 }
  ],
  "referrers": [
    { "name": "Instagram", "share": 33, "icon": "instagram" },
    { "name": "TikTok", "share": 26, "icon": "tiktok" },
    { "name": "Google", "share": 15, "icon": "google" },
    { "name": "Direct", "share": 14, "icon": "direct" },
    { "name": "ChatGPT", "share": 12, "icon": "chatgpt" }
  ],
  "recentOrders": [
    { "number": 1162, "when": "Just now", "customer": "Olivia Martin", "item": "Linen Desk Folio, Sand", "quantity": 1, "total": 61.48, "fulfilled": false },
    { "number": 1161, "when": "14 min ago", "customer": "Sofia Reyes", "item": "Weekly Planner Refill 2027", "quantity": 2, "total": 54.83, "fulfilled": false },
    { "number": 1160, "when": "52 min ago", "customer": "Emma Lindqvist", "item": "A5 Leather Journal Cover", "quantity": 1, "total": 50.59, "fulfilled": true },
    { "number": 1159, "when": "1 hr ago", "customer": "Ava Thompson", "item": "Canvas Document Wallet", "quantity": 1, "total": 42.11, "fulfilled": true },
    { "number": 1158, "when": "2 hr ago", "customer": "Mia Kowalski", "item": "A5 Leather Journal Cover", "quantity": 2, "total": 93.28, "fulfilled": true },
    { "number": 1157, "when": "3 hr ago", "customer": "Chloe Nguyen", "item": "Brass Pen Loop, Set of 2", "quantity": 1, "total": 23.03, "fulfilled": true },
    { "number": 1156, "when": "5 hr ago", "customer": "Isabella Rossi", "item": "Linen Desk Folio, Sand", "quantity": 1, "total": 61.48, "fulfilled": true }
  ]
}
```
