Pre-release — building in public

Build AT Protocol apps in Rust.
Ship in minutes.

A batteries-included backend framework for federated social applications. OAuth, Jetstream, XRPC, and code generation — all wired up. Bring your own frontend.

Terminal
$ cargo install atrg-cli
$ atrg new my-app
$ cd my-app && atrg dev

Everything you need to ship an AT Protocol backend

atrg handles the protocol plumbing so you can focus on your app's business logic. No boilerplate, no guesswork.

🔐

OAuth

AT Protocol OAuth PKCE + DPoP flow. Login, sessions, JWT verification. Zero configuration.

Jetstream

Real-time event streaming with bounded backpressure, auto-reconnection, and lag detection.

🔌

XRPC

AT Protocol RPC endpoints with typed error envelopes and lexicon-driven code generation.

📦

Codegen

Generate Rust types and Axum route stubs from your lexicon JSON files.

📡

Feed Generator

Build custom feeds. Register algorithms, atrg handles the protocol.

🏷️

Labeler

Run a label service. Create, sign, and serve labels per the AT Protocol spec.

v0.2.0 — Coming Soon
🗄️

Postgres + SQLite

Dual database backends. Feature-flagged. Production-ready.

🔑

API Keys + RBAC

Native API key auth, role-based access control, ban system.

📁

Blob Storage

Content-addressed S3 + filesystem storage for user content.

🧩

Multi-Binary

Scaffold write server + read aggregator from one workspace.

📧

Email / OTP

SMTP email delivery and OTP verification built-in.

🔄

Event Router

Typed dispatch for Jetstream events by collection and operation.

Hello, AT Protocol!

A complete AT Protocol API server in 10 lines of Rust. OAuth login, session management, and JSON API routes — ready to serve your frontend.

  • OAuth login + session cookies out of the box
  • Axum router — add routes like any Axum app
  • SQLite database with auto-migrations
  • atrg.toml drives all configuration
  • Jetstream streaming with one method call
src/main.rs Rust
use atrg_core::AtrgApp;

mod routes;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    AtrgApp::new()
        .with_auth_routes(atrg_auth::routes::auth_router())
        .mount(routes::api())
        .run()
        .await
}

Modular by design

14 focused crates in a Cargo workspace. Use what you need, ignore the rest. Every crate has a single responsibility.

atrg-core AppState, Config, app builder
atrg-auth OAuth, sessions, JWT, API keys, RBAC
atrg-db SQLite + Postgres pool, isolated migrations
atrg-xrpc XRPC route helpers + error envelope
atrg-stream Jetstream consumer + EventRouter
atrg-identity DID/handle resolution with cache
atrg-repo Record CRUD, blobs, AT-URIs, TID
atrg-codegen Lexicon → Rust code generator
atrg-blob Content-addressed blob storage
atrg-email SMTP email + OTP verification
atrg-feed Feed generator framework
atrg-label Labeler framework
atrg-testing Test utilities
atrg-cli The atrg binary

atrg handles the hard parts

You focus on your app's business logic. atrg handles the AT Protocol plumbing.

📦

atrg handlesProtocol, infrastructure, plumbing

  • OAuth PKCE + DPoP login flow
  • Session management + token refresh
  • DID/handle resolution + caching
  • AT Protocol JWT verification
  • XRPC error envelopes per spec
  • Jetstream consumer with backpressure
  • Database migrations (SQLite + Postgres)
  • Lexicon-to-Rust code generation
  • CORS, security headers, content-type
  • Client metadata + well-known endpoints
🔨

You buildYour app's unique value

  • Your lexicon definitions (JSON)
  • Business logic in Axum handlers
  • Database schemas for your domain
  • Feed algorithms
  • Labeling policies
  • Jetstream event processing logic
  • Your frontend (web, mobile, native)
  • Deployment & infrastructure

Ready to build?

Get a working AT Protocol API server in under five minutes.

$ cargo install atrg-cli

""""