mirror of
https://github.com/tiennm99/vngeoguessr.git
synced 2026-10-11 03:13:56 +00:00
Replace node-redis with @upstash/redis REST client and route all keys through a centralized adapter that prepends KEY_PREFIX (default 'vngeoguessr:'). The new Upstash DB can now be safely shared with other Vercel projects without key collisions. - src/lib/upstash.js: new adapter with getJson/putJson/del + zAdd/zRange/ zScore/zRank/zRevRank/zRemRangeByRank helpers; reads UPSTASH_REDIS_REST_URL or KV_REST_API_URL aliases - src/lib/session.js, src/lib/leaderboard.js: use the adapter; public APIs unchanged so api routes stay untouched - src/lib/redis.js: removed - scripts/migrate-upstash.js: one-shot copy from old TCP DB to new REST DB, prepending the prefix; idempotent, with --dry-run flag - docs/tech-stack.md: reflect the new SDK and prefix model