diff --git a/backend/src/main/resources/content/platform/frontend-template/overview.md b/backend/src/main/resources/content/platform/frontend-template/overview.md new file mode 100644 index 0000000..83666da --- /dev/null +++ b/backend/src/main/resources/content/platform/frontend-template/overview.md @@ -0,0 +1,129 @@ +--- +module: platform.frontend-template +title: Frontend Template — starting a new SPA +tab: Overview +order: 55 +audience: dev +--- + +> **Repo:** `hiveops-template` · **Live component demos:** `design-system.html` (open in a browser) +> +> Every HiveIQ SPA starts as a copy of this repo. It is a scaffold, not a deployed service — it has +> no endpoints, tables, or Kafka topics. + +## Which page do I copy? + +| Your page has… | Copy | +|---|---| +| severity/status badges (incidents, alerts, events) | `TemplatePage.svelte` | +| a plain list/table, no badges | `TablePage.svelte` | + +**If the request does not make this obvious, ASK the user which one before copying. Do not guess.** +A page copied from the wrong base has to be rebuilt — the two differ in the badge colour maps and in +the filter-chip markup, not just in styling. + +## COPY, do not rewrite + +Never write a new page from scratch. Physically copy the canonical file, then edit it: + +```bash +cp /source/hiveops-src/hiveops-template/frontend/src/components/TemplatePage.svelte \ + /source/hiveops-src/hiveops-MYAPP/frontend/src/components/MyPage.svelte +``` + +Only these things may change in the copied file: + +1. Page `

` title and `

` subtitle in the header +2. The `ALL_ITEMS` array and its interface → your data type and real API call +3. Table columns (`` / ``) → your fields +4. Filter `