CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/realtime-web-patterns

WebSocket vs SSE vs polling, reconnection with backoff and jitter, heartbeats, backpressure, message ordering, connection state UI, auth on upgrade, graceful degradation

94

1.87x
Quality

98%

Does it follow best practices?

Impact

90%

1.87x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-4/

Real-time Notification Stream

Problem Description

A project management tool needs a real-time notification system. Users receive notifications when they are assigned to a task, when a task they are watching is updated, or when someone mentions them in a comment. Notifications should appear instantly without refreshing the page.

Build a Node.js/Express backend and React/TypeScript frontend:

  • Backend has endpoints to create notifications for specific users
  • Notifications are pushed to the targeted user in real time
  • The UI shows an unread notification count badge and a dropdown list of recent notifications
  • Users can mark notifications as read
  • Notifications have: id, userId, type (assignment | update | mention), title, body, read, createdAt
  • Only the targeted user should receive their notifications (not broadcast to everyone)

Output Specification

Produce the following in a src/ directory:

Server:

  • src/server.ts -- Express server with real-time notification delivery
  • src/notifications.ts -- Notification storage and delivery logic

Client:

  • src/components/NotificationBell.tsx -- The notification icon with unread count badge
  • src/components/NotificationList.tsx -- Dropdown list of notifications
  • src/hooks/useNotifications.ts -- Hook that manages the real-time notification connection

Use in-memory storage. Do not include test files or build configuration.

evals

tile.json