Bubble
Usually replies in seconds
Today
←Back to Projects
mehro screenshot 1

mehro

Period2025
TeamSolo developer
Contribution100%
RoleFull-stack developer: designed and deployed a personal portfolio featuring real-time presence aggregation and privacy-first self-hosted analytics.

A personal portfolio and interactive digital hub featuring live Discord presence streaming, real-time Spotify listening activity via Discord RPC with synchronized lyrics, and a self-hosted SQLite view counter for zero-tracking analytics.

Node.jsExpressdiscord.jsSQLitebetter-sqlite3HTML5CSS3

Key Contributions & Results

Key Contributions
  • Built an integrated Node.js / Express backend service running a persistent Discord gateway bot with GuildMembers and GuildPresences privileged intents.
  • Streamed real-time user online presence, avatar, custom status, and Spotify listening activity directly from Discord RPC with zero Spotify API dependency.
  • Integrated lrclib.net to query and display real-time synchronized song lyrics alongside Spotify scan codes (scannables.scdn.co).
  • Engineered a self-hosted, privacy-respecting view counter powered by better-sqlite3, paired with custom pixel-art digit GIF animations.
Results
  • A dynamic, live portfolio experience that streams real-time developer activity without third-party tracking cookies or external analytics dependencies.

Troubleshooting

Eliminating Discord Gateway Heartbeat Drops & Preventing API Rate Limiting

Problem Discovery
  • The persistent Discord bot connection frequently encountered WebSocket heartbeat timeouts on mobile networks and transient packet drops. Repeatedly fetching member profiles on every web API request caused HTTP 429 (Too Many Requests) rate limiting from Discord.
Solution Process
  • Implemented an in-memory profile cache with a 5-minute TTL (cachedUserProfile), eliminating redundant user profile network queries.
  • Handled Discord gateway reconnection lifecycle events (shardDisconnect, shardResume) with exponential backoff.
  • Decoupled real-time Spotify activity parsing (formatSpotify) into synchronous in-memory transformations of cached gateway presence states.
Result
  • Continuous presence synchronization with zero API rate limit violations and instant (<10ms) web endpoint response times.
💡Lessons Learned
  • High-frequency client-facing status endpoints must be decoupled from upstream third-party APIs through local gateway state caches.