Files
psf-memo/psf-memo-db
Chris Troutner 8da0f09f46 Implement topic metadata columns
Add lastSeen and followerCount to topicSummaries across the indexer, DB,
and client. The indexer now tracks the newest post seen time, updates
follower counts idempotently on follow/unfollow, and preserves post
metadata. The DB exposes lastSeen and followerCount from GET /topics and
rebuilds both from the rooms store in the backfill. The client renders the
four-column topics page with relative-time labels.

By coder.
2026-09-18 05:46:58 -07:00
..
2026-08-26 09:20:10 -07:00
2026-08-26 09:20:10 -07:00
2026-09-18 05:38:41 -07:00
2026-09-18 05:46:58 -07:00
2026-09-18 05:46:58 -07:00
2026-08-26 09:20:10 -07:00
2026-08-26 09:20:10 -07:00
2026-08-26 12:05:01 -07:00

psf-memo-db

LevelDB REST API for the Memo protocol indexer. Architecture mirrors psf-slp-db.

Database-focused architecture notes live in the indexer repo: psf-memo-indexer/dev-docs/psf-memo-db.md.

Requirements

  • node ^20
  • npm ^10

Installation

cd psf-memo-db
npm install
cp .env-example .env   # optional
npm start

Default port: 5021

API documentation is served at the root URL (http://localhost:5021/). Regenerate with npm run docs.

API

All indexer data is exposed under /level/* with CRUD routes per entity (post, like, name, profile, status, etc.) plus:

  • GET /profile/recent — paginated list of profiles, sorted by block height (newest first)
  • GET /posts/recent — paginated list of posts, sorted by block height (newest first)
  • POST /level/backup — zip database snapshot
  • POST /level/restore — restore from snapshot (exits process)
  • GET /health — health check

List recent profiles

# First page (default limit 100)
curl -sS "http://localhost:5021/profile/recent"

# Page size and offset
curl -sS "http://localhost:5021/profile/recent?limit=50&offset=50"

Query parameters: limit (default 100, max 100), offset (default 0). Block height is read from the stored profile document (blockHeight field, set at indexing time).

List recent posts

curl -sS "http://localhost:5021/posts/recent"
curl -sS "http://localhost:5021/posts/recent?limit=50&offset=50"

Same query parameters as /profile/recent.

Tests

npm test

Production (Docker)

The production Docker setup is in psf-memo-indexer/production/docker. Compose builds memo-db by copying this package from the monorepo root.

License

MIT