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