WorkPulse
Real-Time KPI & Time Management System
Managing task logs and team velocity in hybrid development teams often leads to stale data or administrative overhead. Standard tracking tools rely on periodic HTTP polling, which causes delayed updates or heavy read/write loads on the database. The objective was a real-time tracking interface capable of handling 50+ concurrent websocket sessions with update delivery under 50ms.
- Persistent WebSockets via Socket.io to eliminate HTTP handshake overhead for repetitive log events.
- MongoDB schema with compound indexes on { userId, date } and nested session_logs sub-documents — keeping query retrieval under 15ms.
- Optimistic UI updates: React state changes immediately; failed writes trigger a callback rollback with a user alert.
Server CPU usage spiked during testing because duplicate Socket client instances were created by React components on every state re-render.
Centralised the socket connection inside a React Context Provider and added a clean-up hook to disconnect on unmount. Idle CPU dropped from 45% to under 5%.