Watch
1
0
Fork
You've already forked oss-catalog
0
mirror of https://github.com/swiss/oss-catalog.git synced 2026-08-17 12:42:56 +00:00
  • CSS 75.2%
  • TypeScript 12.2%
  • Astro 11.7%
  • Just 0.3%
  • JavaScript 0.2%
  • Other 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-14 16:16:03 +02:00
.github feat: support markdown in formatting for descriptions (#103) 2026-08-12 16:14:17 +02:00
.idea chore: add repo scanner. read "all" software when building the app 2025-09-01 17:20:07 +02:00
client chore: update dependencies 2026-08-14 15:47:13 +02:00
doc chore: application screenshot 2026-08-14 13:05:30 +02:00
paseto chore: upgrade go and dependencies 2026-08-14 16:16:03 +02:00
.dockerignore feat: build app with public api (#84) 2026-06-05 15:01:53 +02:00
.gitignore chore: cleanup project (#86) 2026-06-05 15:12:08 +02:00
.nvmrc chore: migrate to pnpm for improved supply chain security 2026-05-22 14:59:22 +02:00
AGENTS.md chore: replace windsurf specific config with an AGENTS.md file (#85) 2026-06-05 15:12:42 +02:00
CODE_OF_CONDUCT.md feat: adhere to open source best practices (#27) 2025-09-08 12:58:53 +02:00
compose.yml chore: upgrade publiccode crawler to aad6661 (#102) 2026-08-11 12:55:18 +02:00
Dockerfile feat: build app with public api (#84) 2026-06-05 15:01:53 +02:00
justfile feat: persist organisation, canton and search term filter in the url (#98) 2026-08-10 17:02:12 +02:00
LICENSE Add LICENSE file 2025-03-12 17:12:24 +01:00
package.json chore: update dependencies 2026-08-14 15:47:13 +02:00
pnpm-lock.yaml chore: update dependencies 2026-08-14 15:47:13 +02:00
pnpm-workspace.yaml chore: upgrade frontend dependencies (#76) 2026-06-01 11:27:37 +02:00
publiccode.yml chore: fix test artifact in publiccode.yml 2026-08-14 13:15:49 +02:00
README.md feat: persist organisation, canton and search term filter in the url (#98) 2026-08-10 17:02:12 +02:00
renovate.json Add renovate.json (#16) 2025-09-03 11:17:27 +02:00
start-api chore: add repo scanner. read "all" software when building the app 2025-09-01 17:20:07 +02:00
start-client feat: build app with public api (#84) 2026-06-05 15:01:53 +02:00
start-crawler Add Docker Compose services for web app & crawler 2025-03-12 11:30:14 +01:00

Open Source Software Catalog

The Open Source Software Catalogue provides an overview of free and open-source software developed by or for the Swiss Confederation. It is based on the Public Code standard, which describes software in a machine-readable way, making it discoverable and understandable for both developers and non-technical users.

Context

flowchart TB
  subgraph OSS_CATALOG[OSS Catalog]
    direction LR
    db[(PostgreSQL)]
    api[Developers Italia API]
    crawler[Publiccode Crawler]
    web[OSS Catalog Client]

    api --> db
    crawler -- "Read publishers<br>Create softwares<br>(REST)" --> api
    web <-- Static build<br>(REST) --> api
  end

  user((User))
  github[GitHub, GitLab, others]
  action[Scheduled Github Action]
  swissindex[https://github.com/swiss/index/blob/main/README.md]
  user -- "(HTTP)" --> web
  crawler -- "Scan repositories<br>Parse publiccode.yml" --> github

  swissindex -- Reads publishers --> action
  action -- creates publishers (REST) --> api
  action -- triggers--> crawler

Usage

Overview

What you will do:

  • Clone this repo
  • Generate PASETO key & create GitHub API token
  • Start API service (and DB)
  • Add publisher(s) using curl
  • Run crawler
  • Build and run the client

Preparation

Clone this repository:

git clone git@github.com:swiss/oss-catalog.git
cd oss-catalog/

The API uses a paseto key for authentication. Generate it with:

./paseto/generate-paseto-key.sh

Create GitHub API Token with the public_repo Permission under https://github.com/settings/tokens and add it to the .env file. The crawler needs this token to access GitHub repositories.

echo "GITHUB_TOKEN=<your access token>" >> .env

Install and enable pnpm (see pnpm docs):

curl -fsSL https://get.pnpm.io/install.sh | sh -

API Service

Start API with database:

./start-api

Use API via Curl (optional)

The API uses PASETO for authentication. Generate a PASETO token (valid for 24h):

source .env
cd paseto/go
PASETO_TOKEN="$(go run paseto-generate.go $PASETO_KEY)"

or, using just:

export PASETO_TOKEN="$(just pt)"

List publishers (no authentication needed):

curl http://localhost:3000/v1/publishers

Create some publishers:

curl -X POST -H "Authorization: Bearer $PASETO_TOKEN" -H "Content-Type: application/json" -d '{"codeHosting": [{"url": "https://github.com/swiss/", "group": true}], "description": "Swiss Government"}' http://localhost:3000/v1/publishers
curl -X POST -H "Authorization: Bearer $PASETO_TOKEN" -H "Content-Type: application/json" -d '{"codeHosting": [{"url": "https://github.com/DCC-BS", "group": true}], "description": "Basel-Stadt"}' http://localhost:3000/v1/publishers
curl -X POST -H "Authorization: Bearer $PASETO_TOKEN" -H "Content-Type: application/json" -d '{"codeHosting": [{"url": "https://github.com/agridata-ch", "group": true}], "description": "agridata-ch"}' http://localhost:3000/v1/publishers

Crawler

Run crawler - this will crawl all repositories in the API, checks for publiccode.yml and add them to the database if available and valid.

./start-crawler

Catalog Client Application

Start the catalog client application at http://localhost:8080:

./start-client

Or for development mode:

pnpm install
pnpm scope:client dev

Then visit http://localhost:4321

Known Issues

  • The actual deletion of a publisher or software in the database takes a while (as if it is done asynchronously in the API).

Resources