Architecture
High-level view of BeaconAuth components and data flow.
Monorepo layout
crates/beacon: Rust server binary and CLI (serve, migrate, user management).crates/beacon-core: Shared models, crypto, and OAuth helpers used across runtimes.crates/beacon-worker: Cloudflare Worker (wasm32) API runtime.crates/beacon-lambda: Serverless runtime (AWS Lambda or compatible).crates/beacon-passkey: WebAuthn/passkey logic.crates/beacon-frontend-embed: Embeddable frontend utilities.crates/entityandcrates/migration: SeaORM entities and database migrations.src/: React web UI (routes, components, styles).modSrc/: Minecraft mod (Kotlin/Gradle, Architectury) with Fabric/Forge/NeoForge targets.messages/,src/paraglide/,project.inlang/: Localization assets and tooling.content/docs/: Fumadocs documentation.wrangler*.jsonc: Cloudflare Pages and Worker deployment configs.
Runtime components
- Auth server (Rust): Handles login, registration, OAuth, passkeys, and issues ES256 JWTs.
- Web UI (React): Login, registration, settings, profile, and OAuth completion flows.
- Minecraft mod: Performs PKCE-based login and validates JWTs for in-game access.
- Cloudflare Worker (optional): Edge API runtime for serverless deployments.
High-level auth flow
- User authenticates via the web UI (password, OAuth, or passkey).
- The server issues access and refresh tokens (ES256 JWT + refresh cookie).
- The mod requests a Minecraft-specific JWT through the PKCE flow.
- The game server validates the JWT using the JWKS endpoint.
Storage and state
- Default server storage: SQLite (configured via
DATABASE_URL). - Serverless storage: libSQL/Turso via
LIBSQL_URLin the Worker deployment. - Temporary ceremony state: Optional Redis (
REDIS_URL) for multi-instance WebAuthn flows.