[package]
name = "lithair-core"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
readme = "README.md"
description = "Declarative memory-first web framework with built-in event sourcing, RBAC, and distributed consensus"
keywords = ["web", "framework", "event-sourcing", "declarative", "performance"]
categories = ["web-programming::http-server", "database-implementations"]

[lib]
name = "lithair_core"
path = "src/lib.rs"
doctest = false

# Examples are in separate workspace packages in ../examples/

[dependencies]
openraft = { version = "0.9", features = ["serde"], optional = true }
openraft-memstore = { version = "0.9", optional = true }
async-trait = "0.1"
tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
anyhow = "1.0"
lazy_static = "1.5"
serde_json = "1.0"
simd-json = "0.14"                                        # SIMD-accelerated JSON parsing (~3GB/s)
rkyv = { version = "0.8", features = ["bytecheck", "std"] }       # Zero-copy serialization (~10GB/s)
toml = "0.8"
# High-performance serialization
bincode = { version = "2", features = ["serde"] }        # Binary serialization (3-5x faster than JSON)
chrono = { version = "0.4", features = ["serde"] }  # Timestamps for metadata
scc = "3"            # SCC2 HashMap ultra-performant (40M+ ops/sec)
reqwest = { version = "0.13", features = ["json", "rustls", "form"], default-features = false }  # HTTP client with rustls
uuid = { version = "1", features = ["v4", "serde"] }  # For generating unique IDs with Serde
urlencoding = "2.1"  # URL encoding for OAuth2 parameters
clap = { version = "4", features = ["derive"] }  # CLI argument parsing for auto-generated apps
hyper = { version = "1.7", features = ["full"] }
hyper-util = { version = "0.1", features = ["server", "http1", "tokio"] }
http = "1"
http-body = "1"
http-body-util = "0.1"
async-stream = "0.3"
flate2 = "1"
sha2 = "0.10"
hmac = "0.12"                  # HMAC for JWT signatures (crypto-secure)
argon2 = "0.5"                 # Password hashing (OWASP recommended)
base64 = "0.22"                # Proper base64 encoding/decoding
rustls = { version = "0.23", features = ["ring"], optional = true }
tokio-rustls = { version = "0.26", optional = true }
rustls-pemfile = { version = "2", optional = true }
hex = "0.4"
ipnet = "2"
brotli = "8"
bytes = "1"
log = "0.4"
env_logger = "0.11"
mime_guess = "2"
rand = "0.8"
crc32fast = "1.4"  # CRC32 checksums for data integrity validation
# MFA/TOTP support
totp-rs = { version = "5.7", features = ["gen_secret", "qr", "serde"], optional = true }  # Battle-tested TOTP implementation
# OpenAPI documentation support (optional)
utoipa = { version = "5", optional = true }
thiserror = "2.0.17"
futures.workspace = true
lithair-macros = { version = "0.7", path = "../lithair-macros", optional = true }
tempfile = "3"

[dev-dependencies]
# Random free-port picker for integration tests that spawn a real
# `LithairServer` (e.g. tests/require_session_test.rs). Already used in
# cucumber-tests under the same name.
portpicker = "0.1"

[features]
default = ["macros"]

# Re-export derive macros from lithair-macros (recommended)
macros = ["lithair-macros"]

# TLS termination (rustls)
tls = ["rustls", "tokio-rustls", "rustls-pemfile"]

# Multi-Factor Authentication (TOTP)
mfa = ["totp-rs"]

# Distributed consensus (OpenRaft)
cluster = ["openraft", "openraft-memstore"]

# OpenAPI/Swagger documentation support
openapi = ["utoipa"]

# Data Admin UI - Embedded dashboard for database browsing
# Adds ~30KB to binary when enabled
admin-ui = []

# All optional features
full = ["macros", "tls", "mfa", "cluster", "openapi", "admin-ui"]

