rapid_rs/lib.rs
1//! # rapid-rs
2//!
3//! Zero-config, batteries-included web framework for Rust.
4//! FastAPI meets Spring Boot, powered by Axum.
5//!
6//! ## Quick Start
7//!
8//! ```rust,no_run
9//! use rapid_rs::prelude::*;
10//!
11//! #[tokio::main]
12//! async fn main() {
13//! App::new()
14//! .auto_configure()
15//! .run()
16//! .await
17//! .unwrap();
18//! }
19//! ```
20//!
21//! ## With Authentication
22//!
23//! ```rust,ignore
24//! use rapid_rs::prelude::*;
25//! use rapid_rs::auth::{AuthConfig, auth_routes};
26//!
27//! #[tokio::main]
28//! async fn main() {
29//! let auth_config = AuthConfig::from_env();
30//!
31//! App::new()
32//! .auto_configure()
33//! .mount(auth_routes(auth_config))
34//! .run()
35//! .await
36//! .unwrap();
37//! }
38//! ```
39//!
40//! ## With Database Migrations
41//!
42//! ```rust,ignore
43//! use rapid_rs::prelude::*;
44//! use rapid_rs::database::{connect_and_migrate, MigrationConfig};
45//!
46//! #[tokio::main]
47//! async fn main() {
48//! let pool = connect_and_migrate(
49//! "postgres://localhost/myapp",
50//! MigrationConfig::default()
51//! ).await.unwrap();
52//!
53//! App::new()
54//! .auto_configure()
55//! .run()
56//! .await
57//! .unwrap();
58//! }
59//! ```
60
61pub mod app;
62pub mod config;
63pub mod database;
64pub mod error;
65pub mod extractors;
66pub mod prelude;
67
68#[cfg(feature = "auth")]
69pub mod auth;
70
71#[cfg(feature = "testing")]
72pub mod testing;
73
74pub use app::App;
75pub use error::{ApiError, ApiResult};
76pub use extractors::ValidatedJson;