Device-Aware Analytics API Server
Overview
An internal analytics API server built on AdonisJS, designed to ingest events and enrich them with device, platform, and user-agent metadata. It pairs a PostgreSQL store with Redis-backed background queues for asynchronous processing.
Why It Exists
Product analytics needs more than raw hits, it needs structured, enriched events that distinguish browser, OS, and device class. This server was built as a self-hosted ingestion and enrichment layer rather than relying on a third-party SaaS analytics product.
What We Built
An API-only AdonisJS application with the framework’s standard building blocks:
Lucid ORM and migrations/seeds against PostgreSQL, token authentication, CORS, and
bodyparser. Incoming traffic is fingerprinted using node-device-detector,
useragent, and platform for device classification. Redis plus adonis-kue
provide a job queue for offloading enrichment and aggregation work. The repo is
containerized (Dockerfile, docker-compose) with environment-specific configs and a
vow-based test setup.
Technologies & Approach
AdonisJS was chosen for its batteries-included MVC/ORM conventions, which let the API focus on ingestion logic instead of plumbing. PostgreSQL via Lucid handles persistence; Redis + Kue decouple write-time ingestion from heavier processing so the HTTP path stays fast.
Outcome / Impact
A working, containerized analytics backend that demonstrates event ingestion, device/user-agent enrichment, and queue-based processing, a reusable pattern for self-hosted product telemetry.
Capabilities Demonstrated
- Self-hosted analytics/event ingestion API
- Device, OS, and user-agent enrichment
- Queue-backed asynchronous processing with Redis
- Containerized, environment-configurable backend service