Skip to main content

claw_spawn/
lib.rs

1//! Claw Spawn
2//!
3//! DigitalOcean VPS provisioning + OpenClaw bot orchestration.
4//!
5//! ## Standalone
6//!
7//! Run the binary:
8//! ```bash
9//! claw-spawn-server
10//! ```
11//!
12//! ## Embedded (Axum)
13//!
14//! When the `server` feature is enabled, this crate can be embedded into a larger Axum app:
15//! ```rust,ignore
16//! use axum::Router;
17//! use claw_spawn::infrastructure::AppConfig;
18//! use claw_spawn::server::{build_state_with_pool, router};
19//! use sqlx::PgPool;
20//!
21//! let cfg = AppConfig::from_env()?;
22//! let pool = PgPool::connect(&cfg.database_url).await?;
23//! let state = build_state_with_pool(cfg, pool, true).await?;
24//! let app = Router::new().nest("/spawn", router(state));
25//! ```
26
27pub mod application;
28pub mod domain;
29pub mod infrastructure;
30
31// Standalone + embedded HTTP server support (Axum).
32// Enabled behind the `server` feature so the core library can be used without Axum.
33#[cfg(feature = "server")]
34pub mod server;
35
36pub use application::*;
37pub use domain::*;
38pub use infrastructure::*;
39
40#[cfg(feature = "server")]
41pub use server::*;