๐Ÿ“š Agora node [[@melanocarpa/txt]] (empty) โ˜†
This Agora node is empty. Be the first to ๐ŸŒฑ Write a contribution, ๐Ÿงญ Wander to a connected node, or ๐ŸŽฎ play a minigame.
๐Ÿ“š Agora node [[20261126 Learning Elixir by building a Discovery Node for PublicTxt]] (pulled by the Agora)
๐Ÿ“œ File blog/2026/20261126-Learning Elixir by building a Discovery Node for PublicTxt.md by @jaysen โ˜† ๐Ÿ“Ž ๏ธ๐Ÿ”—

20261126-Learning Elixir by building a Discovery Node for PublicTxtยง

Why Elixir nowยง

PublicTxt v1 (personal storage and publishing) is now working for me day to day, through my Obsidian Plugins for PublicTxt and PublicTxt Pages for publishing. Community aggregation has already started: the Obsidian-PublicTxt-Remotes Plugin pulls in content from subscribed repos on one machine, and community features in PublicTxt-Pages are coming along. The next step is a hosted aggregator that follows repos at scale.

That’s also my excuse to learn Elixir properly, not through toy exercises but through a project that needs what Elixir/Erlang is good at: lots of small, independent, long-lived things that sometimes fail. I started PublicTxt in .NET because it was the tool at hand. The aggregator’s shape is very Erlang/Elixir

The problemยง

PublicTxt is a decentralised, Git-backed knowledge platform. Each person keeps their notes and bookmarks as plain Markdown in their own Git repo. CuratedCommons is the curation layer on top: social bookmarking across many repos.

The stack is free. But following hundreds or thousands of repos, keeping an index fresh and pushing updates to readers is work someone has to run. That’s where PublicTxt Web comes in: a hosted service that aggregates, indexes and, potentially, offers convenient paid hosting, without locking anyone in.

The shape of the solutionยง

In Erlang, every followed repo gets its own process. Each one wakes on a timer, fetches, parses what changed and reports back. If a repo is broken, slow or gone, only its own process crashes, and a supervisor restarts it. Everything else carries on. In most stacks you’d hand-build that isolation; in Erlang it’s the default.

The pieces:

  • Followers, one per repo, under a supervisor that restarts them independently.
  • An index process: the only writer to a fast in-memory table. Readers query the table directly; only writes queue.
  • A committer that periodically snapshots the index into a public Git repo.
  • An API and feed layer for queries and live updates.

Lessons along the wayยง

A few ideas clicked while designing this:

  • Crashes stay local. Processes share no memory. Links tie fates together on purpose; monitors just let you watch. A room shouldn’t die because one user did.
  • Single writer beats locks. One process owning the index means updates are applied one at a time, so they can’t conflict. And because an in-memory table dies with its owner, you give it to a stable process, never a fragile one.
  • Duplicates are a key choice. Keying bookmarks on a hash of the normalised URL makes repeat updates harmless overwrites, and merging the same resource from many repos is exactly where shared tags start to emerge.
  • Mailboxes have no ceiling. If followers fire and forget, a busy index drowns. Making them wait for a reply caps each follower at one message in flight. That’s backpressure: slowness flows back to the producers.

The twist: the index as a discovery nodeยง

The in-memory index is for speed. But committing a snapshot to a public Git repo turns it into something more: a free, persistent discovery layer. Anyone can clone it and find PublicTxt repos without my server existing at all.

That makes each server just one node. Nodes can follow each other’s index repos and trust lists, and discovery spreads without a central registry.

Inclusion is opt-in, plus a list of already-public repos I trust. Public isn’t quite the same as consent to aggregation, so nodes should honour an opt-out flag and respect licences. Indexing links and tags is a lighter touch than republishing content.

The trust list itself lives in Git, so others can follow my curation, which makes it CuratedCommons for repos. To stop trust from sprawling, following is limited to a hop or two.

What’s nextยง

Theory’s done. The first piece of code is a single follower: one Elixir GenServer polling one repo on a timer. Small, but it’s the seed of the whole thing. Phoenix, for the API and live feeds, comes after the core works.

An Elixir prototype evaluation sprintยง

  • Goal: learn OTP hands-on, test whether Elixir suits PublicTxt Web, and check how reliable Claude’s Elixir output is.
  • Time-box: about 5 days.
  • How: build it with Claude Code one module at a time, and read and question each module before moving on.

Scopeยง

  1. mix new follower --sup: an app with a top supervisor.
  2. A DynamicSupervisor that starts followers.
  3. A follower GenServer that polls a repo on a timer, runs git fetch and reports changed files. Test with two repos, one of yours and one Agora garden, each behind its own adapter.
  4. An index GenServer that owns an ETS table keyed by resource_id. Followers use call, so you get backpressure.
  5. A committer that writes a JSON snapshot to a local folder on a timer, with no Git push yet.
  6. A crash test: point one follower at a bogus repo, then confirm it restarts while the others carry on.

Out of scope: real parsing (only paths and front matter tags), Phoenix, Git pushes and ActivityPub.

Evaluate at the endยง

  • Was it productive?
  • Could I review and defend the code?
  • Is OTP clicking?
๐Ÿ“š Agora node [[obsidian plugins for publictxt]] (pulled by the Agora)
๐Ÿ“œ File wiki/Projects/PublicTxt/projects/obsidian-plugins/Obsidian Plugins for PublicTxt.md by @jaysen โ˜† ๐Ÿ“Ž ๏ธ๐Ÿ”—

PublicTxt pluginsยง

  • Obsidian PublicTxt Facets: An Obsidian plugin that brings PublicTxt Pages‘ faceted search and browsing into Obsidian. Works in any vault: nothing requires PublicTxt conventions.
    • An Obsidian plugin for browsing a vault by facets: chip facets with live counts (community, collection, category, tags, rating), a sort menu, and a list of page cards. It shares the core concepts and features of PublicTxt Pages‘ browse lists and search page, so it suits a PublicTxt repository, but it is a general facet browser and works in any vault.
  • Obsidian PublicTxt Remotes: *Adds collaborative features to ‘connect’ Obsidian wikis to other PublicTxt Wikis. Should work well with Obsidian PublicTxt Facets Plugin
    • follow other repos, mirror and fork their pages.
    • An Obsidian plugin that follows other people’s PublicTxt repos, shows what changed since you last looked, mirrors the pages you want at hand, and forks the ones you want to make your own. It is the pulling half of PublicTxt’s aggregate view; Obsidian PublicTxt Facets is the browsing half.

See also Obsidian Plugins vs PublicTxt project.

Developing them: Obsidian Plugin Development, CodeMirror.

Community plugins used with PublicTxtยง

๐Ÿ“š Agora node [[publictxt]] (pulled by the Agora)
๐Ÿ“œ File wiki/Projects/PublicTxt/PublicTxt.md by @jaysen โ˜† ๐Ÿ“Ž ๏ธ๐Ÿ”—

PublicTxt Projectยง

PublicTxt is an experiment in using Git repositories as an interoperability layer and online storage for public and community knowledge. By using free Git hosting and plain-text Markdown, individuals and communities can share, curate and collaborate on content without a centralised platform or paid infrastructure.

Desktop and web tools sync between local working copies and one or more Git repositories, selectively aggregate content from other people’s repositories, and publish to the web with static site generation โ€” all on plain Markdown that outlives the tooling.

Core ideasยง

  • Plain text first - Markdown with standard [text](page.md) links, readable by any static-site host with no conversion. Tags are front matter tags: or inline #hashtags.
  • Zero-cost storage and hosting - free Git hosting for storage, distribution and static sites.
  • Static website generation - PublicTxt Pages: push and you’re live, with full-text search and facets. See Publishing.
  • Selective aggregation - follow, mirror and fork chosen content from other repositories into a local aggregate
  • Obsidian compatible - a PublicTxt repository is an Obsidian vault. Obsidian PublicTxt Facets brings the site’s browsing into the editor.

Use casesยง

  • Personal knowledge management, with version control and free hosting
  • Distributed blogging others can subscribe to and aggregate
  • Research and learning: pull peers’ content into a local view
  • Lightweight community wikis, using Git’s own collaboration (pull requests, branches, forks)

from the READMEยง

README