Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Activity Feed + Notifications System

A high-performance activity feed and real-time notifications system.

Quick Start

# Install dependencies
npm install

# Start server
npm start

# Server runs at http://localhost:3000

Docker

docker compose up --build

API Endpoints

Event Ingestion

POST /events
Body: { actor_id, verb, object_type, object_id, target_user_ids[] }
Returns: { event_id }

Feed Retrieval

GET /feed?user_id=<id>&cursor=<optional>&limit=<optional>
Returns: { items: [event...], next_cursor }

Notifications

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

Analytics

GET /top?window=1m|5m|1h&type=objects|verbs
Returns: { items: [{key, count}...] }

Load Testing

# Seed test data
npm run seed -- 100000

# Run load tests
npm run test:load

Project Structure

activity-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

Documentation

Tech Stack

  • Node.js / Express
  • SQLite (sql.js)
  • Server-Sent Events (SSE)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages