infrastructure/from-localhost-to-production-what-deploying-your-code-really-means.md

From localhost to production: what “deploying” your code really means

Infrastructure · 10 min read ·

Your app runs perfectly at localhost:3000, but the link does nothing on a friend's phone. That's because localhost means "this computer", and only you are sitting at yours.

Deploying is how code moves from your laptop to a server the whole internet can reach. This guide covers development, staging and production environments, how environment variables let the same code use different settings (and why secrets never go in git), and the pipeline every deploy follows: push, build, test, run. Break a step yourself and watch the old version stay live.

$ ls infrastructure/

see all →
infrastructure/structured-logs-why-a-line-of-json-beats-a-sentence-when-something-bre.md Structured logs: why a line of JSON beats a sentence when something breaks at 3 a.m. A plain log line like "order 404 by alice took 87ms" reads well to a human, but a search for 404 also matches order numbers and the middle… 4 min read · 2 Nov infrastructure/rate-limiting-how-a-token-bucket-stops-one-caller-from-using-up-the-wh.md Rate limiting: how a token bucket stops one caller from using up the whole server How do websites stop one noisy caller from using up all the server's time? Many use a token bucket: a bucket that holds a few tokens and… 5 min read · 30 Oct infrastructure/exponential-backoff-why-waiting-longer-between-retries-keeps-a-struggl.md Exponential backoff: why waiting longer between retries keeps a struggling server alive When a server stumbles, every client that failed retries at the same instant, and the second wave can be bigger than the first. Exponential… 5 min read · 27 Oct infrastructure/environment-variables-how-the-same-code-talks-to-a-practice-database-o.md Environment variables: how the same code talks to a practice database on your laptop and the real one online The same program can talk to a practice database on your laptop and the real one on a live website, without a single edit to its code. The… 5 min read · 24 Oct infrastructure/percentiles-why-an-average-response-time-of-235-ms-can-hide-users-wait.md Percentiles: why an average response time of 235 ms can hide users waiting 3 seconds Your dashboard says the average response time is 235 milliseconds, yet some users wait three seconds. Both can be true, because an average… 4 min read · 21 Oct infrastructure/ci-pipelines-how-a-computer-decides-a-change-is-safe-to-merge.md CI pipelines: how a computer decides a change is safe to merge Push a change and a green tick or a red cross appears a minute later. How does a machine decide? It does not understand your code. It reads… 5 min read · 18 Oct