[feature]
name = "analytics"
version = "0.1.0"
source = "p-jpl-website"
description = "Comprehensive analytics system with navigation tracking, server monitoring, and browser analytics"
requires = []

[dependencies]
workspace = ["chrono", "serde_json", "prometheus", "futures", "tokio"]
external = ["ratatui = '0.29'", "inquire = '0.7'", "crossterm = '0.29'", "lru = '0.16'"]

[[environment.variables]]
name = "ANALYTICS_ENABLED"
default = "true"
required = false

[[environment.variables]]
name = "ANALYTICS_LOG_PATH"
default = "logs/analytics"
required = false

[[environment.variables]]
name = "ANALYTICS_API_KEY"
default = ""
required = true
secret = true

[configuration]
files = [
    { path = "config/analytics.toml", template = "templates/analytics.config.toml" },
    { path = "config/routes/analytics.toml", template = "templates/analytics.routes.toml", merge = true }
]

[resources]
public = [
    { from = "assets/analytics.js", to = "public/js/analytics.js" },
    { from = "assets/analytics.wasm", to = "public/wasm/analytics.wasm" }
]

[resources.site]
content = [
    { from = "content/docs/analytics.md", to = "site/content/docs/analytics.md" }
]
i18n = [
    { from = "i18n/en/analytics.ftl", to = "site/i18n/en/analytics.ftl" },
    { from = "i18n/es/analytics.ftl", to = "site/i18n/es/analytics.ftl" }
]

[node]
dependencies = { "@analytics/cli" = "^1.0.0" }

[styles]
uno = { presets = ["@analytics/preset"] }

[docker]
compose = { services = [{ file = "docker/analytics-service.yml", merge = true }] }

[[scripts]]
from = "scripts/analytics-report.nu"
to = "scripts/analytics/report.nu"

[[scripts]]
from = "scripts/analytics-dashboard.nu"
to = "scripts/analytics/dashboard.nu"

[just]
module = "just/analytics.just"
