Read-only mirror of https://github.com/agridata-ch/frontend — Bundesamt für Landwirtschaft. Issues & pull requests at the source. Catalog: https://www.opensource.admin.ch/en/softwares/f6n4ws https://www.opensource.admin.ch/en/softwares/f6n4ws
  • TypeScript 87.5%
  • HTML 10.9%
  • CSS 0.9%
  • Shell 0.4%
  • JavaScript 0.2%
  • Other 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
semantic-release-bot a49929b06c chore(release): 1.18.0-rc.7 [skip ci]
## [1.18.0-rc.7](https://github.com/agridata-ch/frontend/compare/v1.18.0-rc.6...v1.18.0-rc.7) (2026-08-25)

### Features

* **data-request:** add public-sector product selection ([038581c](038581c55c)), references [DIGIB2-1554](https://github.com/agridata-ch/frontend/issues/-1554)
2026-08-25 12:22:31 +00:00
.claude feat(consent-request): redesign consent-request details 2026-08-04 10:18:47 +02:00
.codesight feat(agb): add agb-enforcement 2026-07-29 11:12:22 +02:00
.github feat(deps): update renovatebot/github-action action to v46.2.0 2026-07-30 09:08:26 +02:00
.husky fix(user-api): add changes to user api 2025-09-16 09:45:50 +02:00
.sonarlint chore: initial commit 2025-05-07 12:58:26 +02:00
.storybook feat(storybook): add storybook 2026-02-24 13:10:08 +01:00
.vscode chore: initial commit 2025-05-07 12:58:26 +02:00
public fix(seo): fix favicon 2026-07-16 07:58:04 +02:00
src feat(data-request): add public-sector product selection 2026-08-25 14:11:48 +02:00
.browserslistrc feat(data-request): add data-request-new component 2025-06-24 09:36:12 +02:00
.claudeignore ci(setup): update readme, add claudeignore 2026-05-05 14:37:17 +02:00
.editorconfig feat(data-product): change resourceQueryDto.ts adding language to api calls 2026-07-28 13:01:12 +02:00
.env.example feat(error-handling): adds error handling 2025-10-15 15:21:26 +02:00
.gitattributes feat(support-page): adds support-page 2025-09-26 11:26:06 +02:00
.gitignore ci(ai): add codesight 2026-07-17 15:42:09 +02:00
.npmrc feat(error-message): improve error messages missing uid person 2026-04-16 14:28:50 +02:00
.postcssrc.json feat(consent-request): consent-request component 2025-05-13 16:49:02 +02:00
.prettierignore feat(data-product): edit data-product 2026-07-24 09:53:56 +02:00
.prettierrc chore: initial commit 2025-05-07 12:58:26 +02:00
.releaserc feat(consent-request): consent-request component 2025-05-13 16:49:02 +02:00
angular.json feat(data-request): add edit of redirect uri regex as admin 2026-03-19 13:58:04 +01:00
CHANGELOG.md chore(release): 1.18.0-rc.7 [skip ci] 2026-08-25 12:22:31 +00:00
CLAUDE.md feat(data-product): add public-sector data-product 2026-08-24 10:13:51 +02:00
codesight.config.json ci(ai): add codesight 2026-07-17 15:42:09 +02:00
commitlint.config.js chore: initial commit 2025-05-07 12:58:26 +02:00
eslint.config.mjs feat(data-catalog): add data-catalog page 2026-05-19 10:46:23 +02:00
jest.config.ts feat(cms card): update card 2025-10-20 15:09:26 +02:00
LICENSE.md feat(open-source): prepare for open-source 2025-10-02 06:50:59 +02:00
openapitools.json feat(consent-request): consent-request component 2025-05-13 16:49:02 +02:00
package-lock.json chore(release): 1.18.0-rc.7 [skip ci] 2026-08-25 12:22:31 +00:00
package.json chore(release): 1.18.0-rc.7 [skip ci] 2026-08-25 12:22:31 +00:00
publiccode.yml feat(docs): add publiccode.yml 2026-02-02 08:37:53 +01:00
README.md feat(consent-request): redesign consent-request details 2026-08-04 10:18:47 +02:00
renovate-config.js feat(open-source): prepare for open-source 2025-10-02 06:50:59 +02:00
renovate.json chore(renovate): update renovate config 2025-08-27 09:53:18 +02:00
setup-jest.ts feat(data-product): data-product detail view 2026-06-16 11:12:30 +02:00
sonar-project.properties feat(storybook): add storybook 2026-02-24 13:10:08 +01:00
THIRD_PARTY_LICENSES.md feat(open-source): update THIRD_PARTY_LICENSES.md to use github dependency graph 2025-10-09 12:27:38 +02:00
transloco.config.ts feat(i18n): add translation support 2025-06-17 12:03:58 +02:00
tsconfig.app.json feat(test-optimization): improves mocks 2025-11-07 16:27:03 +01:00
tsconfig.json feat(deps): upgrade Angular v20 to v22 2026-06-30 08:27:29 +02:00
tsconfig.spec.json feat(data-request-contract): add contract pdf 2026-04-20 17:35:27 +02:00

agridata.ch Frontend

This is the frontend of agridata.ch. The frontend is built with Angular and Typescript.

Installation

Requirements

  • Node.js (>= 24.0.0)
  • npm (>= 11.0.0)

Installation

  1. Clone the repository
git clone https://github.com/agridata-ch/frontend.git
cd frontend
  1. Set Env Variables First make sure to set the font awesome token in your .env file:
FONTAWESOME_PACKAGE_TOKEN={{your_token_here}}

If you get an authentication error then the preinstall script does not correctly fetch the token from your .env file so then past the token directly in to the .npmrc but don't check in this change!

If you are on windows npm may not be able to use the .env file directly. In this case you can set the environment variable manually in powershell:

$env:FONTAWESOME_PACKAGE_TOKEN="{{your_token_here}}"
  1. Install dependencies
npm install
  1. Start the development server
npm run start

Commit message convention

In this project we use the Conventional Commits specification for commit messages. This means that each commit message should start with a type, followed by an optional scope and a description. The type can be one of the following:

  • feat: A new feature
  • fix: A bug fix

When merging a pull request, the commit message must follow one of these formats; otherwise, the build will fail.

Deployment

We use semantic-release to automatically version and to generate the release notes. After a merge into the develop branch, the version is automatically increased and a new pre-release is created. After a merge into the main branch, the version is automatically increased and a new release is created. Also the main branch is automatically merged back into develop. The release notes are generated automatically based on the commit messages. The release notes are generated in the CHANGELOG.md file.

API-Client Generation

We use openapi-generator to generate the API client. The API client is generated from the OpenAPI specification file located in the src/assets/openapi folder. The OpenAPI specification file is generated from the backend using swagger-ui. The API client is generated using the following command:

npm run api:generate

The generated API client is located in the src/app/shared/services and the models are located in the src/app/shared/models folder. You can then import the API client in your component-services and use it to make API calls.

Translation

Transloco

We use transloco for translations. The translation files are located in the src/assets/i18n folder. The translation files are in JSON format and can be edited directly.

I18nService | I18nPipe

We have our custom I18n Service and Pipe to use the translations in the application. The I18nService is a wrapper around the Transloco service and provides a simple interface to get the translations. The I18nPipe is a wrapper around the Transloco pipe and can be used in the templates to get the translations. You can use the I18nPipe in your templates like this:

<p>{{ 'hello' | i18n }}</p>

in the json file:

{
  "hello": "Hello World"
}

or use it with a prefix


<ng-container *transloco="let t; prefix: 'agridata'">
  <p>{{ t('title') }}</p>
</ng-container>

this is useful if don't want to add the namespace to every translation key. In the json file this will then be like this:

{
  "agridata": {
    "title": "Agridata Title"
  }
}

POEditor Translation Sync

This script syncs translations from POEditor with your Angular project.

Setup

  1. Configure your POEditor credentials in .env file at the project root:
POEDITOR_API_TOKEN=your_api_token
POEDITOR_PROJECT_ID=your_project_id

You can refer to .env.example for the required format.

  1. Make sure you have the right language codes set up in POEditor, matching the ones you use in your project.

Usage

Run the sync command:

npm run i18n:sync

Powershell

npm run i18n:sync:windows

This will:

  1. Fetch all available languages from your POEditor project
  2. Download the translations for each language
  3. Save them to your src/assets/i18n directory

Getting POEditor API Token

  1. Log in to your POEditor account
  2. Go to your account settings
  3. Navigate to the API Access section
  4. Generate a new readonly API token or use an existing one

Getting POEditor Project ID

The project ID can be found in the URL when you're viewing a project: https://poeditor.com/projects/view?id=YOUR_PROJECT_ID

Font Awesome add new icon

We use a custom font awesome kit that only contains the icons that we need. To add a new icon, follow these steps:

  1. Go to your Font Awesome account
  2. Open the agridata-pro-regular kit
  3. go to icons, select classic regular
  4. Search for the icon you want to add
  5. Save subset and wait for the new package to be built
  6. install the new package:
npm install --save '@awesome.me/kit-0b6d1ed528@latest'

Storybook

We use Storybook for our UI components. You can run Storybook with the following command:

npm run storybook

AI

We use Claude for AI assistance. You can access it via the Claude website. Also you can use the Claude API to integrate it into your workflow. You can find the API documentation here.

CodeSight

We use CodeSight for context generation and therefore cost optimization. You can find more information about it on its GitHub repository. To use CodeSight, you need to install the CodeSight CLI and run it in your project directory. Just install it via npx:

npx codesight

Then you can run the following command to analyze your code:

npx codesight --wiki                       # Generate wiki knowledge base (.codesight/wiki/)
npx codesight --init                       # Generate CLAUDE.md, .cursorrules, codex.md, AGENTS.md
npx codesight --open                       # Open interactive HTML report in browser
npx codesight --mcp                        # Start as MCP server (14 tools) for Claude Code / Cursor
npx codesight --blast src/lib/db.ts        # Show blast radius for a file
npx codesight --profile claude-code        # Generate optimized config for a specific AI tool
npx codesight --benchmark                  # Show detailed token savings breakdown
npx codesight --native-ast                 # Opt-in: AST plugins for more languages (see docs/wasm-plugins.md)
npx codesight --mode knowledge             # Map knowledge base (.md notes → KNOWLEDGE.md)
npx codesight --mode knowledge ~/vault     # Map Obsidian vault, ADRs, meeting notes, retros

Ponytail

We use the plugin Ponytail for measured claude sessions, which allows us to track the usage of Claude and optimize the cost. You can find more information about it on its GitHub repository.

install in claude via:

/plugin marketplace add DietrichGebert/ponytail

/plugin install ponytail@ponytail

Main Commands (see more in the Ponytail documentation)

Command What it does
/ponytail [lite, full , ultra , off] Set the intensity, or turn it off. No argument reports the current level.
/ponytail-review Review the current diff for over-engineering, hands back a delete-list.
 /ponytail-audit Audit the whole repo for over-engineering, not just the diff.