KRISH MAURYA — FOLIO ©2026
0
[CS /01] Case study — ©2026SELECTED WORK (03)

DevNet

A social platform for developers where feeds, notifications and threads update the moment they happen — no refresh, no polling.

ROLEFull-stack · solo build
TIMELINE2026 · 3 months
CORE STACKNext.js · WebSockets · PostgreSQL
STATUSShipped
[01] OverviewTHE SHORT VERSION

What it is.

DevNet started from a simple frustration: developer communities feel slow. You post, you wait, you refresh. I wanted a social layer for developers that behaves like a terminal — instant, dense and alive — where every like, comment and notification lands the millisecond it happens.

It is a full Next.js + TypeScript application with a WebSocket gateway on Node, PostgreSQL for durable state and Redis for pub/sub. The feed, notifications and thread views are all push-driven, so the client never asks the server “anything new?” — the server simply tells it.

Next.jsTypeScriptNode.jsWebSocketsRedisPostgreSQLDrizzle ORMZod
krishmaurya.me/devnet01 / 03
devnet — feed · live
DevNet — app preview

DevNet

WebSocket-powered feeds, notifications & threads
[02] The challengeWHY IT WAS HARD

Problems worth solving.

  • Keeping hundreds of concurrent feed connections alive on one Node process without melting the event loop.
  • Making notifications feel instant without spamming clients with polling traffic.
  • Designing a normalized PostgreSQL schema for posts, threads and reactions that stays fast as threads go deep.
  • Preventing duplicate or out-of-order events when sockets reconnect on flaky networks.
[03] ApproachHOW IT GOT BUILT

Built in four moves.

STEP 01

Real-time layer first

A WebSocket gateway with Redis pub/sub, so every server instance sees every event and reconnecting clients replay the messages they missed.

STEP 02

Normalized data model

Posts, threads, reactions and notifications live in PostgreSQL with indexed timelines — feed reads stay at single-digit milliseconds.

STEP 03

Types end to end

TypeScript from database rows to React props. Shared event and entity types killed an entire class of runtime bugs before they shipped.

STEP 04

Optimistic UI

Reactions and comments apply instantly on the client, then reconcile with the server — the feed feels alive even on slow connections.

[04] Key featuresSHIPPED & WORKING

What it does.

Live feed

Posts stream in over WebSockets with zero polling and zero page reloads.

Instant notifications

Likes, comments and mentions push to the bell the moment they fire.

Threaded discussions

Nested replies with collapsible depth and stable scroll position.

Presence & typing

See who is online in a thread and when someone is composing a reply.

Reconnect replay

Missed events are replayed from Redis on reconnect — nothing gets lost.

Optimistic updates

Interactions land instantly and reconcile quietly in the background.

[05] Under the hood$ tree ./devnet

How it fits together.

krish@dev — zsh — 80×24
krish@dev ~ % tree ./devnet --depth 1
./devnet
├── client/ Next.js app — RSC + client islands
├── gateway/ WebSocket server — presence, replay buffers
├── api/ REST + realtime hybrid — Zod-validated
├── db/ PostgreSQL — posts, threads, reactions
└── cache/ Redis — pub/sub channels, rate limits
KEY DECISIONSDECISIONS.md
  • WebSockets over SSE — the feed needs bidirectional traffic (typing, presence), not just a one-way stream.
  • Redis pub/sub between instances — horizontal scaling without sticky-session gymnastics.
  • PostgreSQL over a document store — threads and reactions are relational by nature; joins beat denormalization here.
[06] Results & learningsBY THE NUMBERS

What it proved.

median event → screen latency<50ms
polling requests — pure push0
typed API surface, client to DB100%
  • Design the event schema before the UI — every view is just a projection of the event stream.
  • Idempotent event IDs make reconnects boring, and boring is exactly what you want in realtime systems.
  • Optimistic UI with quiet reconciliation is the single biggest perceived-performance win you can ship.