new demo mode & tenure
Some checks failed
Build and publish Docker image / build-and-push (push) Successful in 8m43s
CI / Check (push) Failing after 8m49s

This commit is contained in:
Andras Schmelczer 2026-06-17 07:54:30 +01:00
parent 7656f24544
commit 4a0f00f2a4
64 changed files with 2875 additions and 338 deletions

View file

@ -17,7 +17,7 @@ use crate::utils::GridIndex;
pub struct AppState {
pub data: PropertyData,
pub grid: GridIndex,
/// h3_cells[row_idx] = precomputed H3 cell ID at max resolution (12).
/// h3_cells[row_idx] = precomputed H3 cell ID at max resolution (9).
/// Parent cells for lower resolutions derived via CellIndex::parent().
pub h3_cells: Vec<u64>,
/// O(1) lookup: feature name → index in feature_names/feature_data
@ -85,6 +85,8 @@ pub struct AppState {
pub stripe_referral_coupon_id: String,
/// Bugsink/Sentry-compatible browser error reporting config injected into served HTML.
pub bugsink_frontend_config: Option<BugsinkFrontendConfig>,
/// Per-key rate limiter for unlicensed ("demo") API traffic.
pub demo_rate_limiter: Arc<crate::ratelimit::DemoRateLimiter>,
}
#[cfg(test)]
@ -182,6 +184,7 @@ impl AppState {
stripe_webhook_secret: "whsec_test_secret".to_string(),
stripe_referral_coupon_id: "couponTest30".to_string(),
bugsink_frontend_config: None,
demo_rate_limiter: Arc::new(crate::ratelimit::DemoRateLimiter::new()),
}
}
}