A high-performance activity feed and real-time notifications system.
# Install dependencies
npm install
# Start server
npm start
# Server runs at http://localhost:3000docker compose up --buildPOST /events
Body: { actor_id, verb, object_type, object_id, target_user_ids[] }
Returns: { event_id }
GET /feed?user_id=<id>&cursor=<optional>&limit=<optional>
Returns: { items: [event...], next_cursor }
GET /notifications/stream?user_id=<id> # SSE real-time stream
GET /notifications?user_id=<id>&since= # Polling fallback
POST /notifications/:id/read # Mark as read
GET /top?window=1m|5m|1h&type=objects|verbs
Returns: { items: [{key, count}...] }
# Seed test data
npm run seed -- 100000
# Run load tests
npm run test:loadactivity-feed/
├── src/
│ ├── server.js # Entry point
│ ├── config.js # Configuration
│ ├── db/ # Database layer
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ └── utils/ # Utilities (cache, SSE, ring buffer)
├── scripts/ # Seeding and testing scripts
├── docs/ # Design doc and load test report
└── results/ # Load test results
- Design Document - Architecture, data model, scaling plan
- Load Test Report - Performance benchmarks
- Node.js / Express
- SQLite (sql.js)
- Server-Sent Events (SSE)