Infrastructure learning project

Infra from Scratch

A learning project that rebuilds network and infrastructure components with standard libraries. The public main branch currently contains a Python HTTP client, a minimal HTTP server, and a local Go DNS MVP.

  • Python
  • Go
  • Load Balancer
  • Reverse Proxy
  • DNS

What the repository contains

The public main branch contains three small network components and their tests. They are intentionally isolated and readable; the full service chain is not integrated yet.

Python HTTP client

The client in http-server/client.py accepts [http://]host[:port][/path], defaults to port 80, builds an HTTP/1.0 GET request, and reads the status line, headers, and body from the socket. Unsupported transfer and content encodings are rejected explicitly.

Minimal HTTP server

http-server/server.py sequentially binds to 0.0.0.0:8088, reads one request segment, and returns a CRLF-framed HTTP/1.1 response with Content-Length, Connection: close, and HELLO WORLD!.

Go DNS MVP

dns-server/server.go answers UDP queries on 127.0.0.1:8053. An A query for app.local returns 127.0.0.1; unknown names receive NXDOMAIN, while unsupported or malformed queries stay deliberately limited.

Behavior-focused tests

http-server/tests/ covers URL parsing, client-server integration, refused connections, HTTPS rejection, and the server smoke test. dns-server/server_test.go covers the known record, NXDOMAIN, unsupported types, and malformed packets.

Documentation and ADRs

The README files document how to run and test each component. ADRs record the Python unittest choice, the Go choice, and the DNS MVP test structure.

Architecture and scope

The sequence remains an architecture roadmap, not a proven end-to-end deployment. The client, DNS MVP, and one HTTP server exist separately; load balancing and the Redis connection are not implemented yet.

Repository target chain

  1. 01

    Client

    The Python client is the first concrete component and sends HTTP/1.0 GET requests over a socket.

  2. 02

    DNS

    The Go DNS MVP answers local A queries for app.local on 127.0.0.1:8053.

  3. 03

    Load balancer

    Not implemented yet; this component is intended to address multiple HTTP servers later.

  4. 04

    HTTP servers

    A minimal Python server answers on 0.0.0.0:8088; multiple servers and the distribution layer remain planned.

  5. 05

    Redis

    Not implemented yet; a Redis clone is intended to add simple state and data flows later.

Implemented building blocks and roadmap

The current state grows from isolated, tested network components toward a connected learning environment. Each new stage remains measurable through repository code and tests.

Implemented now

01

HTTP client and HTTP server

Python sockets make URL handling, requests, responses, and simple connection lifecycles tangible.

02

DNS MVP

A small Go UDP service models bounded A-record resolution with a fixed local record.

03

Tests and documentation

Standard toolchains, smoke and behavior tests, and ADRs keep the learning steps reproducible.

Next planned steps

01

Reverse proxy and load balancer

Study routing, forwarding, and request distribution as separate responsibilities.

02

Redis clone and container runtime

Rebuild state storage and process isolation as additional foundations.

03

Service discovery, message queue, and object storage

Add heartbeat, registration, producer, consumer, and persistent object flows.

04

Metrics server, scheduler, and certificate authority

Model observation, resource assignment, and signed TLS communication as later topics.

Current state

The public main branch contains a Python HTTP client, a minimal Python HTTP server, and a Go DNS MVP. All three components have matching tests; the end-to-end chain has not been built yet.

This page therefore separates the evidenced repository state from the README roadmap. Reverse proxy, load balancer, Redis clone, container runtime, and the other extensions remain targets. The public repository code, tests, and documentation remain authoritative.