← Back to projects

tool

Caddy Analytics

  • Next.js
  • TypeScript
  • React
  • Jest
  • Caddy
View on GitHub

Two halves over one Caddy instance. The analytics side parses access logs into a traffic overview, an errors view, and a searchable log explorer, with GeoIP country flags on client IPs and private or loopback addresses marked as local rather than mislabelled as foreign traffic.

The configuration side is the more interesting engineering. Rather than treating the Caddyfile as text to be regex-patched, it implements a proper lexer, parser, and serializer, so the interface can offer a structured editor and a raw view over the same document and keep them synchronised. Each stage is unit-tested independently, because a config editor that silently mangles a directive is worse than no editor at all. Admin access is gated by a generated password hash, with no plaintext credential in the config.