📘 Development Guide: atproto-calendar-import (with atrium-rs)#
🔍 Project Description#
atproto-calendar-import is a Rust library and CLI tool for importing calendar events from external providers (Google, Outlook, Apple, ICS) into the AT Protocol. It leverages the atrium crate for authentication, lexicon-based data modeling, and repository interactions.
📦 Repository Structure#
atproto-calendar-import/
├── src/
│ ├── main.rs # CLI binary entry
│ ├── lib.rs # Core crate definition
│ ├── import/ # External calendar integrations (Google, Outlook, etc.)
│ ├── transform/ # Converts events to AT lexicon
│ ├── pds/ # Interacts with ATP repos via Atrium
│ ├── auth/ # OAuth2 + ATP auth helpers
│ ├── dedup/ # Deduplication logic
│ ├── cli/ # Argument parser and subcommand logic
│ └── errors.rs # Centralized, structured error handling
├── tests/ # Integration tests
├── Cargo.toml # Crate metadata and dependencies
└── README.md # Project documentation
✅ Requirements#
- Rust ≥ 1.70
- Cargo
- External calendar API credentials (Google OAuth, Microsoft)
- Access to a self-hosted or sandbox PDS (see ATP self-hosting guide)
- Postgres (optional, for deduplication cache)
🛠️ Build & Test Commands#
| Task | Command |
|---|---|
| Build | cargo build |
| Type Check | cargo check |
| Format Code | cargo fmt |
| Lint Code | cargo clippy |
| Run All Tests | cargo test |
| Run Specific Test | cargo test <test_name> |