pubky-app-specs
Rust types, sanitization, and validation for Pubky.app data models. Use this crate to build JSON that matches what Pubky indexers expect.
⚠️ Warning: Rapid Development Phase
This specification is in an early development phase and is evolving quickly. Expect frequent changes and updates as the system matures. Consider this a v0 draft.When we reach the first stable, long-term support version of the schemas, paths will adopt the format:
pubky.app/v1/to indicate compatibility and stability
Installation
Rust (crates.io):
JavaScript / TypeScript (npm): see pkg/README.md.
Rust quick start
use ;
use to_vec;
// Create a user profile
let user = new;
let path = create_path; // /pub/pubky.app/profile.json
let json = to_vec.unwrap;
// Parse and validate JSON from storage
let profile = try_from.unwrap;
For a full homeserver flow, see examples/create_user.rs.
Why use this crate
- Validation consistency — same sanitization and validation rules as Pubky indexers.
- Auto IDs and paths — generates IDs, paths, and URLs according to Pubky standards.
- Single source of truth — Rust models drive native apps, WASM bindings, and this spec.
Features
| Feature | Purpose |
|---|---|
openapi |
OpenAPI schemas via utoipa |
= { = "0.6", = ["openapi"] }
- MSRV: 1.89 (see
rust-versioninCargo.toml) - API docs: docs.rs/pubky-app-specs
Models
| Rust type | Purpose |
|---|---|
PubkyAppUser |
User profile information |
PubkyAppFile |
Uploaded file metadata |
PubkyAppPost |
Posts, replies, embeds, and collections |
PubkyAppTag |
Tags applied to Pubky URIs |
PubkyAppBookmark |
Bookmarks for Pubky URIs |
PubkyAppFollow |
Follow relationships |
PubkyAppFeed |
Feed configurations |
PubkyAppMute |
Muted users |
PubkyAppBlob |
Raw binary file data |
PubkyAppLastRead |
Last-read notification timestamp |
Specification
See the full data model specification for URI layout, examples, and validation rules.
License
MIT