Advanced Projects
Prerequisites: Level 3 — Advanced
Build these using context, concurrency patterns, database/sql, and
the testing and deployment practices from Level 3.
1. Task List REST API
Build a JSON REST API for a task list backed by PostgreSQL or SQLite via
database/sql, with request-logging and panic-recovery middleware,
input validation, and graceful shutdown. Test the handlers with
httptest against an interface-based fake store, and ship it as a
multi-stage Docker image.
2. Parallel Web Crawler
Crawl a site starting from one URL using a bounded worker pool, a shared
"visited" set guarded by a mutex, and a context.Context with a
deadline that cancels every in-flight request when time runs out. Verify
it with go test -race.
3. Rate-Limited API Gateway
Build a reverse proxy (net/http/httputil.ReverseProxy) in front of a
backend service, adding per-client rate limiting, request IDs, and
structured slog logging. Benchmark the hot path with testing.B, then
profile it with pprof and remove at least one unnecessary allocation.