Files
web-rust-template-project/Cargo.toml
2026-02-13 15:57:29 +08:00

56 lines
1.3 KiB
TOML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[package]
name = "web-rust-template"
version = "0.1.0"
edition = "2021"
[dependencies]
# ===== Web 框架 =====
axum = "0.7"
tokio = { version = "1", features = ["full"] }
tower = "0.4"
tower-http = { version = "0.5", features = ["cors", "trace"] }
# ===== 数据库(支持 MySQL、SQLite、PostgreSQL =====
# SeaORM - 数据库 ORM替代 SQLX 直接使用)
sea-orm = { version = "1.1", features = [
"runtime-tokio-rustls",
"sqlx-mysql",
"sqlx-sqlite",
"sqlx-postgres",
"macros",
"with-chrono",
"with-uuid",
] }
# ===== 序列化 =====
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# ===== 认证与加密 =====
jsonwebtoken = "9"
argon2 = "0.5"
sha2 = "0.10"
base64 = "0.22"
# ===== Redis =====
redis = { version = "0.27", features = ["tokio-comp", "connection-manager"] }
# ===== 工具库 =====
uuid = { version = "1", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
anyhow = "1"
thiserror = "1"
async-trait = "0.1"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
config = "0.13"
rand = "0.8"
clap = { version = "4", features = ["derive", "env"] }
# 优化发布版本
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
strip = true
panic = "abort"