Skip to content

fatfingers23/atproto_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust atproto template

A simple template for getting started with writing code using atrium to interact with atproto repos. This is the minimal setup, but we're using the Statusphere lexicon to create some examples that can be used as studs to create your own application.

Holds your rust types created from lexicon json schema files using esquema-cli

How to change and setup lexicons

  1. Setup and put your lexicon schema files in ./atproto_api/lexicons
  2. Install with cargo install esquema-cli --locked --git https://github.com/fatfingers23/esquema.git
  3. Run with from root repo esquema-cli generate local -l atproto_api/lexicons/ -o atproto_api/src/
  4. You now have Rust types for your lexicon schema in /atproto_api/src

This crate holds all your logic for interacting with the atmosphere (jetstream, repos, etc). Can import it into a backend, WASM, or in our case a CLI.

This is a binary showcasing how it can run on the backend cargo run --bin cli -- --help for a list of commands. You can also copy .env.template and change it to .env to save your handle and app password there.

#wasm This is a simple WASM project showcasing the same logic crate as used in the cli binary.

To run make sure you have Trunk setup and then run trunk serve in the directory

CLI and WASM Features to showcase examples

All of these features are implemented in the Logic crate and share a lot of code. JetStream is a bit of an exception and has 2 different implementations. Rocketman for the cli and just a quick and dirty web_sys websocket connection for the WASM one

  • Create a new Statusphere status
  • Get your current Statusphere status
  • Look up someone's status via handle to show did resolver
  • Start a JetStream listener to listen for updates (Includes atrium did resolver via http)

About

Micro atproto project in Rust to jumpstart your project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published