[package]
name = "appflowy-cloud"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
actix = "0.13"
actix-web = { version = "4.3.1", features = ["openssl"] }
actix-http = "3.3.1"
actix-rt = "2"
actix-web-actors = { version = "4.2.0" }
actix-service = "2.0.2"
actix-identity = "0.6.0"
actix-cors = "0.6.4"
actix-router = "0.5.1"
actix-session = { version = "0.8", features = ["redis-rs-tls-session"] }
openssl = { version = "0.10.45", features = ["vendored"] }

# serde
serde_json.workspace = true
serde.workspace = true
serde-aux = "4.1.2"

tokio = { version = "1.26.0", features = [
    "macros",
    "rt-multi-thread",
    "sync",
    "fs",
    "time",
] }
tokio-stream = "0.1.14"
tokio-util = { version = "0.7.9", features = ["io"] }
futures = "0.3.17"
futures-util ={ version = "0.3.26" , features = ["std","io"] }
config = { version = "0.13.3", default-features = false, features = ["yaml"] }
once_cell = "1.13.0"
chrono = { version = "0.4.23", features = ["serde", "clock"], default-features = false }
derive_more = { version = "0.99" }
argon2 = { version = "0.5", features = ["std"] }
secrecy = { version = "0.8", features = ["serde"] }
rand = { version = "0.8", features = ["std_rng"] }
anyhow = "1.0.40"
thiserror = "1.0.24"
reqwest = { version = "0.11.20", default-features = false, features = ["json", "rustls-tls", "cookies"] }
unicode-segmentation = "1.0"
lazy_static = "1.4.0"
fancy-regex = "0.11.0"
validator = "0.16.0"
bytes = "1.4.0"
rcgen = { version = "0.10.0", features = ["pem", "x509-parser"] }
mime = "0.3.17"
# aws-config = "0.56.1"
# aws-sdk-s3 = "0.31.1"
rust-s3 = "0.33.0"
redis = "0.23.3"
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.16", features = ["registry", "env-filter", "ansi", "json"] }
tracing-bunyan-formatter = "0.3.6"
tracing-actix-web = "0.7"
tracing-log = "0.1.1"
sqlx = { version = "0.7", default-features = false, features = ["runtime-tokio-rustls", "macros", "postgres", "uuid", "chrono", "migrate"] }
async-trait = "0.1.73"
prometheus-client = "0.22.0"

# collab
collab = { version = "0.1.0", features = ["async-plugin"] }

#Local crate
token = { path = "libs/token" }
snowflake = { path = "libs/snowflake" }
realtime = { path = "libs/realtime" }
database = { path = "libs/database" }
database-entity.workspace = true
gotrue = { path = "libs/gotrue" }
gotrue-entity = { path = "libs/gotrue-entity" }
infra = { path = "libs/infra" }
app-error = { workspace = true, features = ["sqlx_error", "actix_web_error"] }
shared_entity = { path = "libs/shared-entity", features = ["cloud"] }
realtime-entity = { workspace = true }
itertools = "0.11"
axum_session = "0.7.0"
uuid = "1.4.1"
tokio-tungstenite = { version = "0.20.1", features = ["native-tls"] }
prost = "0.12.1"


[dev-dependencies]
once_cell = "1.7.2"
collab-entity = { version = "0.1.0" }
tempfile = "3.4.0"
assert-json-diff = "2.0.2"
dotenv = "0.15.0"
scraper = "0.17.1"
client-api = { path = "libs/client-api", features = ["collab-sync", "test_util"] }
opener = "0.6.1"
image = "0.23.14"

[[bin]]
name = "appflowy_cloud"
path = "src/main.rs"

[lib]
path = "src/lib.rs"

[workspace]
members = [
    "libs/token",
    "libs/snowflake",
    "libs/realtime",
    "libs/realtime-entity",
    "libs/database",
    "libs/database-entity",
    "libs/client-api",
    "libs/infra",
    "libs/shared-entity",
    "libs/gotrue",
    "libs/gotrue-entity",
    "admin_frontend",
    "libs/app_error",
]

[workspace.dependencies]
realtime-entity = { path = "libs/realtime-entity" }
database-entity = { path = "libs/database-entity" }
app-error = { path = "libs/app_error" }
serde_json = "1.0.108"
serde = { version = "1.0.108", features = ["derive"] }

[profile.release]
lto = true
opt-level = 3
codegen-units = 1

[profile.profiling]
inherits = "release"
codegen-units = 16
debug = true
lto = false

[profile.dev.package.sqlx-macros]
opt-level = 3

[patch.crates-io]
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "da072600" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "da072600" }

# Comment the above and uncomment the below to use local version of collab by cloning the repo and placing it in libs folder
#collab = { path = "libs/AppFlowy-Collab/collab" }
#collab-entity = { path = "libs/AppFlowy-Collab/collab-define" }
