Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
Rust 91.7%
Jinja 5.0%
Handlebars 1.8%
HTML 0.9%
CSS 0.4%
Makefile 0.1%
Shell 0.1%
Other 0.1%
574 6 0

Clone this repository

https://tangled.org/nekomimi.pet/microcosm-rs
git@knot.gaze.systems:nekomimi.pet/microcosm-rs

For self-hosted knots, clone URLs may differ based on your setup.

readme.md

microcosm HTTP APIs + rust crates#

@microcosm.blue: bluesky microcosm discord: join github sponsors: support ko-fi: support

Welcome! Documentation is under active development. If you like reading API docs, you'll probably hit the ground running!

Tutorials, how-to guides, and client SDK libraries are all in the works for gentler on-ramps, but are not quite ready yet. But don't let that stop you! Hop in the microcosm discord, or post questions and tag @bad-example.com on Bluesky if you get stuck anywhere.

Tip

This repository's primary home is moving to tangled: @microcosm.blue/microcosm-rs. It will continue to be mirrored on github for the forseeable future, and it's fine to open issues or pulls in either place!

🌌 Constellation#

A global atproto interactions backlink index as a simple JSON API. Works with every lexicon, runs on a raspberry pi, consumes less than 2GiB of disk per day. Handles record deletion, account de/re-activation, and account deletion, ensuring accurate link counts while respecting users' data choices.

🎇 Spacedust#

A global atproto interactions firehose. Extracts all at-uris, DIDs, and URLs from every lexicon in the firehose, and exposes them over a websocket modelled after jetstream.

  • Source: ./spacedust/
  • Public instance/API docs
  • Status: v0: the basics work and the APIs are in place! missing cursor replay, forward link storage, and delete event link hydration.

Demos:#

🛰️ Slingshot#

A fast, eager, production-grade edge cache for atproto records and identities. Pre-caches all records from the firehose and maintains a longer-term cache of requested records on disk.

🛸 UFOs API#

Timeseries stats and sample records for every collection ever seen in the atproto firehose. Unique users are counted in hyperloglog sketches enabling arbitrary cardinality aggregation across time buckets and/or NSIDs.

  • Source: ./ufos/
  • Public instance/API docs
  • Status: Used in production. It has APIs and they work! Needs improvement on indexing; needs more indexes and some more APIs to the data exposed.
Tip

See also: UFOs atproto explorer built on UFOs API. (source)

Rust library for parsing and extracting links (at-uris, DIDs, and URLs) from atproto records.

  • Source: ./links/
  • Status: not yet published to crates.io; needs some rework

🛩️ Jetstream#

A low-overhead jetstream client with cursor handling and automatic reconnect.

  • Source: ./links/
  • Status: used in multiple apps in production, but not yet published to crates.io; some rework planned
Tip

See also: Rocketman, another excellent rust jetstream client which shares some lineage and is published on crates.io.

🔭 Deprecated: Who am I#

An identity bridge for microcosm demos, that kinda worked. Fixing its problems is about equivalent to reinventing a lot of OIDC, so it's being retired.

Warning

who-am-i is still in use for the Spacedust Notifications demo, but that will hopefully be migrated to use atproto oauth directly instead.