How caravan-bitcoin/caravan works
Based on our analysis of both the file tree and README, this is a monorepo for the Caravan ecosystem—a set of Bitcoin-related FOSS projects built with Turborepo. The monorepo is split mainly between two top-level directories: one for applications (for instance, the Caravan Coordinator webapp found under apps/coordinator) and one for library packages (under packages, which include various modules like bip32, caravan-bitcoin, caravan-clients, caravan-fees, caravan-health, caravan-psbt, caravan-wallets, multisig, and more). There is also tooling (like changesets for versioning and Turborepo configuration files) that ties the entire ecosystem together.
Main Components
• Create distinct sections for the high-level parts of the monorepo:
– The “Apps” section (with emphasis on the Caravan Coordinator web application).
– The “Packages” section (listing utility libraries such as @caravan/bitcoin, @caravan/wallets, @caravan/clients, @caravan/psbt, etc.).
– The “Tooling & Infrastructure” section (including Turborepo, changesets, CI/CD pipelines via GitHub Actions, linting, testing, and Docker configurations).
Architectural Patterns & Design
• A modular design. The monorepo approach already isolates concerns:
• The app components (React components, client actions, reducers, hooks, etc.) reside in the coordinator (as seen in apps/coordinator/src).
• The supporting libraries in the “packages” directory are “scoped” (for example, @caravan/bitcoin, @caravan/wallets) and provide domain-specific logic (like processing Bitcoin transactions, key management, fee estimation, PSBT creation, etc.).
• Use clear separation of concerns: UI (Coordinator), business logic/libraries (various packages), and developer tooling pipelines.