$ show jitsucom/jitsu
Jitsu is an open-source event data platform (alternative to Segment) that ingests events from websites, apps, and servers, transforms them via user-defined functions (UDFs) and built-in destination functions, and delivers them to data warehouses (ClickHouse, BigQuery, Snowflake, Redshift, Postgres, S3, GCS) and SaaS tools (Amplitude, PostHog, HubSpot, etc.). The architecture is multi-service: a Go-based bulker handles ingestion and warehouse delivery, a TypeScript-based rotor executes event transformations and profile building, a Next.js console provides the management UI and API, and a CLI tool supports project management and function deployment. The data flow is: HTTP ingest → Kafka → rotor (functions) → bulker (SQL/file destinations) → ClickHouse/PostgreSQL for metrics and logs. External dependencies include Kafka, PostgreSQL, ClickHouse, Redis, MongoDB, and Google Cloud Storage. The console supports multi-tenant workspaces, authentication (Firebase, OIDC, NextAuth), billing, audit logging, rate limiting, and an MCP server for AI tool integration. The codebase is a monorepo with pnpm workspaces and Go modules, featuring extensive test suites (unit, integration with testcontainers, e2e) and CI/CD pipelines. It demonstrates strong engineering practices with reusable libraries (juava, jitsubase), custom high-performance JSON parsers, and well-abstracted repository and configuration patterns. However, there is some technical drift: duplicate JSON libraries (jsoniter and jsonorder), commented-out code, and ESLint disable comments in admin routes. Overall, it is a mature, actively maintained platform suitable for production use.
The LLM identified 4 files worth highlighting for reuse:
A generic fetch wrapper that extracts JSON error bodies, supports retry logic, and returns typed responses. It is self-contained, depends only on standard fetch, and can be extracted into any TypeScript project needing a robust HTTP client with error handling.
A generic ordered map implementation in Go that preserves insertion order and provides type-safe getters for common types (string, int, float, bool) with path navigation. It is a standalone package with no internal dependencies, demonstrating non-obvious skill in combining order preservation with type safety.
A sliding window rate limiter backed by PostgreSQL using atomic upserts. It supports per-auth-class multipliers and exposes Retry-After headers. The implementation is isolated, depends only on a pg pool, and can be reused in any Node.js service needing server-side rate limiting.
A JSON diff/patch library that computes structural differences between two JSON values and applies patches. It is self-contained, has no external dependencies, and demonstrates a clean implementation of a recursive diff algorithm with support for arrays, objects, and primitive values.