Posts

Koa Tutorial: Build a Node.js Orders API From Scratch

Image
Quick answer Koa is a small Node.js web framework built by the team behind Express: it gives you a server, a context object, and async middleware, and leaves routing and body parsing to add-on packages. This post builds a small orders API with three routes, lists two seeded orders, creates a third, and fixes a real 400 error when the body never arrives. A small shop in Karachi takes orders over the phone and writes each one in a paper notebook. When a customer calls to ask where an order is, someone flips pages. A simple web API would fix that: list orders, add one, fetch one by number. Express is the usual answer in Node.js, but Koa takes the same idea and makes it smaller: no built-in router, no built-in body parser, just a context object and middleware that reads like plain async code. The rest of this post builds that API, and breaks it once, so you see what a missing piece looks like. What I would check before using it My first check is whether the team is comfortable with asy...

Polars Python Tutorial: Fast DataFrames Without Pandas

Image
Quick answer Polars is a fast DataFrame library for Python, written in Rust, that handles tables of data with a small, clear API. This post loads a real orders CSV from a small shop, fixes a totals column stored as text, groups paid sales by city, and finds the average order value. If you already know Pandas, most ideas will feel familiar, and the places where Polars differs are where it earns its speed. A small online shop in Karachi keeps its orders in a spreadsheet. Twelve rows, three cities, and a totals column that reads "Rs 8,900" instead of 8900, because that is how the shop wrote the numbers down. The owner wants three answers: which city brings in the most money, what a typical paid order is worth, and how much money sits in failed orders. A DataFrame library answers all three in a few lines. The rest of this post loads that file, trips over the totals column, fixes it, and reads the answers out. What I would check before using it My first check is how big the da...

uv Python Tutorial: Manage Projects Without the Mess

Image
Quick answer uv is a fast Python package and project manager from Astral: one tool that creates projects, installs dependencies, manages Python versions, and runs scripts inside their own virtual environment. This post builds a small uv project for a shop in Karachi, adds Pydantic, runs an orders report, and fixes a real missing dependency error along the way. A small shop in Karachi takes orders over the phone and keeps them in a notebook, and the owner wants a simple script that totals sales per city. The script needs one library, Pydantic, to check each order before it is counted. That sounds like a five minute job, yet setup eats the afternoon: create a virtual environment, remember to activate it, install the library into the right place, and hope the next person repeats them. uv folds all of that into a few short commands, shown here with real output. What I would check before using it My first check is whether the project is really a project. A single throwaway script with n...

Turborepo Tutorial: Run Every Package With One Command

Image
Quick answer Turborepo is a build tool for JavaScript and TypeScript monorepos: one command builds every package in the right order and caches the results, so an unchanged package is never rebuilt. This post builds a small shop monorepo with a shared pricing package and a shop app, then shows the second build finishing in 17 milliseconds because the cache hits. A small online shop in Karachi sells kurtas and dupattas. The shop app prices each order, the admin page prices refunds, and a checkout helper prices the cart, and each of the three copies the same discount rule: 10 percent off orders of Rs 10,000 or more, plus 5 percent tax. One day the discount changes to 15 percent, two copies get updated, and the third keeps charging the old price until a customer complains. A monorepo fixes the copying by putting the shared code in one package that every app imports. Turborepo makes that monorepo practical: it runs each package's build in dependency order and remembers the results. W...

Gin Go Tutorial: Build Fast APIs With Very Little Code

Image
Quick answer Gin is a web framework for Go that turns a handful of routes into a working JSON API with almost no boilerplate. This post builds a small orders API with it: list orders, create an order, and fetch one order by id, with real requests and real responses. A small online shop in Karachi takes orders through a chat app, and the owner copies each one into a spreadsheet by hand, until two customers order the same last kurta and both get a yes. The owner needs a small API: a list of orders anyone on the team can read, a way to add one, and a way to fetch one by number. Just three endpoints that answer in JSON. Go fits: it compiles to one binary and starts fast, and Gin keeps the routing and JSON work to a few lines. This post builds exactly that API and breaks it once, so you see what a bad request looks like. What I would check before using it My first check is whether the API is small enough for Gin to stay simple. Three endpoints, JSON in and JSON out, is exactly where Gin...

Axum Tutorial: Build a Rust API Without the Boilerplate

Image
Quick answer Axum is a Rust web framework built on Tokio: you describe routes with small handler functions, and Axum turns them into a fast async HTTP server. This post builds a small orders API with three routes, lists two seeded orders, creates a third, and fixes a real 422 error when the JSON body forgets a field. A small shop in Karachi takes orders over the phone and writes each one in a paper notebook. When a customer calls to ask where an order is, someone flips pages. A simple web API would fix that: list the orders, add a new one, fetch one by number. Rust suits that little service because the compiler catches whole classes of bugs before the code runs, and the finished binary starts fast and uses little memory. Axum turns that Rust code into a server without much ceremony. The rest of this post builds that API, with real output. What I would check before using it My first check is whether the team already writes Rust. Axum is a thin layer, and most of the work is still Ru...

Prometheus Tutorial: Metrics That Show What Your App Does

Image
Quick answer Prometheus is a monitoring system that pulls numbers from your app on a schedule and stores them as time series, so you can ask how many orders failed in the last hour or how slow checkout became after a deploy. Your app exposes the numbers on a /metrics endpoint, Prometheus scrapes it, and you query the results with PromQL. This post builds that first half with Python: a small shop records five real orders. Picture a small online shop in Karachi. Orders come in all day. Then a customer messages to say checkout felt slow, and nobody can say whether it was slow for everyone, or whether it started an hour ago or last week. The logs hold the answer, but only after digging. Metrics change the question from "what happened?" to "how many, and how slow?" That is the gap Prometheus fills: it turns events your app already knows about into numbers you can graph and alert on. What I would check before using it My first check: does anyone look at the numbers? P...