Barazo lexicon schemas and TypeScript types barazo.forum
TypeScript 93.8%
JavaScript 6.2%
Other 0.1%
78 1 0

Clone this repository

https://tangled.org/gui.do/barazo-lexicons https://tangled.org/did:plc:45uheisi25szrjvjurfpritx/barazo-lexicons
git@knot.tangled.wizardry.systems:gui.do/barazo-lexicons git@knot.tangled.wizardry.systems:did:plc:45uheisi25szrjvjurfpritx/barazo-lexicons

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

Download tar.gz
README.md
Barazo Logo

Barazo Lexicons#

AT Protocol lexicon schemas and generated TypeScript types for the forum.barazo.* namespace.

Status: Alpha License: MIT CI Node.js TypeScript


Overview#

Lexicons are the schema language of the AT Protocol. They define how data is structured, validated, and exchanged across the decentralized network. Every record stored on a user's PDS (Personal Data Server) must conform to a lexicon schema.

This package defines the forum.barazo.* namespace -- the data contract between a user's PDS and any Barazo AppView. Because the schemas live on the protocol layer, all forum data (topics, replies, reactions, preferences) is portable: users own their data and can move between AppViews without loss.


Lexicon Schemas#

Lexicon ID Description Key
forum.barazo.topic.post Forum topic with title, markdown content, community, category, tags, and optional self-labels tid
forum.barazo.topic.reply Threaded reply to a topic or another reply, with root and parent references tid
forum.barazo.interaction.reaction Reaction to a topic or reply (e.g., like, heart), scoped to a community's configured set tid
forum.barazo.actor.preferences User-level moderation and safety preferences: maturity filter, muted words, blocked/muted accounts, cross-post defaults literal:self
forum.barazo.authForumAccess OAuth permission set granting repo access to all Barazo record collections --
forum.barazo.defs Shared type definitions (reserved for future reusable types) --

Package Exports#

Generated Types:

import {
  ForumBarazoTopicPost,
  ForumBarazoTopicReply,
  ForumBarazoInteractionReaction,
  ForumBarazoActorPreferences,
} from '@singi-labs/lexicons'

// Record type
type Post = ForumBarazoTopicPost.Record

// Type guard
if (ForumBarazoTopicPost.isRecord(record)) {
  console.log(record.title)
}

// Lexicon validation
const result = ForumBarazoTopicPost.validateRecord(record)

Zod Validation Schemas:

import {
  topicPostSchema,
  topicReplySchema,
  reactionSchema,
  actorPreferencesSchema,
} from '@singi-labs/lexicons'

const result = topicPostSchema.safeParse(input)
if (result.success) {
  // result.data is typed as TopicPostInput
}

Lexicon ID Constants:

import { LEXICON_IDS, ids } from '@singi-labs/lexicons'

LEXICON_IDS.TopicPost // "forum.barazo.topic.post"
LEXICON_IDS.TopicReply // "forum.barazo.topic.reply"
LEXICON_IDS.Reaction // "forum.barazo.interaction.reaction"
LEXICON_IDS.ActorPreferences // "forum.barazo.actor.preferences"
LEXICON_IDS.AuthForumAccess // "forum.barazo.authForumAccess"

Raw Lexicon Schemas:

import { schemas } from '@singi-labs/lexicons'
// Array of LexiconDoc objects for all forum.barazo.* schemas

Quick Start#

Prerequisites: Node.js 24 LTS, pnpm.

Configure GitHub Packages access in .npmrc:

@singi-labs:registry=https://npm.pkg.github.com

Install:

pnpm add @singi-labs/lexicons

Workspace consumers (barazo-api, barazo-web) are already linked via pnpm workspace.


Development#

pnpm install
pnpm test          # Run tests
pnpm build         # Compile TypeScript
pnpm generate      # Regenerate types from lexicon JSON
pnpm lint          # Lint
pnpm typecheck     # Type check

See CONTRIBUTING.md for branching strategy, commit format, and code review process.


Repository Description License
barazo-api AppView backend (Fastify, firehose, REST API) AGPL-3.0
barazo-web Forum frontend (Next.js, Tailwind) MIT
barazo-deploy Docker Compose deployment templates MIT
barazo-website Marketing + documentation site MIT

AT Protocol Lexicon Resources#

Resource Description
lexicon.garden Discovery platform for AT Protocol lexicons -- browse, search, and explore 900+ schemas across the ecosystem. Essential for checking namespace overlap before defining new record types.
lexicon-community/lexicon Shared community lexicons (interaction.like, bookmarks, etc.) for cross-app interoperability.
AT Protocol Lexicon Spec Official specification for the Lexicon schema language.

Community#


License#

MIT

See LICENSE for full terms.


(c) 2026 Barazo