WRITINGGagandeep Bhatia
Chat with GaganChatPortfolio
Sign in with GoogleSign in with Google. Opens in new tab
Engineering14 deep-dives

BUILD
LOGS

Deep-dives on the npm packages, browser games, and backend systems I build from scratch, the architecture, the algorithms, and the problems that made them interesting.

14Articles
177Minutes of reading
9npm packages shipped
0Runtime dependencies

INDEX

01

The Defaults That Can Never Be Fixed

fetch() still waits forever. A pg pool still queues forever. Nobody can change that without breaking the entire ecosystem, so the gap is permanent and the tooling has to live inside your running app. Here is what I learned building a runtime auditor for it, including the three bugs that only showed up once the whole thing ran at once.

NODE.JS · RELIABILITY · PRODUCTION

SEP 26 202617 min
02

Building Self-Hosted Product Analytics as an npm Package, Where Counting Was the Hard Part

A capture SDK, an Express collector, a funnel and retention engine, and a React dashboard in one zero-dependency install. Shipping the events was an afternoon; counting them correctly found a funnel that double counted, a retention number wrong by 3x, and an SDK that rewrote history.

SYSTEM-DESIGN · TYPESCRIPT · ANALYTICS

SEP 25 202617 min
03

Building an Embeddable AI Support Chat, Where the AI Was the Easy Part

Five npm packages for a self hosted AI support chat, and the bugs that only appear at deploy time: a vector index that returns zero rows, a queue that stops, and a safety rule that quietly did nothing.

SYSTEM-DESIGN · TYPESCRIPT · AI

SEP 12 202614 min
04

Build an MCP Server That Connects Claude Directly to Your Obsidian Vault

How to build a lightweight MCP server that gives Claude direct access to your Obsidian vault, with project-level scoping, BM25 search, and 16 tools for reading, writing, and managing notes.

MCP · OBSIDIAN · TYPESCRIPT

MAR 20 202610 min
05

Building Signal Hop: A Browser Game as an npm Package

How I built an original reflex/strategy browser game using Canvas 2D, procedural graph generation, and requestAnimationFrame, then packaged it as a reusable React component on npm.

TYPESCRIPT · NPM · CANVAS

MAR 1 202610 min
06

Building Drift Well: A Physics Game as an npm Package

How I built a gravity-based physics game using Canvas 2D, vector math for gravitational fields, and drag-to-aim controls, then packaged it as a reusable React component on npm.

TYPESCRIPT · NPM · CANVAS

MAR 1 202610 min
07

Building Glyph Lock: A Pattern-Deduction Game as an npm Package

How I built a pattern-deduction puzzle game with 8 composable pattern algorithms, progressive difficulty, and a color grid system, then packaged it as a reusable React component.

TYPESCRIPT · NPM · CANVAS

MAR 1 202610 min
08

Building Spore Field: A Territory Control Game as an npm Package

How I built a turn-based territory control game on a hex grid with AI opponents, nutrient sacrifice mechanics, and spreading spore colonies, then packaged it for npm.

TYPESCRIPT · NPM · CANVAS

MAR 1 202610 min
09

Building Pulse Weave: A Rhythm-Timing Game as an npm Package

How I built a rhythm-timing game with rotating concentric rings, gap detection math, and one-button gameplay, then packaged it as a reusable React component on npm.

TYPESCRIPT · NPM · CANVAS

MAR 1 202610 min
10

Building a Log Analyzer CLI as a Zero-Dependency npm Package

How I built a JSONL log analyzer from scratch with percentile computation, four anomaly detection algorithms, pattern matching, and Markdown/JSON report generation, all with zero runtime dependencies.

TYPESCRIPT · NPM · CLI

FEB 22 202614 min
11

Building a JSON Tools Package from Scratch in TypeScript

How I built a zero-dependency npm package for JSON formatting, recursive diffing, and un-stringifying nested JSON, then integrated it as a client-side tool in my portfolio.

TYPESCRIPT · NPM · JSON

FEB 15 202610 min
12

Building a Self-Hosted Tunnel Service as an npm Package in TypeScript

How I built a self-hosted alternative to ngrok and localtunnel from scratch, using WebSockets, wildcard DNS, and an EC2 relay server to expose local ports to the internet via custom subdomains.

WEBSOCKETS · NETWORKING · TYPESCRIPT

FEB 15 202618 min
13

Building an API Gateway & Rate Limiter from Scratch in Node.js

How I implemented three rate limiting algorithms, an API key system, and a real-time analytics dashboard, all without a database.

SYSTEM-DESIGN · NODE.JS · TYPESCRIPT

FEB 10 202612 min
14

Building a Real-Time Collaborative Editor with Operational Transform in Node.js

How I implemented Operational Transform from scratch to build a Google Docs-style collaborative editor with WebSockets and zero database dependencies.

WEBSOCKETS · OPERATIONAL-TRANSFORM · REAL-TIME

FEB 10 202615 min