Commit History

fix: geo lookup now works on HF Spaces without MaxMind DB - Add ip-api.com async HTTP fallback when GeoLite2 mmdb is not present - 3-tier resolution: Redis cache (24h) -> MaxMind (offline) -> ip-api.com (free, no key) - Cache key uses SHA-256 hash of IP (raw IP never stored) - Pass redis into get_geo_info from both chat.py and visitor_tracker.py - Fixes country showing as dash on all sessions
f65c89c

AuthorBot commited on

feat: proper visitor analytics system - New Visitor model (visitor_uid + fingerprint fallback, first_seen/last_seen/page_views, geo, device) - VisitorRepository with upsert + analytics queries - visitor_tracker.py: record_visitor() upserts on every session/init - session/init accepts visitor_uid in request body (HF-Spaces iframe-safe, no cookies) - 4 new analytics endpoints: /visitors /geo /devices /sessions/stats - geo.py: region extraction + X-Real-IP support - DB migration: visitor_uid column on chat_sessions - ARCHITECTURE.md updated
3ae7860

AuthorBot commited on

Restructure project for HF Spaces deployment
772f852

AuthorBot commited on