- TypeScript 84.6%
- Vue 14.7%
- CSS 0.4%
- Dockerfile 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .github | ||
| .vscode | ||
| docs/adr | ||
| packages | ||
| test-utils | ||
| tests | ||
| .dockerignore | ||
| .env.test | ||
| .git-blame-ignore-revs | ||
| .gitignore | ||
| .prettierignore | ||
| base.vite.config.ts | ||
| codecov.yml | ||
| CONTRIBUTION.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE.md | ||
| package.json | ||
| playwright.config.ci.ts | ||
| playwright.config.ts | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| prettier.config.ts | ||
| README.md | ||
| renovate.json | ||
| turbo.json | ||
SWISSGEO Web Portal
| Branch | Status |
|---|---|
| develop | |
| main |
This repository contains the frontend implementation for SWISSGEO, the future central geodata platform for Switzerland.
Important
This project is currently under active development. Features and documentation are subject to frequent changes.
Project Context
SWISSGEO is the upcoming unified hub for Swiss geospatial data, merging federal and cantonal services (geo.admin.ch, geodienste.ch, geocat.ch) into a single, modern infrastructure.
ℹ️ Resources
Project overview: Official SWISSGEO Platform info in German or French Version here (FR)
Quick-Start
Install all the dependencies:
pnpm install
Compile the sub-packages in watch mode (terminal 1):
pnpm turbo build:dev:watch
Run the dev server for coding (terminal 2):
pnpm run dev
Environment Variables
Before running the dev server, copy the example file and fill in the values:
cp packages/main/.env.example packages/main/.env
The available variables are:
NUXT_PUBLIC_OGC_API_ENDPOINT= # OGC API endpoint (exposed to client)
NUXT_PUBLIC_WANTED_LOG_LEVELS= # String of log levels wanted (error|warn|info|debug)
NUXT_PUBLIC_SHARE_SERVICE_URL= # The URL to the share service
NUXT_WHAT3WORDS_API_KEY= # what3words API key (server-only)
NUXT_GEOADMIN_API_BASE_URL= # Base URL for legacy geo.admin.ch API (server-only)
Monorepo setup
This project is structed as a monorepo. There are several sub-packages, each with a specific purpose. This way, the code is forced to stay cleaner and the various parts have to be more abstracted.
The main entrypoint is the main package. It contains the necessary nuxt setup to provide
the final application.
The layers package handles the addition of layers to the application. The intention of this
package is to keep it as stupid as possible: don't add anything map related to this.
The map package's purpose is to display map. As of now, this means all the required code
to fetch the data to create an openlayers map.
Since we still have to share some types and data structures across the packages, there is a package shared for that.
The skeleton package contains UI elements and things that are not specific to a specific page/view of the app.
In the future, we'll have content from a CMS in this webapp. This package takes care of that.
Docker
A Dockerfile is provided to build and run the application in a container. It accepts a TARGET_ENV build argument (prod by default).
Build the image:
# build with source maps
pnpm run docker:build:dev
# build without source maps
pnpm run docker:build:prod
Run the container:
# with source maps
pnpm run docker:run:dev
# or without source maps
pnpm run docker:run:prod
The app will be available at http://localhost:3000.
Note: Environment variables (
NUXT_API_ENDPOINT,NUXT_AUTH_TOKEN,NUXT_MAPTILER_API_KEY, etc.) must be set at runtime via-eflags or an env file — do not bake secrets into the image.
Turbo
The repo makes use of Turbo, a supercharger for monorepos. Turbo caches the outcome of certain scripts and won't re-run it if its not needed.
What you can do is, instead of just using pnpm run build|lint|format|type-check is to use pnpm turbo build|lint|format|type-check.
This will engage the wrapper and make use of these functionalities and speed up your workflow!
Integration tests
Integration tests live in tests/integration/ and use Playwright. They verify that UI components work together correctly (sidebar, map canvas, toolbox, locale routing) without depending on real external services — all outgoing API requests are mocked via page.route().
The first time you run them locally, install the browser binary:
pnpm exec playwright install --with-deps chromium
Then build the library packages (the Nuxt dev server imports them from their dist/ output):
pnpm build:dev
Run the tests:
pnpm test:integration
Playwright auto-starts the Nuxt dev server on http://localhost:3000. If you already have pnpm run dev running, it will reuse that server.
Note: The first page load in dev mode can take 30–45s while Vite compiles modules on demand. Subsequent test runs in the same session are fast thanks to HMR.
In CI (AWS CodeBuild) the tests run against a production preview (pnpm --filter main preview) after a full pnpm build, which avoids the dev-mode cold-start delay. The Playwright config switches automatically when CI=true is set.
Renovate
This repository is monitored by a Renovate Bot. This means it will periodically receive pull requests on github wanting to update certain dependencies.
Basic workflow:
- Renovate creates a branch with updated
pnpm-workspace.ymlandpnpm-lock.yml - All tests succeed: approve the PR and merge it
- Some tests fail:
- check out the branch and fix
- close the PR (renovate will ignore this package until a new version is released)
Advanced configurations
If you want to exclude a specific package from renovate scans, you can exclude that package in the renovate.json config. Add the package name to the ignoreDeps array:
{
"ignoreDeps": ["ol", "@nuxt/ui"]
}
Use the exact package name as it appears in the catalog: block of pnpm-workspace.yaml. Renovate will stop opening update PRs for those packages entirely, so add a comment to the PR or a note here explaining why a package is pinned — otherwise it is easy to forget that it is being held back.