The Problem
Teams collecting event data from websites and apps need a self-hosted alternative to commercial platforms like Segment. The existing options either lock data into a vendor's cloud or require significant engineering effort to build ingestion, transformation, and warehouse delivery from scratch.
What This Does
Jitsu is a real-time event collection and data ingestion platform. The repo is a collection of seven self-contained projects: bulker/ (Go-based ingestion engine with SQL warehouse adapters), webapps/ (React/Next.js console for configuration and management), libs/ (shared TypeScript utilities), services/ (auxiliary services), plus cli/, types/, and e2e/. The system collects events via HTTP API or SDKs, routes them through Kafka, and batches them into warehouses like ClickHouse and BigQuery.
The bulker/ directory contains the core ingestion engine with connectors, SQL implementations, and a dead-letter reprocessing system. The webapps/console/ provides the management UI, configuration schema, and API layer.
How It Is Wired
Execution starts at multiple entry points. The primary path is main in bulker/admin/main.go, which reaches 404 functions and ultimately runs external commands via exec.run and reads files via os.Open. The Run function in bulker/jitsubase/appbase/app_base.go is called from 47 places and reaches 411 functions, making it the most central execution path.
The highest-blast-radius modules are in webapps/console/lib/: api.ts (79 modules depend on it), server/db.ts (75 dependents), and context.tsx (62 dependents, in a circular dependency). The most-called internal functions are append (139 call sites), Infof (82), and Close (79). The bulker/jitsubase/jsoniter/reflect.go file is the most connected, called from 83 files.
The system touches external resources: 54 functions read/write databases, 32 handle files, 7 make network calls, and 5 perform cryptographic operations. Traced paths show the flow from entry points through Run, Store, and Close functions to actual filesystem, network, and subprocess operations.
How To Use It
Setup: Clone and run via Docker Compose. The README documents:
git clone --depth 1 https://github.com/moses-y/jitsu
cd jitsu/docker
touch .env.local
Configuration: Set environment variables in docker/.env or .env.local. The repo includes .env.example at the root. Production deployments use the Helm charts in helm/.
Running: Use Docker Compose for development, or deploy the bulker/ services to Kubernetes. The console runs as a Next.js app in webapps/console/.
Real-World Use
A SaaS company deploys Jitsu behind their application, uses the JavaScript SDK to send page-view and custom events, and configures ClickHouse as the destination via the web console. Events flow through the bulker ingestion pipeline, get batched per the configured window, and land in ClickHouse for analytics queries. The dead-letter reprocessor in bulker/admin/deadletter_reprocessor.go handles failed batches.
Code Health & Issues
Static analysis found 255 findings (92 high, 160 medium, 3 low) across 6 kinds:
- High – Import cycle members (23 instances):
webapps/console/lib/context.tsx,schema/index.ts,ui.tsxparticipate in circular imports, making changes ripple unpredictably. - High – Hub modules (20 instances):
webapps/console/lib/api.tsandserver/db.tshave 79 and 75 dependents respectively; any change here has wide blast radius. - High – Oversized files (6):
WorkspacePageLayout.tsxat 683 lines,destinations.tsx, andadmin/notifications.tsare hard to maintain. - High – Deep nesting (6):
server/sync.tsandadmin/notifications.tsreach indentation depth 13. - Medium – Empty catch blocks (4):
store/index.tsxandwarehouse-store.tssilently discard errors. - Medium – High branching density:
serverEnv.tshas 55 branch points over 137 lines.
The code health audit flagged 8 issues, including committed secrets in docker/.env, unpinned GitHub Actions (using @v4 tags instead of commit SHAs), and workflows pushing directly to main without pull requests.
The Bottom Line
Jitsu is a substantial, production-grade ingestion platform with real architectural depth in the bulker Go engine. The console code has notable maintainability debt in its hub modules and circular dependencies. Teams needing a self-hosted Segment alternative with warehouse support should evaluate it; expect to invest in refactoring the console before heavy customization.