//! # RUSTELO Server
//!
//! <div align="center">
//!   <img src="../logos/rustelo_dev-logo-h.svg" alt="RUSTELO" width="300" />
//! </div>
//!
//! A modular Rust web application template built with Leptos, Axum, and optional components.
//!
//! ## Overview
//!
//! RUSTELO provides a comprehensive foundation for building modern web applications with Rust.
//! The server component handles backend functionality including authentication, database management,
//! content processing, and API endpoints.
//!
//! ## Features
//!
//! - **🔒 Authentication & Security** - JWT tokens, OAuth2, 2FA, RBAC
//! - **🗄️ Database Abstraction** - PostgreSQL and SQLite support
//! - **📧 Email System** - Multiple providers with templating
//! - **🔐 Cryptography** - Secure data encryption and key management
//! - **📄 Content Management** - Markdown processing and media handling
//! - **⚙️ Configuration** - Flexible environment-based configuration
//!
//! ## Quick Start
//!
//! ```rust
//! use server::config::Config;
//!
//! // Load configuration with defaults
//! let config = Config::default();
//!
//! // Access configuration values
//! println!("Server will run on {}:{}", config.server.host, config.server.port);
//! ```
//!
//! ## Architecture
//!
//! The server is organized into several key modules:
//!
//! - [`config`] - Configuration management and environment handling
//! - [`database`] - Database abstraction and connection management
//! - [`crypto`] - Cryptographic utilities for data security
//! - [`migrations`] - Database schema management and migrations
//! - [`utils`] - Common utilities and helper functions
//!
//! ## Optional Features
//!
//! RUSTELO uses feature flags to enable/disable functionality:
//!
//! - `auth` - Authentication and authorization system
//! - `content-db` - Content management with database storage
//! - `crypto` - Cryptographic utilities
//! - `email` - Email sending and templating
//! - `tls` - HTTPS/TLS support
//! - `metrics` - Performance monitoring and metrics
//!
//! ## Examples
//!
//! ### Basic Server Setup
//!
//! ```rust
//! use server::config::Config;
//!
//! fn main() {
//!     // Create configuration with defaults
//!     let config = Config::default();
//!
//!     // Access server configuration
//!     println!("RUSTELO server configured for {}:{}",
//!              config.server.host, config.server.port);
//!
//!     // Check if features are enabled
//!     println!("Auth enabled: {}", config.features.auth.enabled);
//! }
//! ```
//!
//! ### Database Connection
//!
//! ```rust
//! #[cfg(any(feature = "auth", feature = "content-db"))]
//! use server::database::DatabasePool;
//!
//! fn database_example() -> Result<(), Box<dyn std::error::Error>> {
//!     // Detect database type from URL
//!     let db_type = DatabasePool::detect_type("sqlite:app.db")?;
//!     println!("Database type: {:?}", db_type);
//!
//!     // PostgreSQL example
//!     let pg_type = DatabasePool::detect_type("postgresql://user:pass@localhost/db")?;
//!     println!("PostgreSQL type: {:?}", pg_type);
//!     Ok(())
//! }
//! ```
//!
//! ### Cryptographic Operations
//!
//! ```rust
//! #[cfg(feature = "crypto")]
//! use server::crypto::CryptoService;
//!
//! #[cfg(feature = "crypto")]
//! fn crypto_example() -> Result<(), Box<dyn std::error::Error>> {
//!     // Create crypto service with generated key
//!     let crypto = CryptoService::new()?;
//!
//!     // Encrypt and decrypt string data
//!     let data = "sensitive information";
//!     let encrypted = crypto.encrypt_string(data)?;
//!     let decrypted = crypto.decrypt_string(&encrypted)?;
//!
//!     assert_eq!(data, decrypted);
//!     Ok(())
//! }
//! ```
//!
//! ## Configuration
//!
//! RUSTELO uses environment variables and TOML files for configuration:
//!
//! ```toml
//! [server]
//! host = "127.0.0.1"
//! port = 3030
//! protocol = "http"
//!
//! [database]
//! url = "sqlite:data/app.db"
//! max_connections = 10
//!
//! [features.auth]
//! enabled = true
//! jwt = true
//! oauth = false
//! two_factor = false
//! sessions = true
//! password_reset = true
//! email_verification = false
//! ```
//!
//! ## Security
//!
//! RUSTELO implements security best practices:
//!
//! - **Memory Safety** - Rust's ownership system prevents common vulnerabilities
//! - **Input Validation** - Comprehensive validation of all user inputs
//! - **Secure Defaults** - Security-first configuration out of the box
//! - **Regular Updates** - Active maintenance and security patches
//!
//! ## Performance
//!
//! Built for performance with:
//!
//! - **Async/Await** - Non-blocking I/O with Tokio runtime
//! - **Zero-Copy** - Efficient data handling where possible
//! - **Connection Pooling** - Optimized database connections
//! - **Caching** - Smart caching strategies for frequently accessed data
//!
//! ## Contributing
//!
//! Contributions are welcome! Please see our [Contributing Guidelines](https://github.com/yourusername/rustelo/blob/main/CONTRIBUTING.md).
//!
//! ## License
//!
//! This project is licensed under the MIT License - see the [LICENSE](https://github.com/yourusername/rustelo/blob/main/LICENSE) file for details.

pub mod config;
#[cfg(any(feature = "auth", feature = "content-db"))]
pub mod migrations;
pub mod utils;

#[cfg(feature = "crypto")]
pub mod crypto;

#[cfg(any(feature = "auth", feature = "content-db"))]
pub mod database;
