Read-only mirror of https://github.com/DCC-BS/datenkatalog-freigabe — Basel-Stadt. Issues & pull requests at the source.
  • Vue 58.6%
  • TypeScript 39.9%
  • Dockerfile 1%
  • CSS 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-28 22:20:22 +01:00
.github/workflows Add Entra login with dcc/user roles and sign-out 2026-11-12 11:17:08 +01:00
app Always use the default review-request email for all portal exclusion cases 2026-11-28 22:20:22 +01:00
i18n/locales Load datasets first, then fill Data Owners in the background 2026-11-27 23:19:17 +01:00
public/freigabe Add Freigabe PDF block generated from HTML template 2026-11-19 23:48:58 +01:00
server Load datasets first, then fill Data Owners in the background 2026-11-27 23:19:17 +01:00
shared Remove Posten filter and show all steward datasets 2026-11-26 16:57:29 +01:00
.dockerignore Add Docker deployment setup 2026-11-08 21:05:27 +01:00
.env.example Add env-backed SharePoint Weisung URL to review email 2026-11-21 21:46:48 +01:00
.gitignore Initial commit 2026-11-07 12:18:43 +01:00
biome.json Initial commit 2026-11-07 12:18:43 +01:00
bun.lock Update bun and dependencies 2026-11-24 12:01:16 +01:00
Dockerfile Add Entra login with dcc/user roles and sign-out 2026-11-12 11:17:08 +01:00
LICENSE Initial commit 2026-11-07 12:18:43 +01:00
nuxt.config.ts Add env-backed SharePoint Weisung URL to review email 2026-11-21 21:46:48 +01:00
package.json Update bun and dependencies 2026-11-24 12:01:16 +01:00
README.md Add env-backed SharePoint Weisung URL to review email 2026-11-21 21:46:48 +01:00
tsconfig.json Initial commit 2026-11-07 12:18:43 +01:00

datenkatalog-freigabe

Small internal web tool for the Basel-Stadt data catalog (Dataspot). It prepares the review-request email that is sent to a Data Steward before their metadata is published.

Workflow:

  1. Select a Data Steward (people holding a post with the role Data Steward).
  2. The tool loads all datasets with public state DRAFT they are responsible for as Data Steward.
  3. Select datasets, or the collections that contain them.
  4. Edit the generated (German) email and copy it, or open it in your mail program.

The website UI is German; code and documentation are English.

Stack

  • Nuxt 4 with Nuxt UI and @dcc-bs/common-ui.bs.js
  • Bun as package manager, Biome for linting and formatting
  • No separate backend: Nitro server routes call the Dataspot Query API directly, so credentials stay on the server.

Configuration

All configuration is read from .env (see .env.example):

Variable Description
AUTH_LAYER_URI Auth layer implementation, github:DCC-BS/nuxt-layers/azure-auth (build time)
LOGGER_LAYER_URI Logger layer implementation, github:DCC-BS/nuxt-layers/pino-logger (build time)
NUXT_AZURE_AUTH_TENANT_ID Entra ID tenant of the website app registration
NUXT_AZURE_AUTH_CLIENT_ID Client ID of the website app registration
NUXT_AZURE_AUTH_CLIENT_SECRET Client secret of the website app registration
NUXT_AZURE_AUTH_API_CLIENT_ID Leave empty (only used for a separate backend API)
NUXT_AZURE_AUTH_SECRET Session encryption secret, at least 32 characters
NUXT_AZURE_AUTH_ORIGIN <app URL>/api/auth, e.g. https://freigabe.datenkatalog.bs.ch/api/auth
DATASPOT_TENANT_ID Entra ID tenant of the Dataspot service app registration
DATASPOT_CLIENT_ID Client ID of the service app registration
DATASPOT_CLIENT_SECRET Client secret of the service app registration
DATASPOT_EXPOSED_CLIENT_ID Client ID of the Dataspot API exposed in Entra ID (scope api://<id>/.default)
DATASPOT_SERVICE_USER_ACCESS_KEY Access key of the Dataspot service user
NUXT_FEEDBACK_GITHUB_TOKEN GitHub token used by the feedback feature
NUXT_PUBLIC_WEISUNG_SCHUTZMASSNAHMEN_URL SharePoint link to the Weisung Schutzmassnahmen Informationssicherheit, inserted into the review email

The DATASPOT_* variables provide a service-to-service (M2M) token for Dataspot. They are not a login for app users.

Feedback

The feedback button in the footer (feedback-control layer) creates issues in DCC-BS/Feedback_Datenkatalog-Tools with the label Freigabe. server/api/feedback.post.ts overrides the layer's API route to use the title format Freigabe - <first 5 words> ....

Login and roles

Users sign in with Azure Entra via the DCC-BS azure-auth layer. All pages and the API routes /api/persons and /api/datasets require a login (401 otherwise). "Abmelden" in the settings menu of the navigation bar signs out.

Roles are Entra app roles of the website app registration (roles claim of the ID token):

Role Access
dcc Can select any Data Steward
user (or no role) Only sees themselves as Data Steward, matched by Entra email = Dataspot login_id

The Entra app registration needs the redirect URI <NUXT_AZURE_AUTH_ORIGIN>/callback/azure-ad (e.g. https://freigabe.datenkatalog.bs.ch/api/auth/callback/azure-ad). Role changes take effect at the next sign-in.

Development

bun install
bun run dev

The app runs on http://localhost:3000/.

Other scripts:

  • bun run check – lint and fix with Biome
  • bun run tsc – type checking
  • bun run build – production build

Running with Docker

The Dockerfile builds the app and serves it with the Nitro production server on port 8033. The layer URIs are build arguments; pass the NUXT_AZURE_AUTH_* and DATASPOT_* variables at runtime (e.g. via --env-file); do not bake them into the image.

Build the image:

docker build \
  --build-arg AUTH_LAYER_URI=github:DCC-BS/nuxt-layers/azure-auth \
  --build-arg LOGGER_LAYER_URI=github:DCC-BS/nuxt-layers/pino-logger \
  -t datenkatalog-freigabe .

Run the container, passing your environment variables and mapping the port:

docker run --rm -p 8033:8033 --env-file .env datenkatalog-freigabe

The app is then available at http://localhost:8033/.

The same image is built and pushed to GitHub Container Registry by the .github/workflows/docker.yml workflow on pushes to main and on tags.

Where to change things

  • Email text: app/utils/reviewRequestEmail.ts (template at the top of the file)
  • Freigabe PDF text: app/utils/freigabePdf.ts
  • Freigabe PDF logos: public/freigabe/
  • SQL queries: server/utils/dataspotQueries.ts
  • Dataspot base URL and database: shared/dataspot.ts
  • German UI texts: i18n/locales/de.json