{"id":46406114,"url":"https://github.com/visualize-admin/electricity-prices-switzerland","last_synced_at":"2026-03-05T12:13:05.086Z","repository":{"id":42186727,"uuid":"272451871","full_name":"visualize-admin/electricity-prices-switzerland","owner":"visualize-admin","description":"Compare Swiss electricity prices. Project ownership: Federal Electricity Commission ElCom","archived":false,"fork":false,"pushed_at":"2026-02-17T08:06:11.000Z","size":41756,"stargazers_count":5,"open_issues_count":52,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-02-17T13:20:19.285Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://strompreis.elcom.admin.ch","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/visualize-admin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-06-15T13:52:28.000Z","updated_at":"2026-02-17T08:06:15.000Z","dependencies_parsed_at":"2025-11-28T18:10:32.492Z","dependency_job_id":null,"html_url":"https://github.com/visualize-admin/electricity-prices-switzerland","commit_stats":null,"previous_names":[],"tags_count":149,"template":false,"template_full_name":null,"purl":"pkg:github/visualize-admin/electricity-prices-switzerland","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visualize-admin%2Felectricity-prices-switzerland","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visualize-admin%2Felectricity-prices-switzerland/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visualize-admin%2Felectricity-prices-switzerland/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visualize-admin%2Felectricity-prices-switzerland/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/visualize-admin","download_url":"https://codeload.github.com/visualize-admin/electricity-prices-switzerland/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visualize-admin%2Felectricity-prices-switzerland/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30123836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T11:11:57.947Z","status":"ssl_error","status_checked_at":"2026-03-05T11:11:29.001Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-05T12:13:04.567Z","updated_at":"2026-03-05T12:13:05.078Z","avatar_url":"https://github.com/visualize-admin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ElCom Electricity Price Website\n\nAn electricity price comparison website for Switzerland that provides interactive maps, charts, and time-series visualizations of electricity prices from Swiss providers. Built with Next.js 15, TypeScript, and Material-UI, the application exposes a GraphQL API, which uses the Swiss Federal Administration Open Data (LINDAS) to get data on operator, prices, municipalities.\n\n**For development patterns and coding guidelines, see [Claude.md](./Claude.md).**\n\n## Configuration through Environment Variables\n\n| Variable                    | Required | Example Value                                                                                    |\n| --------------------------- | -------- | ------------------------------------------------------------------------------------------------ |\n| `SPARQL_ENDPOINT`           | yes      | `https://lindas.admin.ch/query`                                                                  |\n| `SPARQL_EDITOR`             | yes      | `https://lindas.admin.ch/sparql`                                                                 |\n| `GITLAB_WIKI_TOKEN`         | yes      | `xyz`                                                                                            |\n| `GITLAB_WIKI_URL`           | yes      | `https://gitlab.ldbar.ch/api/v4/projects/9999/wikis`                                             |\n| `I18N_DOMAINS`              |          | `{\"de\": \"www.elcom.local\", \"fr\": \"fr.elcom.local\", \"it\": \"it.elcom.local\"}`                      |\n| `BASIC_AUTH_CREDENTIALS`    |          | `user:password`                                                                                  |\n| `MATOMO_ID`                 |          | `123`                                                                                            |\n| `CURRENT_PERIOD`            |          | `2022`                                                                                           |\n| `FIRST_PERIOD`              |          | `2009`                                                                                           |\n| `PUBLIC_URL`                | no       | `http://localhost:3000`                                                                          |\n| `EIAM_CERTIFICATE_PASSWORD` | yes      | See in Elcom PWD certificates in 1Password                                                       |\n| `EIAM_CERTIFICATE_CONTENT`  | yes      | See in Elcom PWD certificates in 1Password. Result of `cat certificate.p12 \\| base64`            |\n| `GEVER_BINDING_IPSTS`       |          | `https://idp-cert.gate-r.eiam.admin.ch/auth/sts/v14/certificatetransport`. Ask Roger Flurry.     |\n| `GEVER_BINDING_RPSTS`       |          | `https://feds-r.eiam.admin.ch/adfs/services/trust/13/issuedtokenmixedsymmetricbasic256`          |\n| `GEVER_BINDING_SERVICE`     |          | `https://api-bv.egov-abn.uvek.admin.ch/BusinessManagement/GeverService/GeverServiceAdvanced.svc` |\n\n## Development Environment\n\nTo start the development environment, you need [Node.js](https://nodejs.org/en/) (v22 recommended) and [pnpm](https://pnpm.io/) as package manager.\n\nThe usage of [Nix](https://nixos.org) to install system-level packages is recommended.\n\n### Setting up the dev environment\n\nEnsure that Node.js and pnpm are available in your environment\n\n#### Install system-level dependencies\n\nEither use the installers\n\n- [Node.js installer](https://nodejs.org/en/)\n- [pnpm installation](https://pnpm.io/installation)\n\nOr – if using Nix – entering a new Nix shell will install Node.js and pnpm automatically:\n\n```sh\nnix develop\n```\n\n#### Run the application setup\n\nRun the setup script:\n\n```sh\npnpm setup\n```\n\nThis will install npm dependencies and run setup scripts.\n\n### Dev server\n\nOnce the application's set up, you can start the development server with\n\n```sh\npnpm dev\n```\n\n\u003e 👉 In [Visual Studio Code](https://code.visualstudio.com/), you also can run the **default build task** (CMD-SHIFT-B) to start the dev server, and TypeScript checker (you'll need [Nix](https://nixos.org) for that to work).\n\n## Versioning\n\nNew versions of `package.json` are built on CI into a separate image that will be deployed to the test environment.\n\n```sh\npnpm version\n```\n\nThis will prompt for a new version. The `postversion` script will automatically try to push the created version tag to the origin repo.\n\n## Localization\n\nThe application supports German (de), French (fr), Italian (it), English (en), and AA (test language). Translations are managed using Lingui with Accent for translation management.\n\n[Project in Accent](https://accent.interactivethings.io/app/projects/1ce6adef-33b9-45e5-8eaf-a1f6b6ba1ebd).\n\n### Workflow\n\n```sh\n# Extract translatable strings from source code\npnpm locales:extract\n\n# Manage translations via Accent interface\npnpm locales:browse\n\n# Pull translations from Accent service\npnpm locales:sync\n\n# Compile translations (runs automatically during pnpm build)\npnpm locales:compile\n```\n\n## Preparing geodata\n\nRun\n\n```sh\nmake geodata\n```\n\nSince Switzerland's municipalities can change each year, the yearly [Shapefiles from 2010 on prepared by BFS](https://www.bfs.admin.ch/bfs/de/home/dienstleistungen/geostat/geodaten-bundesstatistik/administrative-grenzen/generalisierte-gemeindegrenzen.html) will be downloaded and transformed into [TopoJSON](https://github.com/topojson/topojson) format which can be loaded efficiently client-side.\n\nThe detailed transformation steps are described in this project's `Makefile`.\n\n## Http Proxy\n\nOn the government infrastructure, an HTTP proxy is used for external requests. This is for example used to fetch\nthe gitlab content. The proxy is configured via the `./configure-proxy.js` script that is\nrequired in the `package.json` start command. It uses the `HTTP_PROXY` environment variable\n\n- For some of the server requests (SAML requests), we must _not_ use this proxy, and the agent\n  is configured there manually.\n- For external requests that should use the proxy, we can use `https.globalAgent`.\n\n```\nconst https = require('https')\nconst data = fetch(url, {\n  agent: https.globalAgent\n})\n```\n\n## EIAM certificates\n\nEIAM certificates are used to authenticate against the GEVER API serving\nthe electricity provider documents.\n\nThey are stored in 1Password as \"Elcom PWD certificates\".\n\nEIAM certificate content and password are passed as environment variable.\nThe certificate content is a p12 certificate encoded as base 64.\n\nIn dev, you have to edit env.local to add the `EIAM_CERTIFICATE_CONTENT` and `EIAM_CERTIFICATE_PASSWORD` variables.\n\n```bash\n# Get the base64 certificate content that can be put in EIAM_CERTIFICATE_CONTENT\ncat ../../../vault/svc.spw-d.elcom.admin.ch.p12 | base64\n```\n\n## Load testing\n\nSee [Load Testing](./docs/load-testing.md) document for more information.\n\n## Docker\n\nBoth the frontend and the screenshot service can be built as docker images\nand spin up through docker-compose.\n\n```bash\npnpm docker:build # Build the image and tag it as interactivethings/electricity-prices-switzerland\ndocker compose up\n```\n\nTrivy is used for vulnerability scanning and must pass for the image to be\naccepted on the Federal Administration infrastructure. A check is done before\npublishing the docker image on GHCR. It can also be run against a local image.\n\n```bash\npnpm docker:trivy # Runs trivy against interactivethings/electricity-prices-switzerland:latest\n```\n\n## SPARQL notebook\n\nA notebook containing Elcom specific SPARQL queries is available at [./book.sparqlbook](./book.sparqlbook).\nYou need the [SPARQL Notebook Extension](https://marketplace.visualstudio.com/items?itemName=Zazuko.sparql-notebook)\nto open it.\n\n## Home map screenshots\n\nIt is possible to regenerate the home map screenshots automatically using Playwright.\n\n```bash\npnpm design:generate-home-maps\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisualize-admin%2Felectricity-prices-switzerland","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvisualize-admin%2Felectricity-prices-switzerland","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisualize-admin%2Felectricity-prices-switzerland/lists"}