Build a Rust Hello World Application

A minimal Rust project that prints a greeting, accepts a name from the command line, includes a test suite, and uses a Makefile to drive common tasks. This tutorial covers project setup with Cargo, module organization, argument parsing with std::env, unit tests, and build automation. Prerequisites Rust 1.70 or later (install via rustup) A Unix-like terminal (macOS, Linux, or WSL on Windows) make installed (pre-installed on macOS and most Linux distributions) No third-party crates required Step 1: Create the project with Cargo Create the file cargo new hello-world Detailed breakdown cargo new hello-world scaffolds a new Rust project with a Cargo.toml manifest and a src/main.rs entry point. When run outside an existing Git repository, Cargo also initializes a new Git repo and generates a .gitignore. When run inside an existing repo (as in this tutorial), it skips Git initialization. The project name hello-world becomes both the directory name and the package name in Cargo.toml. Step 2: Update the gitignore The default Cargo .gitignore only excludes target/. Add common temporary artifacts. ...

6 min

Build a TypeScript Hello World Application

A minimal TypeScript project that prints a greeting, accepts a name from the command line, includes a test suite using Vitest, and uses a Makefile to drive common tasks. This tutorial covers project setup, TypeScript configuration, argument parsing, unit testing, and build automation. Prerequisites Node.js 20 or later npm 9 or later A Unix-like terminal (macOS, Linux, or WSL on Windows) make installed (pre-installed on macOS and most Linux distributions) Step 1: Set up the project structure Create the file mkdir -p hello-world touch hello-world/.gitignore Add the code: hello-world/.gitignore node_modules/ dist/ .DS_Store *.log tmp/ Detailed breakdown node_modules/ excludes installed dependencies, which are restored with npm install. dist/ excludes compiled TypeScript output generated by the build step. .DS_Store, *.log, and tmp/ cover common OS and temporary artifacts. Step 2: Initialize the project and install dependencies Create the file cd hello-world npm init -y Install TypeScript and the test framework as development dependencies: ...

8 min

Build a Go Hello World Application

A minimal Go project that prints a greeting, accepts a name from the command line, includes a test suite, and uses a Makefile to drive common tasks. This tutorial covers project structure, flag parsing, table-driven tests, and build automation. Prerequisites Go 1.22 or later A Unix-like terminal (macOS, Linux, or WSL on Windows) make installed (pre-installed on macOS and most Linux distributions) No third-party packages required Step 1: Set up the project structure Create the file mkdir -p hello-world touch hello-world/.gitignore Add the code: hello-world/.gitignore bin/ *.test *.out .DS_Store *.log tmp/ Detailed breakdown bin/ excludes compiled binaries produced by the build step. *.test and *.out exclude Go test binaries and coverage output files. .DS_Store, *.log, and tmp/ cover common OS and temporary artifacts. Step 2: Initialize the Go module Create the file cd hello-world go mod init hello-world Detailed breakdown go mod init hello-world creates a go.mod file that declares the module path as hello-world. All import paths within the project use this prefix. Since the project uses only the standard library, no dependencies are added to go.mod. Step 3: Create the greeter package This package contains the core greeting logic, separated from the entry point so it can be tested independently. ...

6 min

Build a Python Hello World Application

A minimal Python project that prints a greeting, accepts a name from the command line, includes a pytest test suite, and uses a Makefile to drive common tasks. This tutorial covers project setup with uv, argument parsing, testing with pytest, and automation for a simple but complete workflow. Prerequisites Python 3.10 or later uv 0.4 or later (curl -LsSf https://astral.sh/uv/install.sh | sh) A Unix-like terminal (macOS, Linux, or WSL on Windows) make installed (pre-installed on macOS and most Linux distributions) Step 1: Initialize the project with uv Create the file uv init hello-world cd hello-world Detailed breakdown uv init hello-world scaffolds a new Python project with a pyproject.toml, a main.py sample file, and a .python-version file. pyproject.toml serves as the project manifest, replacing the need for setup.py or requirements.txt. uv automatically creates a .venv virtual environment on first run. Step 2: Add pytest and set up the project Create the file Remove the generated sample file and add pytest as a dev dependency: ...

6 min

Build a CLI Task Manager in Python

A command-line task manager that stores tasks in a local JSON file, supports adding, listing, completing, and deleting tasks, and uses only the Python standard library. Prerequisites Python 3.10 or later uv 0.4 or later (curl -LsSf https://astral.sh/uv/install.sh | sh) A Unix-like terminal (macOS, Linux, or WSL on Windows) make installed (pre-installed on macOS and most Linux distributions) Step 1: Set up the project structure Create the file uv init cli-task-manager cd cli-task-manager rm main.py README.md uv add --dev pytest Add the code: .gitignore __pycache__/ *.pyc .venv/ .pytest_cache/ *.egg-info/ dist/ build/ .DS_Store *.log tmp/ tasks.json Detailed breakdown uv init cli-task-manager scaffolds a new Python project with a pyproject.toml, a main.py sample file, and a .python-version file. rm main.py README.md removes the placeholder files since the project will use its own package structure. uv add --dev pytest installs pytest and records it under [dependency-groups] in pyproject.toml. __pycache__/ and *.pyc exclude Python bytecode files generated at runtime. .venv/ excludes the virtual environment that uv manages locally. tasks.json is excluded because it is runtime data, not source code. Each user generates their own task file. .DS_Store and tmp/ cover common OS and temporary artifacts. Step 2: Create the task storage module This module handles all persistence — reading and writing tasks to a JSON file on disk. ...

10 min

Build a REST API in Go

A JSON REST API for managing a book collection using only the Go standard library. The API supports full CRUD operations, uses Go 1.22 method-based routing, and includes an in-memory store protected by a mutex for concurrent access. Prerequisites Go 1.22 or later A Unix-like terminal (macOS, Linux, or WSL on Windows) curl or a similar HTTP client for manual testing No third-party packages required Step 1: Set up the project structure Create the file mkdir -p rest-api touch rest-api/.gitignore Add the code: rest-api/.gitignore bin/ *.test *.out .DS_Store *.log tmp/ Detailed breakdown bin/ excludes compiled binaries produced by the build step. *.test and *.out exclude Go test binaries and coverage output files. .DS_Store, *.log, and tmp/ cover common OS and temporary artifacts. Step 2: Initialize the Go module Create the file cd rest-api go mod init bookapi Detailed breakdown go mod init bookapi creates a go.mod file that declares the module path as bookapi. All import paths within the project use this prefix. Since the project uses only the standard library, no dependencies are added to go.mod. Step 3: Define the book model and store This file defines the Book struct and an in-memory store with thread-safe CRUD operations. ...

14 min

Build a WebSocket Chat Server in TypeScript

A real-time chat server using WebSockets, built with TypeScript and the ws library on Node.js. The server supports named users, broadcasts messages to all connected clients, tracks join/leave events, and includes a browser-based test client. Prerequisites Node.js 20 or later npm 9 or later A Unix-like terminal (macOS, Linux, or WSL on Windows) A modern web browser for the test client Step 1: Set up the project structure Create the file mkdir -p websocket-chat-server touch websocket-chat-server/.gitignore Add the code: websocket-chat-server/.gitignore node_modules/ dist/ *.js *.d.ts *.js.map !jest.config.js .DS_Store *.log tmp/ Detailed breakdown node_modules/ excludes installed dependencies, which are restored with npm install. dist/ excludes compiled TypeScript output. *.js, *.d.ts, *.js.map exclude generated JavaScript files in the source tree. The !jest.config.js exception keeps the test config if it were in JS format. .DS_Store, *.log, and tmp/ cover common OS and temporary artifacts. Step 2: Initialize the project and install dependencies Create the file cd websocket-chat-server npm init -y Install runtime and development dependencies: ...

16 min