Skip to content
Start in Cloud

Tech Stack

HitKeep is built with a deliberate, minimal stack chosen for performance, auditability, and operational simplicity. Every dependency earns its place.

The application server, ingest pipeline, background workers, and CLI are written in Go. HitKeep ships as a single Linux binary and does not require external database or queue services on the target system. The canonical runtime facts, including about 100 MB release binaries and memory use, live in Facts and Limits.

Why Go:

  • Ships as a single Linux binary for linux/amd64 and linux/arm64
  • Current Linux release binaries target a glibc 2.35+ baseline (for example Amazon Linux 2023, Ubuntu 22.04+, Debian 12+)
  • Excellent standard library for HTTP servers, crypto, and concurrency
  • CGo is used only for DuckDB (the embedded database) — no external services
  • Memory use depends on workload and deployment shape. See Facts and Limits for current guidance.

DuckDB is an in-process analytical database engine embedded directly in the Go binary via duckdb-go/v2. It replaces the PostgreSQL + ClickHouse combination required by most analytics platforms.

Why DuckDB over ClickHouse or PostgreSQL:

DuckDB (HitKeep)PostgreSQL + ClickHouse
Process count12–3
Network sockets required02–3
BackupCopy the HitKeep data directory (hitkeep.db plus any tenants/*/hitkeep.db)Dump multiple databases
Query typeColumnar OLAPRow + columnar split
Storage efficiency~120 MB / million hitsVaries; typically higher with overhead
Direct query accessDuckDB CLI or any Parquet toolpsql / clickhouse-client

DuckDB’s columnar storage engine is purpose-built for analytical queries — aggregations, time-bucketing, and filtering over large event tables — which is precisely the workload analytics generates. HitKeep now also uses DuckDB’s appender API on the ingest path, so incoming hits and events are flushed in micro-batches instead of one SQL INSERT per message.

NSQ is an in-process message queue that decouples the HTTP ingest path from the DuckDB write path. The HTTP handler enqueues each hit in microseconds; background consumers resolve the target tenant store, group messages by store, and write them to DuckDB in micro-batches at a pace that suits the database.

Why NSQ is embedded (not Kafka):

  • Zero external broker to manage or monitor
  • Binds to 127.0.0.1 loopback only — never exposed externally
  • Absorbs traffic spikes without database back-pressure
  • Lets the write path acknowledge messages only after a successful DuckDB batch flush
  • Configurable loopback ports if you run multiple HitKeep instances locally

For high-availability deployments, HitKeep uses Memberlist (the library behind Consul and Serf) for node discovery and Leader election. One node holds the DuckDB write lock (Leader); followers proxy ingest requests to it.

This enables Kubernetes StatefulSet deployments with automatic Leader failover when a pod is rescheduled.

HitKeep uses Go’s standard net/http mux, not an external framework. This minimizes the attack surface and keeps the binary lean.

The optional MCP route is mounted on the same HTTP server when enabled. It is leader-only, read-only, and authenticated with API client bearer tokens.


The dashboard is a Single Page Application built with Angular v21. State management uses Angular Signals throughout — no NgRx, no RxJS BehaviorSubjects for local state.

Why Angular (not React or Vue):

  • Strong TypeScript integration out of the box
  • Angular CLI + ng build --configuration production produces heavily optimized, tree-shaken bundles
  • PrimeNG’s component library has first-class Angular support
  • Change detection with OnPush + Signals eliminates unnecessary re-renders

PrimeNG provides the component library: data tables, charts, dialogs, forms, and navigation. It is styled via the PrimeUI theming system and Tailwind CSS utility classes.

Utility-first CSS framework for layout and spacing. Used in the dashboard alongside PrimeNG’s design tokens for a consistent visual system.

The hk.js tracking snippet is minified using esbuild — the same bundler Angular uses internally — with Web Vitals kept in an opt-in hk-vitals.js split bundle.

The snippet is served from your HitKeep instance — no third-party CDN, no cross-origin request from your visitors’ browsers.


DependencyRole
duckdb-goEmbedded OLAP database
go-nsq + nsqEmbedded message queue
memberlistCluster gossip / Leader election
golang-jwt/jwtJWT session tokens
go-mailSMTP email delivery
mjml-goMJML email template rendering
phuslu/iplocIP geolocation (offline, embedded)
golang.org/x/cryptoargon2id, WebAuthn crypto primitives
golang.org/x/timeToken bucket rate limiter

Zero cloud SDKs. Zero external service clients (beyond the optional SMTP server you configure). Zero analytics or telemetry libraries.

AI visibility does not add a separate crawler service. Browser-referred visits come through hk.js, and AI crawler fetches are accepted through an authenticated server-side ingest endpoint.


The full source — Go backend, Angular dashboard, tracker snippet — is on GitHub under the MIT license.