Project 7 of 7About 4 weeks, 90-120 hours

Ripple

A social platform built, measured and defended like a real system

Build a small social network with media uploads, a hybrid fan-out feed, Redis caching, queues, rate limits and observability, then load test it and write up what broke. It's a system-design interview answer that actually runs.

What it proves: everything. You designed for scale, made explicit tradeoffs, measured the result under load, and can defend every decision in writing. This is the project that carries your resume.

What you're building

Ripple is a small social network. You sign up, follow people, and post short text with photos. Your home feed shows posts from everyone you follow, newest first. Someone likes your post and a few seconds later you see "Ana and 12 others liked your post." You can search for people and posts. Upload a photo and the post shows "processing" for a moment, then the resized image appears.

The screen is the easy half. Underneath, slow work runs on a background worker, the feed uses a fan-out strategy you chose on paper and proved under load, every cache key has a written invalidation rule, and every mutation is safe to retry. You finish with a design doc, a load-test report with before and after numbers, and a case study.

Features

  • A written design doc: requirements, assumed scale, data model, API surface, diagram and the fan-out choice
  • A monorepo with web, api and worker apps, shared types and validation, and CI on every pull request
  • Sign-up, sessions, profiles and a follow graph with cached follower counts
  • Photo uploads straight to object storage, processed by a worker, with a visible processing state
  • A home feed that pulls at read time, plus push to follower timelines for accounts under a threshold
  • Redis caching for feed pages, profiles and counts, with a written invalidation rule per key and a measured hit rate
  • Aggregated notifications built by a worker from queued events
  • Sliding-window rate limits per user, and Idempotency-Key support on every mutation
  • Search across users and posts with Postgres full-text search
  • JSON logs with one request ID across API, queue and worker, and a four-number dashboard
  • A k6 load-test report and a public case study with a demo video

The stack

PieceUseWhy
Monorepopnpm workspaces + TurborepoOne install and one cached test run for five packages.
LanguageTypeScript everywhereThe job payloads the API sends the worker become a compile-time contract.
webNext.js (App Router)You know it already, and it only renders and calls the API. A Vite + React SPA is fine too.
apiNode.js with Express 5Thin, familiar and well documented. Fastify is the common alternative, and the milestones are the same.
workerA plain Node.js process running BullMQ workersSlow work lives here, and it deploys and scales separately from the API.
DatabasePostgres with Drizzle ORMClose to SQL, so you can explain the queries you wrote. Prisma is fine too.
Cache, rate limits, timelinesRedisSorted sets, TTLs and atomic scripts cover every hot-path need here.
QueueBullMQ (on Redis)Retries, backoff, delayed jobs and queue metrics, with no new infrastructure.
Object storageAn S3-compatible bucket (Cloudflare R2 or AWS S3) with presigned URLsUpload bytes never pass through your API.
Imagessharp in the workerFast resizing and format conversion. Add ffmpeg only if you take on video.
ValidationZod in packages/validationOne schema validates requests in the API and forms in web.
Observabilitypino JSON logs, prom-client metrics, Prometheus and GrafanaAll of it runs locally in Docker Compose.
Load testingk6Scenarios, thresholds and p95 numbers come built in.
Local infra and CIDocker Compose, GitHub ActionsOne command starts everything, and CI uses the same images.

Hosting is optional: one small VPS running the same Compose file is simplest, and Railway or Render also work. Check current pricing first.

How it fits together

 browser (web) ──presigned PUT──────────────► object storage
     │                                             ▲
     │ HTTPS + session cookie                      │ read original,
     ▼                                             │ write variants
  ┌──────┐  SQL   ┌──────────┐         ┌────────┐  │
  │ api  │──────► │ Postgres │ ◄───────│ worker │──┘
  │      │        └──────────┘   SQL   │        │
  │      │  cache, rate limits,        │        │
  │      │──────► Redis (cache) ◄──────│        │ timelines
  │      │  enqueue        ┌──────────────┐     │
  │      │───────────────► │ Redis (queue)│ ───►│ dequeue
  └──────┘                 └──────────────┘     └────────┘
     │ /metrics                                 │ /metrics
     └──────────────► Prometheus ─► Grafana ◄───┘

Follow one photo post. The API hands the browser a presigned URL, valid for a few minutes, and the browser uploads the file straight to the bucket. Then it calls POST /posts with an Idempotency-Key header. The API checks the rate limit, inserts the post as processing, enqueues a process-media job carrying the request ID, and responds within milliseconds. The worker resizes the photo, writes the variants to the bucket, flips the post to ready and enqueues a fanout job. That job pushes the post id into each follower's Redis timeline, unless the author is above the follower threshold. A follower's feed reads that timeline and merges in recent posts from the popular accounts they follow. Every log line on the way carries the same request ID.

Out of scope

  • Kubernetes, microservices or sharding. Three processes and two datastores show every idea here. More only adds deploy work.
  • Elasticsearch, Kafka or a cache cluster. Postgres search, BullMQ and Redis cover this scale. The skill is saying when you'd add each.
  • Direct messages, stories or video calls. They're other products. Huddle already covered real-time messaging.
  • A mobile app. A clean, responsive web client is enough. The work that counts is behind the API.
  • A recommendation algorithm. A reverse-chronological feed with one ranking tweak in search is plenty. Ranking is a whole field of its own.

How to work through it

  1. Design and foundations (design doc, monorepo and CI, auth and the follow graph): about 20-25 hours. Most of the decisions get made here.
  2. The core system (media pipeline, feed fan-out, Redis caching, notifications): about 35-45 hours. The feed alone can take a long weekend.
  3. Hardening (rate limits and idempotency, search, observability): about 20-25 hours.
  4. Proof (load test, case study): about 15-20 hours. Don't squeeze it: the resume bullets come from here.

The rule that matters most: the request path does only what must happen before you can respond, and everything else becomes a job. Before adding work to a handler, ask whether the user must wait for it. If not, enqueue it.

Show it off

Your README should include:

  • The architecture diagram, plus one paragraph that walks a photo post end to end
  • The fan-out decision with its threshold, and the load-test numbers that justified it
  • The invalidation table: every cache key, its TTL and what evicts it
  • The four-number dashboard as a screenshot taken during a load test
  • A link to the design doc and its "what actually happened" section
  • One command to run the whole stack locally (docker compose up plus pnpm dev)

In your demo, post a photo, show it go from processing to ready, then find its request ID in both the API and worker logs.

Resume bullets to adapt (use your own measured numbers):

  • "Designed and built a social platform with a hybrid push/pull feed. Under a k6 popular-user scenario, it held p95 feed latency at X ms with Y concurrent users, compared with Z ms for pure push"
  • "Moved media processing and notification aggregation onto BullMQ workers, cutting p95 create-post latency from X ms to Y ms. Raised the Redis cache hit rate to Z% under load, with a written invalidation rule for every key"

The milestones

Do them in order. Each guide explains the concepts and the steps, and ends with a checklist so you know when you're done. You write all the code.

  1. Step 1Write the system design doc first· 6-8 hoursGuide →
  2. Step 2Set up the monorepo with CI· 5-7 hoursGuide →
  3. Step 3Auth, profiles, and the follow graph· 8-10 hoursGuide →
  4. Step 4Media upload pipeline with background processing· 10-12 hoursGuide →
  5. Step 5Build the feed with an explicit fan-out strategy· 10-14 hoursGuide →
  6. Step 6Add Redis caching with deliberate invalidation· 6-8 hoursGuide →
  7. Step 7Queue-driven notifications· 6-8 hoursGuide →
  8. Step 8Rate limiting and idempotency keys· 6-8 hoursGuide →
  9. Step 9Search across users and posts· 5-7 hoursGuide →
  10. Step 10Observability: structured logs, metrics, tracing· 8-10 hoursGuide →
  11. Step 11Load test and write the scaling report· 8-12 hoursGuide →
  12. Step 12Ship it: demo video + architecture case study· 6-8 hoursGuide →

Want the thinking behind the design? Read the long-form essay on Ripple →