bloom_web/
lib.rs

1//! # Bloom Framework
2//!
3//! A lightweight backend framework that focuses on developer ergonomics by combining:
4//! - Actix-Web for high‑performance HTTP
5//! - SQLx (MySQL) for async, compile‑time checked database access
6//! - Declarative macros to auto‑register controllers/routes, entities/migrations, and scheduled jobs
7//! - Inventory-based discovery: drop in code, it self-registers
8//! - Optional OpenAPI generation and Swagger UI via utoipa
9//! - Simple, timestamped logging macro
10//! - Config-first setup using a TOML file (config.toml)
11//!
12//! ## Quick Start
13//!
14//! ```rust
15//! use bloom::prelude::*;
16//!
17//! #[derive(Entity, Serialize, Deserialize)]
18//! #[table("users")]
19//! struct User {
20//!     #[id]
21//!     id: i32,
22//!     #[column("username")]
23//!     username: String,
24//!     #[column("email")]
25//!     email: String,
26//! }
27//!
28//! #[repository(User)]
29//! pub struct UserRepository;
30//!
31//! #[get_mapping("/users")]
32//! pub async fn get_users() -> impl Responder {
33//!     HttpResponse::Ok().json("Hello from Bloom!")
34//! }
35//!
36//! #[tokio::main]
37//! async fn main() -> anyhow::Result<()> {
38//!     bloom::application::run().await
39//! }
40//! ```
41
42pub use bloom_web_core::*;
43
44pub use bloom_web_macros::*;
45
46pub use actix_web::{self, web, HttpResponse, Responder};
47pub use anyhow;
48pub use chrono;
49pub use serde::{Deserialize, Serialize};
50pub use serde_json;
51pub use sqlx;
52pub use utoipa;
53
54/// Convenience module that re-exports the most commonly used items
55pub mod prelude {
56    pub use crate::*;
57    pub use actix_web::{web, HttpResponse, Responder};
58    pub use anyhow::Result;
59    pub use bloom_web_core::*;
60    pub use bloom_web_macros::*;
61    pub use chrono::{DateTime, Utc};
62    pub use serde::{Deserialize, Serialize};
63    pub use serde_json;
64    pub use sqlx::MySqlPool;
65    pub use utoipa::ToSchema;
66}