Tianji is an open-source, self-hosted platform that unifies website analytics, uptime monitoring, and server status tracking into a single interface. Designed for independent developers and small teams, it solves the fragmentation problem of managing separate tools like Google Analytics, Umami, UptimeKuma, and Prometheus by offering a lightweight, integrated solution with no cookie tracking and GDPR/CCPA compliance.
Built with TypeScript and Docker-first architecture, Tianji supports one-click deployments on Render, Hostinger, Sealos, and ClawCloud. It includes a full OpenAPI for integrations, telemetry collection for deployment analytics, and real-time status pages—all while prioritizing privacy and community-driven development.
What You Get
- Website Analytics - Tracks page views, unique visitors, referrers, and traffic sources without cookies, GDPR/CCPA compliant, with UTM parameter tracking.
- Uptime Monitor - Monitors website availability with passive result reception, customizable check intervals, and real-time status updates.
- Server Status - Monitors server health metrics (CPU, memory, disk) with customizable thresholds and visual dashboards.
- Docker Status - Tracks container health and resource usage directly from Docker environments.
- Telemetry - Collects anonymous deployment data to help developers understand how and where Tianji is being used in the wild.
- Survey & Feeds - Embed surveys on your site and publish status updates via feeds for user communication and feedback collection.
- OpenAPI - Full RESTful API access to analytics, uptime, and server data for custom integrations and automation.
- Status Page - Public-facing status page with real-time uptime and incident reporting for customers and stakeholders.
- Lighthouse Reports - Integrates Lighthouse performance audits to analyze page speed and SEO metrics directly in the dashboard.
- Team Collaboration - Multi-user access with role-based permissions for shared monitoring and analytics teams.
Common Use Cases
- Running a self-hosted analytics stack - A developer replaces Google Analytics and Umami with Tianji to track website traffic without cookies or third-party tracking.
- Monitoring a production server - A sysadmin uses Tianji to monitor server CPU, memory, and Docker container health in real time without installing Prometheus and Grafana separately.
- Publishing status updates to customers - A SaaS founder uses Tianji’s status page to communicate outages and maintenance to users without building a separate page.
- Collecting deployment telemetry - An open-source tool creator embeds Tianji telemetry to understand how many instances are deployed and where, without invasive tracking.
Under The Hood
Architecture
- Monorepo structure with clear separation of client, server, and shared utilities via workspace-based package management, enabling independent development and deployment
- Backend employs Prisma with Zod schema validation to enforce type safety from database models to API layers
- RPC communication via tRPC eliminates REST boilerplate and provides end-to-end type safety between frontend and backend
- Message queues using ZeroMQ decouple async processing from HTTP handlers, with typed schemas and observability instrumentation
- Frontend leverages TanStack Router and React Query for server-side data fetching and intelligent client-side caching
- AI and survey functionalities are modularized through reusable custom hooks and SDK generation utilities
Tech Stack
- Go backend with static linking for container portability and efficient binary distribution
- Next.js and Vite for hybrid SSR/SPA frontend with TypeScript and React 18
- PostgreSQL managed via Prisma migrations with environment-aware configuration
- Docker multi-stage builds optimized for headless browser compatibility and minimal image size
- pnpm monorepo with strict version overrides and workspace-based dependency management
- Vitest with Cloudflare Workers test pool and GitHub Actions for CI/CD with conventional commits
Code Quality
- Extensive test coverage across all layers with snapshot testing, schema validation, and integration mocks
- Clear separation of concerns with modular components, type-safe data layers, and isolated business logic
- Strong type safety enforced throughout via TypeScript, Zod, and auto-generated route types
- Consistent UI patterns with reusable, memoized components and standardized naming conventions
- Comprehensive error handling with custom boundaries, structured logging, and environment-aware test execution
- Robust test infrastructure with context factories, automated cleanup, and SQL/API snapshot assertions
What Makes It Unique
- Native distributed locking for cron jobs ensures single-instance execution in clustered environments
- Dynamic AI gateway with per-user API key forwarding and custom model pricing acts as a multi-tenant LLM proxy
- Real-time worker execution diff viewer with Monaco-based code comparison enables granular function versioning
- Unified telemetry and audit trail correlates user actions, API usage, and worker metrics in a single observability layer
- Configurable workspace settings stored as JSON key-value pairs allow tenant-specific customization without schema changes
- End-to-end traceability from UI interactions to serverless function payloads and logs enables debuggable low-code workflows