A thin, config-driven Vue 3 shell that embeds public Apache Superset dashboards in a Swiss Confederation (admin.ch) styled, multilingual (DE / FR / IT / EN) frame.
Superset owns all dashboard content. This app adds the federal look and feel, a language switcher, and friendly URLs. It maps a URL slug to per-locale Superset dashboard UUIDs through a single in-repo registry file — no backend, no database, no build step to publish a new dashboard.
Built by the Swiss Federal Office of Energy (SFOE) for its own geodata dashboards, but deliberately generic: it has no BFE/SFOE-specific logic and can be re-pointed at any public Superset instance. See Reuse it for your own dashboards.
- How it works
- Quick start
- Configuration
- Add or update a dashboard
- Reuse it for your own dashboards
- Styling Superset to match (Swiss Design System)
- Development
- Maintenance
- Security
- Contributing
- License
Browser ──▶ superset-embed ──▶ <iframe> ──▶ Apache Superset
/<slug> (this app) standalone (public dashboard)
- A visitor opens
/<slug>(for example/biogas). The root path/serves the configured default. - The app looks the slug up in the registry (
public/dashboards.json), which maps each slug to one Superset dashboard UUID per language. - It resolves the UUID for the active language (falling back to German if a language is missing) and embeds that Superset dashboard in an iframe.
- The language switcher reloads the iframe with the UUID for the chosen language; the dashboard itself is rendered entirely by Superset.
The registry is the only thing you edit to add dashboards — it is plain JSON, validated against a JSON Schema, and read at runtime. The app never authenticates, so only public (anonymous) Superset dashboards can be shown.
Prerequisites: Node.js >= 22.12 and a reachable Apache Superset instance with at least one public dashboard.
git clone https://github.com/SFOE/superset-embed.git
cd superset-embed
npm install
cp .env.example .env # then set VITE_SUPERSET_URL
npm run dev # http://localhost:5173By default the app points at http://localhost:8088. Set VITE_SUPERSET_URL
in .env to target your own Superset.
| Variable | Default | Description |
|---|---|---|
VITE_SUPERSET_URL |
http://localhost:8088 |
Origin of the Superset instance the app embeds from. |
Everything else is configured through the registry file (see below). The app has no server-side configuration.
No code and no rebuild — just edit public/dashboards.json.
-
Publish the dashboard in Superset and make it public. Grant the Public role access to the dashboard and its charts/datasets. Build one dashboard per language only if you actually translate its content.
-
Copy the UUID from the Superset URL
/superset/dashboard/<uuid>/(or from Edit dashboard → Edit properties). Note one UUID per language. -
Add an entry under
dashboards:{ "name": "my-dashboard", "uuid": { "de": "<dashboard-uuid>", "fr": "<dashboard-uuid>", "it": "<dashboard-uuid>", "en": "<dashboard-uuid>" } }nameis a URL slug matching^[a-z0-9][a-z0-9-]*$; the dashboard is served at/<name>.deis required and is the fallback for any missing language.- Set the top-level
"default"to anameto serve that dashboard at/. If omitted, the first entry is used. - Language-neutral dashboard? Point all four languages at the same UUID
(or provide only
de). No need to duplicate it in Superset.
-
Commit. On reload the app serves
/<name>; the language switcher chooses which per-language UUID the iframe loads.
The registry is validated by public/dashboards.schema.json, so an editor
flags mistakes before runtime, and malformed entries are skipped with a console
warning rather than breaking the app. Only public dashboards render for
anonymous viewers.
This app has no SFOE-specific logic — the branding lives in a handful of assets and config values. To adopt it for another office or project:
- Superset target — set
VITE_SUPERSET_URLto your instance. - Dashboards — replace
public/dashboards.jsonwith your own slugs and UUIDs. - Title — edit
header_titleinsrc/locales/{de,fr,it,en}.json. - Logo & favicon — replace
src/assets/logo.png(and the mobileswiss_mobile.svg) andpublic/favicon.png. - Colors & styling — adjust the design tokens in
src/assets/base.css. - Languages — the app ships DE / FR / IT / EN; add or remove locales in
src/locales/and the language switcher. - License — update the copyright holder in
LICENSEand the metadata inMETADATA.yaml.
The MIT license lets you fork and adapt freely; attribution is appreciated.
This app styles its own shell (header, footer, select). The embedded dashboards are rendered by Superset, so their look comes from Superset's own theme — not from this repo. To make the dashboards match the Swiss Confederation (admin.ch) / Swiss Design System look, brand Superset itself.
The reliable, supported way is the global theme (Superset 6.x uses Ant
Design design tokens). Add a THEME_DEFAULT to your superset_config.py. It
applies to every dashboard and to the standalone=2 pages this app embeds,
so new dashboards inherit it for free:
# superset_config.py — global Swiss Design System theme
THEME_DEFAULT = {
"token": {
"colorPrimary": "#2f4356", # Swiss Confederation dark blue-grey
"colorLink": "#005ea5",
"colorError": "#d8232a", # Swiss red
# White surfaces everywhere (admin.ch flat look):
"colorBgLayout": "#ffffff",
"colorBgContainer": "#ffffff",
"colorBgElevated": "#ffffff",
# Borderless cards: white borders + zero line width:
"colorBorder": "#ffffff",
"colorBorderSecondary": "#ffffff",
"colorSplit": "#ffffff",
"lineWidth": 0,
# Noto Sans is the Swiss Design System's open web font. The official
# CD Bund Frutiger is licensed and cannot be self-hosted.
"fontUrls": [
"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;700&display=swap",
],
"fontFamily": "'Noto Sans', Helvetica, Arial, sans-serif",
"fontWeightStrong": "600",
},
"algorithm": "default",
}
THEME_DARK = None # force a single light theme — no dark-mode toggleRestart Superset after editing (docker compose restart superset).
Notes:
- These are public Swiss Design System color values, not secrets. Keep real
secrets (
SECRET_KEY, database credentials) out of any file you commit or share. - The theme tokens above mirror the shell tokens in
src/assets/base.css, so the embedded dashboard and the surrounding frame stay visually consistent. - Per-dashboard CSS (a dashboard's Edit properties → CSS) can add small
layout polish the tokens can't express, but prefer the global theme — it is
the only path verified to reach the
standalone=2embed consistently.
| Task | Command |
|---|---|
| Dev server | npm run dev |
| Production build | npm run build |
| Type-check | npm run type-check |
| Unit tests | npm run test:unit |
| End-to-end tests | npm run test:e2e |
| Lint | npm run lint |
| Format | npm run format |
Stack: Vue 3 + TypeScript + Vite, Pinia, Vue Router, Vue I18n. Tests use Vitest (unit, component, and fast-check property tests) and Cypress (e2e). The e2e smoke test stubs the registry, so no live Superset is required to run it.
Engineering conventions (architecture, testing, linting, security, automation)
are documented in .kiro/steering/frontend-conventions.md.
- Dependencies: Dependabot opens weekly, grouped minor + patch PRs (npm and GitHub Actions). Review and merge them and keep CI green. Majors arrive as separate PRs — read the changelog before merging.
- CI gates (must stay green on PRs to
main):npm run lint— ESLint (flat config) + Prettier.npm run type-check—vue-tsc --build.npm run test:unit— Vitest. Coverage vianpx vitest --run --coverage.npm run test:e2e— Cypress smoke test.npx audit-ci --config ./audit-ci.jsonc— security audit.
- Security advisories: if
audit-ciflags an unfixable, dev-only advisory, add a path-scoped entry toaudit-ci.jsoncwith a note and anexpiry, and pin transitive fixes via npmoverridesinpackage.jsonwhen a fix exists.
- The app is read-only and unauthenticated: it embeds public Superset dashboards and never handles credentials or user data.
- Only list dashboards that are intentionally public — a non-public dashboard will not render for anonymous viewers.
- Please report suspected vulnerabilities privately to the repository owner rather than opening a public issue.
Issues and pull requests are welcome. Please open an issue to discuss larger
changes first, keep CI green (lint, type-check, unit, e2e, security), and follow
the conventions in .kiro/steering/frontend-conventions.md.
MIT — © Swiss Federal Office of Energy (SFOE) / Bundesamt für Energie (BFE).