Self-hosted Analytics with Next.js and PostgreSQL

How I built a fully anonymous, privacy-first analytics system for mxd.codes using Next.js API routes and PostgreSQL without any third-party tracking service.