[package]
name = "kanade-backend"
description = "axum + SQLite projection backend for the kanade endpoint-management system. Hosts /api/* and the embedded SPA dashboard, projects JetStream streams into SQLite, drives the cron scheduler"
readme = "../../README.md"
version.workspace      = true
edition.workspace      = true
rust-version.workspace = true
license.workspace      = true
repository.workspace   = true
homepage.workspace     = true
authors.workspace      = true
keywords.workspace     = true
categories.workspace   = true
include = [
    "src/**/*",
    "migrations/**/*",
    # Only the built SPA bundle — rust-embed reads dist/ at compile
    # time. The source under web/src/ + node_modules/ + the Vite
    # config don't ship to crates.io.
    "web/dist/**/*",
    "Cargo.toml",
]

[dependencies]
kanade-shared = { workspace = true }

anyhow     = { workspace = true }
argon2     = { workspace = true }
async-nats = { workspace = true }
axum       = { workspace = true }
base64     = { workspace = true }
bytes      = { workspace = true }
chrono     = { workspace = true }
clap       = { workspace = true }
futures    = { workspace = true }
humantime  = { workspace = true }
jsonwebtoken = { workspace = true }
mime_guess = { workspace = true }
rand       = { workspace = true }
regex      = { workspace = true }
rust-embed = { workspace = true }
schemars   = { workspace = true }
serde_yaml = { workspace = true }
tokio-cron-scheduler = { workspace = true }
uuid       = { workspace = true }

# Re-exported above already; explicit so the watch loop's `Mutex` use
# is obvious.
serde      = { workspace = true }
serde_json = { workspace = true }
sqlx       = { workspace = true }
tokio      = { workspace = true }
# `ReaderStream` wraps the NATS Object Store's `AsyncRead` for
# axum's `Body::from_stream` — keeps `/api/app-packages/.../get`
# from buffering 100-200 MB MSIs into RAM.
tokio-util = { version = "0.7.18", features = ["io"] }
tower      = { workspace = true }
tower-http = { workspace = true }
tracing    = { workspace = true }
tracing-appender   = { workspace = true }
tracing-subscriber = { workspace = true }

[target.'cfg(target_os = "windows")'.dependencies]
# SCM (Service Control Manager) integration. Same role as in
# kanade-agent — without StartServiceCtrlDispatcher the backend
# process never tells Windows it's alive and SCM kills it after
# 30 s with Event ID 7009 / 'service did not respond'.
windows-service = "0.8.1"

[target.'cfg(target_os = "windows")'.build-dependencies]
winres = { workspace = true }
