Tech Stack
HitKeep is built with a deliberate, minimal stack chosen for performance, auditability, and operational simplicity. Every dependency earns its place.
The Backend Stack
Section titled “The Backend Stack”Go 1.26
Section titled “Go 1.26”The application server, ingest pipeline, background workers, and CLI are written in Go. The binary is statically linked and requires zero runtime dependencies on the target system.
Why Go:
- Compiles to a single static binary for any target platform (
linux/amd64,linux/arm64) - Excellent standard library for HTTP servers, crypto, and concurrency
- CGo is used only for DuckDB (the embedded database) — no external services
- Low memory overhead: ~45–64 MB RSS for a typical single-site deployment
DuckDB v2.5 (Embedded OLAP)
Section titled “DuckDB v2.5 (Embedded OLAP)”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 count | 1 | 2–3 |
| Network sockets required | 0 | 2–3 |
| Backup | Copy hitkeep.db | Dump multiple databases |
| Query type | Columnar OLAP | Row + columnar split |
| Storage efficiency | ~120 MB / million hits | Varies; typically higher with overhead |
| Direct query access | DuckDB CLI or any Parquet tool | psql / 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.
NSQ v1.3 (Embedded Queue)
Section titled “NSQ v1.3 (Embedded Queue)”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; a background consumer writes 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.1loopback only — never exposed externally - Absorbs traffic spikes without database back-pressure
- Configurable loopback ports if you run multiple HitKeep instances locally
HashiCorp Memberlist (Gossip Clustering)
Section titled “HashiCorp Memberlist (Gossip Clustering)”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.
Standard Library HTTP Server
Section titled “Standard Library HTTP Server”HitKeep uses Go’s standard net/http mux, not an external framework. This minimizes the attack surface and keeps the binary lean.
The Frontend Stack
Section titled “The Frontend Stack”Angular v21 (Signals)
Section titled “Angular v21 (Signals)”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 productionproduces heavily optimized, tree-shaken bundles - PrimeNG’s component library has first-class Angular support
- Change detection with
OnPush+ Signals eliminates unnecessary re-renders
PrimeNG v21
Section titled “PrimeNG v21”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.
Tailwind CSS v4
Section titled “Tailwind CSS v4”Utility-first CSS framework for layout and spacing. Used in the dashboard alongside PrimeNG’s design tokens for a consistent visual system.
esbuild (Tracker Snippet)
Section titled “esbuild (Tracker Snippet)”The hk.js tracking snippet is minified using esbuild — the same bundler Angular uses internally — keeping it under 2 KB with no additional toolchain dependency.
The snippet is served from your HitKeep instance — no third-party CDN, no cross-origin request from your visitors’ browsers.
Runtime Dependencies
Section titled “Runtime Dependencies”| Dependency | Role |
|---|---|
duckdb-go | Embedded OLAP database |
go-nsq + nsq | Embedded message queue |
memberlist | Cluster gossip / Leader election |
golang-jwt/jwt | JWT session tokens |
go-mail | SMTP email delivery |
mjml-go | MJML email template rendering |
phuslu/iploc | IP geolocation (offline, embedded) |
golang.org/x/crypto | argon2id, WebAuthn crypto primitives |
golang.org/x/time | Token bucket rate limiter |
Zero cloud SDKs. Zero external service clients (beyond the optional SMTP server you configure). Zero analytics or telemetry libraries.
Related
Section titled “Related”The full source — Go backend, Angular dashboard, tracker snippet — is on GitHub under the MIT license.