$ show macro-inc/macro
Macro is a large open-source monorepo (AGPLv3) for an all-in-one collaborative productivity platform that unifies email, messaging, documents, tasks, CRM, AI agents, and more. The backend consists of 42+ Rust microservices following a consistent hexagonal architecture (domain/inbound/outbound), with PostgreSQL, OpenSearch, Redis, S3, Kafka/SQS/EventBridge for data storage and event-driven processing. The frontend is a SolidJS single-page application with a heavily customized Lexical editor, block-based content system, real-time collaboration via CRDT (Loro), and Tauri-based desktop/iOS apps. AI is a first-class feature with agent harnesses, MCP integration, and an AI editing worker. Infrastructure is managed via Pulumi and Docker Compose for local development. The codebase demonstrates high engineering craftsmanship with consistent patterns, extensive testing, and comprehensive observability, though the sheer scale and volume of generated code introduce some maintenance overhead.
The LLM identified 6 files worth highlighting for reuse:
A dedicated Rust crate for safely constructing OpenSearch queries, encapsulating query DSL logic and preventing injection. It is self-contained, depends only on standard types and serde, and can be extracted for any project needing programmatic OpenSearch query generation.
A TypeScript package providing a WebSocket client with backoff/retry, serialization, and queue management for real-time collaboration. It abstracts the sync-service protocol and can be reused in any web or Tauri application requiring CRDT-based collaborative editing.
A Rust rate-limiting library with a Redis adapter and Axum middleware, implementing token bucket or sliding window algorithms. It is decoupled from business logic and can be dropped into any Axum-based service for API rate limiting.
A Rust crate implementing frecency (frequency + recency) scoring for ranking suggestions, with a mock for testing. It is a small, self-contained utility that can be reused in any application needing intelligent default ordering of user-selected items.
A TypeScript utility that wraps localStorage with user-ID namespacing and graceful degradation when storage is unavailable. It is a single-file, dependency-light module that can be extracted into any web app requiring per-user client-side storage.
A Rust crate that declares domain event topics and provides a typed interface for publishing and subscribing to events via Kafka. It follows a clean port/adapter pattern and can be reused as a foundation for event-driven architectures in other Rust monorepos.