···11+# atBB
22+33+**A BB-style forum, on the ATmosphere!**
44+55+atBB is a decentralized forum built on the [AT Protocol](https://atproto.com/). Users authenticate with their AT Proto identity (DID) and own their posts on their own Personal Data Server (PDS). The forum's AppView subscribes to the network firehose, indexes relevant records, and serves them through a web interface.
66+77+- **Domain:** [atbb.space](https://atbb.space)
88+- **Lexicon namespace:** `space.atbb.*`
99+- **License:** AGPL-3.0
1010+- **Organization:** [atBB-Community](https://github.com/atBB-Community)
1111+1212+## Architecture
1313+1414+```
1515+┌─────────────┐ ┌──────────────┐ ┌─────────────────┐
1616+│ Forum UI │────▶│ AppView │────▶│ Firehose / │
1717+│ (Web App) │◀────│ (Node/TS) │◀────│ User PDS nodes │
1818+└─────────────┘ └──────┬───────┘ └─────────────────┘
1919+ │
2020+ ┌──────▼───────┐
2121+ │ Forum DID │
2222+ │ (Service │
2323+ │ Account) │
2424+ └──────────────┘
2525+```
2626+2727+User-generated content (posts, reactions, memberships) lives on each user's PDS. Forum metadata (categories, roles, mod actions) lives on a dedicated Forum Service Account. The AppView indexes both into a unified view.
2828+2929+## Packages
3030+3131+This is a [Turborepo](https://turbo.build/) monorepo with [pnpm](https://pnpm.io/) workspaces.
3232+3333+| Package | Description |
3434+|---------|-------------|
3535+| [`packages/lexicon`](packages/lexicon) | AT Proto lexicon schemas (YAML) and generated TypeScript types |
3636+| [`packages/appview`](packages/appview) | Hono-based JSON API server |
3737+| [`packages/web`](packages/web) | Server-rendered web UI (Hono JSX + HTMX) |
3838+| [`packages/spike`](packages/spike) | PDS read/write test script |
3939+4040+## Getting Started
4141+4242+### Prerequisites
4343+4444+- [Nix](https://nixos.org/) with [devenv](https://devenv.sh/) installed
4545+4646+### Setup
4747+4848+```sh
4949+# Enter the development shell (provides Node.js, pnpm, turbo)
5050+devenv shell
5151+5252+# Install dependencies
5353+pnpm install
5454+5555+# Copy and configure environment variables
5656+cp .env.example .env
5757+# Edit .env with your Forum Service Account credentials
5858+5959+# Build all packages
6060+pnpm build
6161+```
6262+6363+### Development
6464+6565+```sh
6666+# Start both servers with hot reload
6767+devenv up
6868+6969+# Or start individually
7070+pnpm --filter @atbb/appview dev # API server on http://localhost:3000
7171+pnpm --filter @atbb/web dev # Web UI on http://localhost:3001
7272+```
7373+7474+### Other Commands
7575+7676+```sh
7777+pnpm build # Build all packages
7878+pnpm clean # Remove all build artifacts
7979+pnpm lint # Type-check all packages
8080+```
8181+8282+## Lexicons
8383+8484+atBB defines custom AT Proto record types under the `space.atbb.*` namespace:
8585+8686+| Lexicon | Owner | Description |
8787+|---------|-------|-------------|
8888+| `space.atbb.forum.forum` | Forum DID | Forum metadata (name, description) |
8989+| `space.atbb.forum.category` | Forum DID | Subforum / category definitions |
9090+| `space.atbb.forum.role` | Forum DID | Role definitions with permission tokens |
9191+| `space.atbb.post` | User DID | Posts and replies (unified model) |
9292+| `space.atbb.membership` | User DID | User's membership in a forum |
9393+| `space.atbb.reaction` | User DID | Reactions on posts (like, upvote, etc.) |
9494+| `space.atbb.modAction` | Forum DID | Moderation actions (ban, lock, pin, etc.) |
9595+9696+Lexicon source files are YAML in `packages/lexicon/lexicons/`. The build pipeline converts them to JSON and generates TypeScript types via `@atproto/lex-cli`.
9797+9898+## Project Status
9999+100100+See [`docs/atproto-forum-plan.md`](docs/atproto-forum-plan.md) for the full project plan and current progress.
101101+102102+**Current phase:** Phase 0 (Foundation) — complete. Monorepo scaffolding, lexicon definitions, and package stubs are in place. Phase 1 (AppView Core) is next.
103103+104104+## Prior Art
105105+106106+The `prior-art/` directory contains git submodules referencing earlier implementations:
107107+108108+- **[atBB](https://github.com/atBB-Community/atBB)** — Original Rust AppView (Axum + SQLx)
109109+- **[lexicon](https://github.com/atBB-Community/lexicon)** — Original lexicon definitions
110110+- **[at-delegation](https://github.com/atBB-Community/at-delegation)** — AT Protocol privilege delegation spec (post-MVP)
111111+112112+## License
113113+114114+[AGPL-3.0](LICENSE)