- Idempotent hourly rollup (run_rollup, INSERT ... ON CONFLICT DO UPDATE into
analytics_rollups_hourly) + Tokio background task (startup then hourly)
- GET /v1/cards/{id}/analytics/geo — country-grouped visit counts
- GeoResolver trait: real MaxMind under the `geoip` feature, no-op default;
raw IP resolved then discarded (only hash + coarse country/city persisted)
- analytics_events now store country/city; rollups read query for the dashboard
2 new tests (geo grouping, rollup aggregation + idempotency); 75 backend tests.
fmt + clippy clean; geoip feature compiles.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
66 lines
1.8 KiB
TOML
66 lines
1.8 KiB
TOML
[package]
|
|
name = "cardclaws-api"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
# Enable real Apple PKCS#7 pass signing in the binary (pulls in openssl via the
|
|
# wallet crate). Without it the dev build uses a fake signer that produces
|
|
# structurally-correct but unsigned passes — logged loudly at startup.
|
|
default = []
|
|
apple-signing = ["cardclaws-wallet/apple-signing"]
|
|
geoip = ["dep:maxminddb"]
|
|
|
|
[[bin]]
|
|
name = "cardclaws-api"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
cardclaws-types = { workspace = true }
|
|
cardclaws-config = { workspace = true }
|
|
cardclaws-db = { workspace = true }
|
|
cardclaws-auth = { workspace = true }
|
|
cardclaws-wallet = { workspace = true }
|
|
|
|
tokio = { workspace = true }
|
|
axum = { workspace = true }
|
|
tower = { workspace = true }
|
|
tower-http = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
sqlx = { workspace = true }
|
|
redis = { workspace = true }
|
|
reqwest = { workspace = true }
|
|
rusty-s3 = { workspace = true }
|
|
uuid = { workspace = true }
|
|
chrono = { workspace = true }
|
|
sha2 = { workspace = true }
|
|
rand = { workspace = true }
|
|
base64 = { workspace = true }
|
|
validator = { workspace = true }
|
|
async-trait = { workspace = true }
|
|
maxminddb = { version = "0.24", optional = true }
|
|
tracing = { workspace = true }
|
|
tracing-subscriber = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
cardclaws-auth = { workspace = true }
|
|
cardclaws-wallet = { workspace = true }
|
|
cardclaws-config = { workspace = true }
|
|
cardclaws-db = { workspace = true }
|
|
tower = { workspace = true, features = ["util"] }
|
|
http-body-util = "0.1"
|
|
tokio = { workspace = true }
|
|
axum = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
uuid = { workspace = true }
|
|
sqlx = { workspace = true }
|
|
async-trait = { workspace = true }
|
|
zip = { workspace = true }
|