No description
  • JavaScript 53.1%
  • Svelte 45.6%
  • CSS 0.4%
  • Dockerfile 0.3%
  • Nix 0.3%
  • Other 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Steffen Rörtgen 6598d9afb9
All checks were successful
Build and publish nocabs image / test (push) Successful in 31s
Build and publish nocabs image / image (push) Successful in 40s
chore(audit-concepts): point stale vocab-mappings reference to edufeed/vocabs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:54:53 +02:00
.forgejo/workflows fix(ci): use docker-builder runner + drop .npmrc copy 2026-04-21 09:13:51 +02:00
docs/superpowers/plans docs: add draft-kind alignment implementation plan 2026-04-20 11:18:20 +02:00
scripts/audit-concepts chore(audit-concepts): point stale vocab-mappings reference to edufeed/vocabs 2026-10-08 18:54:53 +02:00
src export(skos): export embedded a-tag mapping markers (spec §6 deliverable 5) 2026-10-01 11:30:12 +02:00
static feat(config): add default static/config.json for runtime blocklist 2026-04-23 15:28:38 +02:00
.dockerignore feat: deploy as static SPA via Forgejo Actions + Caddy 2026-04-21 07:34:21 +02:00
.env.example docs(env): replace VITE_BLOCKED_NPUBS with runtime-config note 2026-04-23 15:34:55 +02:00
.envrc Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
.gitignore chore: ignore .worktrees/ 2026-04-23 15:17:08 +02:00
.mcp.json Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
Caddyfile feat: deploy as static SPA via Forgejo Actions + Caddy 2026-04-21 07:34:21 +02:00
CLAUDE.md Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
create-page.png Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
docker-entrypoint.sh feat(docker): add entrypoint that renders /srv/config.json from env 2026-04-23 15:36:47 +02:00
Dockerfile ci: copy pnpm-workspace.yaml into the Docker build stage 2026-09-28 15:49:49 +02:00
explore.png Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
flake.lock Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
flake.nix Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
footer-check.png Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
homepage.png Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
import-page.png Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
package-lock.json chore(deps): pin nostr-vocab-core and nostr-vocab-skos-import to v0.2.0 2026-04-20 17:05:20 +02:00
package.json deps: nostr-vocab-core 0.3.1 (robust mapping normalisation) 2026-10-01 12:29:30 +02:00
pnpm-lock.yaml deps: nostr-vocab-core 0.3.1 (robust mapping normalisation) 2026-10-01 12:29:30 +02:00
pnpm-workspace.yaml ci: approve esbuild build script for pnpm 12 2026-09-28 15:47:24 +02:00
README.md chore: vocab mappings moved to the edufeed/vocabs repo 2026-10-08 18:29:11 +02:00
settings-page.png Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
signin-modal.png Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
svelte.config.js feat: deploy as static SPA via Forgejo Actions + Caddy 2026-04-21 07:34:21 +02:00
tree-3-levels.png Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
tree-verification.png Initial commit: NOCABS vocabulary editor 2026-03-13 22:10:44 +01:00
vite.config.js test(config): include scripts/**/*.test.mjs in vitest discovery 2026-05-05 14:49:53 +02:00

NOCABS

Vocabs but on Nostr — a Svelte 5 app for authoring, browsing, and sharing controlled vocabularies as Nostr events, using the NIP-VOCAB six-kind split (ConceptSchemes, Concepts, Collections — published and draft variants).

NOCABS is a pure client-side SPA: all Nostr work happens in the browser (applesauce signers, localStorage-backed drafts, direct relay subscriptions). There is no backend, no server-side data, no cookies.

Develop

Requirements: Node 22+, pnpm (via corepack enable).

pnpm install
pnpm dev       # http://localhost:5173
pnpm test

The two libs (nostr-vocab-core, nostr-vocab-skos-import) are pinned to public tarball URLs on the Forgejo npm registry directly in package.json. No .npmrc, no SSH keys, no registry routing needed — pnpm install fetches them by URL and locks the integrity hash in pnpm-lock.yaml.

Local development against sibling repos

If you're iterating on the libs at the same time, you can override the registry versions with a file path without touching the committed package.json:

pnpm link ../nostr-vocab-core
pnpm link ../nostr-vocab-skos-import

Undo with pnpm unlink or pnpm install to restore registry versions.

Build

pnpm build

Output is a fully static site in build/. Serve it with any static host — Caddy, nginx, GitHub Pages, Netlify, Cloudflare Pages, npx serve build, etc.

Dynamic routes like /vocab/[pubkey]/[d] depend on client-side routing. Your static host must fall back unknown paths to index.html (the bundled Caddyfile does this out of the box).

Vocabulary publishing

Vocabulary and mapping publishing lives in the edufeed/vocabs repo.

Run anywhere (Docker)

A production image is published to the Forgejo container registry on every push to main:

docker run --rm -p 8080:80 git.edufeed.org/edufeed/nocabs:latest
# open http://localhost:8080

The image is caddy:2-alpine serving the built static assets on port 80. For TLS, put it behind any reverse proxy (Traefik, Caddy, nginx, Cloudflare) terminating HTTPS upstream.

Runtime configuration

The entrypoint renders /srv/config.json from environment variables at container start (no image rebuild required). Currently supported:

  • BLOCKED_NPUBS — comma-separated npubs and/or 64-char hex pubkeys whose content is hidden from this deployment. Events from these authors never enter the EventStore; direct URLs such as /vocab/<blocked-npub>[/<d>] return a 404. Unset or empty means no operator-level blocking.

Change the value and restart the container to take effect.

Deploy behind your own reverse proxy

Example Caddy block on the host:

nocabs.example.com {
    reverse_proxy nocabs:80
}

Example nginx server block:

server {
    server_name nocabs.example.com;
    listen 443 ssl http2;
    # ... tls config ...
    location / {
        proxy_pass http://nocabs:80;
    }
}

Homelab deploy (edufeed)

The homelab Ansible repo ships a role and playbook mirroring the edufeed-app pattern (docker-compose + Traefik labels on the proxy network):

ansible-playbook playbooks/deploy_nocabs.yml

Default domain: nocabs.edufeed.org. Change via nocabs_domain in roles/nocabs/defaults/main.yml or the playbook vars.

CI / Release

  • .forgejo/workflows/build.yml runs tests on every push/PR and builds+pushes the image on main and on v* tags.
  • Required repo secret: REGISTRY_TOKEN — a token with write:package on edufeed/nocabs container registry.

To cut a release: bump package.json version, commit, tag v0.2.0 (or whatever), push the tag. The image will be published with :latest, :0.2.0, and the commit SHA.

Bumping lib versions

When a new nostr-vocab-core or nostr-vocab-skos-import is published to the Forgejo npm registry, update the tarball URLs in package.json (the version appears twice per URL), then pnpm install to refresh the lockfile and commit both files.

One-time preflight (first bring-up)

  1. In the Forgejo UI for the edufeed org: generate an API token with write:package scope. Add it as secret FORGEJO_NPM_TOKEN on both lib repos (nostr-vocab-core, nostr-vocab-skos-import).
  2. In nostr-vocab-core: commit the publish workflow, tag v0.2.3, push the tag. The Forgejo Action publishes nostr-vocab-core@0.2.3. Mark the package public in the Forgejo packages UI.
  3. In nostr-vocab-skos-import: same — tag v0.2.4, push, mark public.
  4. In nocabs: run pnpm install locally to regenerate pnpm-lock.yaml against the public tarball URLs, commit the updated lockfile, push. From this commit onward pnpm install --frozen-lockfile works in CI and on any clean machine — no credentials needed for install.
  5. Create the REGISTRY_TOKEN secret on nocabs (package:write on the container registry) and push to main — the first image will build.

Tech