ChronoStory Drop Item Search System
Tech Stack Versions
Precise technology versions used in this project
Screenshots
Main feature screens of the project
Hit Rate Calculator — Precise numerical tool
Homepage (Light Mode) — Drop item search & filter
English Interface — Full i18n localization support
User Menu — Discord OAuth login integration
Trade Market — Player-to-player trading platform
Create Listing — Item listing & pricing interface
OCR EXP Tracker — Tesseract.js game screenshot recognition
System Architecture
3-tier caching strategy and data flow architecture
Performance Metrics
Lighthouse scores and Core Web Vitals measurements
Lighthouse Scores
Core Web Vitals
Project Results
Specific achievements and technical highlights of the project

↑ Real Google Analytics traffic data proof
Capabilities Demonstrated
Technical and business capabilities demonstrated through this project
- Real Traffic - 1,000+ daily users at peak, Dec 2025–Mar 2026
- Rapid Iteration - 80+ automation scripts with daily ETL pipeline
- 20+ data scraping & sync scripts
- 40+ data transformation & batch processing scripts
- 15+ image download & CDN management scripts
- Security - CSP security headers + Zod input validation + quota system atomic operations
Challenges Faced
Main technical challenges encountered during development
- Multi-tab WebSocket coordination — Supabase Realtime opens a connection per tab, N tabs = N connections consuming server resources
- Browser OCR with variable game screenshots — inconsistent lighting, fonts, and backgrounds cause unreliable text recognition
- Zero-cost global serving of 4,143+ data entries — traditional CDN egress fees scale linearly with traffic
- Cross-device preference sync with cycle prevention — 30+ preference keys must sync in real-time without creating infinite update loops
- Managing 49 custom hooks in single-page architecture — preventing re-render cascades and maintaining clean separation of concerns
Solutions
Technical solutions and implementation strategies adopted
- Distributed Tab Leader election via BroadcastChannel + Zod-validated heartbeat, reducing WebSocket connections from N to 1 with 5-second failover
- 6-mode preprocessing pipeline (5 binary thresholds + raw) with confidence-based result selection for automated EXP tracking
- Cloudflare R2 zero-egress CDN + immutable cache headers + GitHub Actions auto-sync with version-based cache busting
- Debounced batch writes with Supabase Realtime cycle prevention + guest variant keys + Tab Leader single-connection broadcast
- Hooks-as-service-layer pattern + 6 React Context boundaries + SWR implicit data sharing with 60s dedup window
Code Snippets
Key implementation code from the project
// lib/cache/localStorage.ts - 4-Layer Cache Architecture
const CACHE_PREFIX = 'cs_cache_'
const DEFAULT_TTL = 5 * 60 * 1000 // 5 minutes
export function getFromCache<T>(key: string): T | null {
const raw = localStorage.getItem(`${CACHE_PREFIX}${key}`)
if (!raw) return null
const { value, timestamp, ttl } = JSON.parse(raw)
if (Date.now() - timestamp > (ttl || DEFAULT_TTL)) {
localStorage.removeItem(`${CACHE_PREFIX}${key}`)
return null
}
return value as T
}
export function setToCache<T>(key: string, value: T, ttl?: number) {
localStorage.setItem(`${CACHE_PREFIX}${key}`, JSON.stringify({
value, timestamp: Date.now(), ttl: ttl || DEFAULT_TTL
}))
}
// Layer progression:
// L1: localStorage (permanent, 0ms) -> user preferences
// L2: SWR (60s dedup window) -> UI state revalidation
// L3: ISR (24h revalidation) -> server-side static pages
// L4: Cloudflare R2 (immutable headers) -> zero egress CDNArchitecture Decisions
Key architectural and technical decisions made during development
Context
Game data queries need ultra-low latency and different data types have different update frequencies. A single CDN layer can't differentiate caching strategies for preferences vs static data.
Options Compared
- Simple implementation
- Zero egress fees
- User preferences can't update in real-time
- No client-side request dedup
- Each layer serves different access patterns
- SWR 60s dedup reduces API calls
- User preferences permanently saved on client
- Cache invalidation needs careful design
- More complex implementation
Decision
Chose 4-layer cache: localStorage for preferences (permanent), SWR for dedup (60s), ISR for DB offload (24h), R2 for zero egress (immutable headers)
Outcome
Zero CDN egress cost serving 4,143+ entries, 4-layer progression maximizing cache hit rate
Technical Highlights
In-depth technical implementation details and architecture design
Discord OAuth Integration
- Discord one-click login - Passwordless authentication
- Supabase Auth integration - Automatic session management
- JWT token verification - Secure API access control
Full-Stack Supabase Integration
- PostgreSQL database - Full CRUD operations
- Row Level Security (RLS) - Row-level access control
- Realtime subscriptions - Live data synchronization
- Supabase Realtime - Real-time cross-device preference sync
4-Layer Caching Architecture
- localStorage preferences - Permanent storage, zero-latency access
- SWR client cache - 60s dedup window + automatic revalidation
- ISR server cache - 24h Incremental Static Regeneration
- Cloudflare R2 CDN - Immutable cache headers + zero egress cost
Unified Error Handling & Middleware
- 7 standard error types + Automatic trace ID
- 5 middleware composition patterns (auth, admin, bot protection)
- Unified API response format & logging system
Key Takeaways
Important lessons and reflections from this project
4-layer caching works because each layer serves a different access pattern — localStorage for preferences, SWR for dedup, ISR for DB offload, R2 for zero egress
Real Impact: Zero CDN egress cost serving 4,143+ entries with progressive 4-layer cache maximizing hit rate
Zero-cost architecture requires one-time custom tooling investment — R2 saves hosting but needs GitHub Actions + version-based cache busting
Real Impact: Custom tooling is one-time investment while cost savings compound; 4,143+ entries served at zero egress cost
Gaming communities demand far more data freshness than expected — 5-min cache TTL was still too long on patch days
Real Impact: Added manual cache purge and auto-shortened TTL on game update days
Browser APIs can replace server infrastructure — BroadcastChannel + heartbeat protocol enables distributed Tab Leader election
Real Impact: WebSocket connections reduced from N to 1 with 5-second failover at zero server cost
Browser OCR success depends on preprocessing, not the recognition engine — 6 modes + confidence ranking makes Tesseract.js viable for game screenshots
Real Impact: Zero cloud API costs, zero privacy concerns, user data stays entirely in the browser
Hooks-as-Services enables single-page complexity without framework overhead — 49 hooks + 6 Contexts replace Redux/Zustand
Real Impact: No external state management dependency, and Context boundaries provide clean separation of concerns
Interested in this project?
Feel free to reach out to discuss similar technical solutions or how I can help with your project.
Contact Me