sword_ai/
lib.rs

1#![warn(missing_docs)]
2
3//! # SwordAI
4//!
5//! Making Rust productive for backend, AI systems, data engineering,
6//! and distributed systems.
7//!
8//! Built on [Axum](https://github.com/tokio-rs/axum) and
9//! [SeaORM](https://github.com/SeaQL/sea-orm).
10//!
11//! ## Features
12//!
13//! - Pre-configured Axum server with tracing
14//! - SeaORM integration with PostgreSQL
15//! - Automatic database migration support
16//! - Environment-based configuration
17//!
18//! ## Quick Start
19//!
20//! ```rust,ignore
21//! use sword_ai::{server::run_with_migrator, FrameworkContext};
22//! use axum::{Router, routing::get};
23//!
24//! #[tokio::main]
25//! async fn main() -> anyhow::Result<()> {
26//!     dotenvy::dotenv().ok();
27//!     sword_ai::tracing::init_tracing();
28//!
29//!     run_with_migrator::<Migrator, _>(build_router, true).await
30//! }
31//!
32//! fn build_router(ctx: &FrameworkContext) -> Router {
33//!     Router::new()
34//!         .route("/health", get(|| async { "OK" }))
35//!         .with_state(ctx.clone())
36//! }
37//! ```
38
39pub mod config;
40pub mod db;
41pub mod server;
42pub mod tracing;
43
44pub use config::AppConfig;
45pub use db::connect_db;
46pub use server::FrameworkContext;