Wakapi is an open-source, self-hosted alternative to WakaTime that captures and visualizes coding activity data such as time spent on projects, programming languages, editors, and operating systems. Designed for developers who value privacy and data ownership, it provides detailed analytics without relying on third-party cloud services.
Built in Go, Wakapi supports multiple deployment options including Docker, Docker Compose, Kubernetes via Helm, and direct binary execution. It uses SQLite by default but supports MySQL and PostgreSQL, and integrates with Prometheus for metrics monitoring. The system is GDPR-compliant and offers a REST API for programmatic access to coding statistics.
What You Get
- Self-hosted coding analytics - Run your own server to collect and store coding activity data without sending it to third parties.
- WakaTime-compatible API - Fully supports WakaTime’s heartbeat API, allowing seamless replacement of WakaTime with zero client-side changes.
- REST API - Exposes endpoints to query coding statistics, user data, and heartbeats programmatically for integration with custom dashboards.
- Weekly email reports - Automatically sends summaries of coding activity, including languages used, time spent, and project trends.
- Public leaderboards - Displays ranked coding activity across users with configurable time scopes (e.g., 7 days, 30 days, all time).
- Prometheus metrics - Exposes HTTP endpoints for monitoring server health, request rates, and database performance via Prometheus scraping.
- Badge generation - Generates customizable SVG badges for READMEs showing total coding time, languages, or projects tracked.
- Data retention control - Configure how long heartbeat data is stored; supports unlimited retention via paid subscription.
- Import from WakaTime - Migrate historical coding data from WakaTime using batch import tools with configurable rate limits and whitelists.
- GDPR-compliant design - All data is stored locally; no external tracking or telemetry is performed by default.
Common Use Cases
- Running a private developer analytics dashboard - A team lead uses Wakapi to track coding habits across engineers without exposing data to WakaTime’s cloud.
- Personal coding habit tracking - A developer self-hosts Wakapi to monitor daily coding time and language usage over years, with data retention beyond WakaTime’s 12-month limit.
- Integrating coding stats into internal tools - A DevOps engineer pulls Wakapi’s REST API data to display team productivity metrics in a custom Grafana dashboard.
- Educational institution coding behavior analysis - A university department deploys Wakapi to analyze student coding patterns across languages and IDEs for curriculum improvement.
Under The Hood
Architecture
- Clear separation of concerns through layered design with distinct repositories, services, and route handlers following Go best practices
- Dependency injection via package-level initialization enables loose coupling and seamless testability
- Modular routing with versioned endpoints and auto-generated API documentation ensures backward compatibility and developer-friendly usage
- GORM-based data access abstracted behind interfaces supports multiple database backends without service-layer changes
- Static assets and Swagger UI embedded directly into the binary reduce deployment complexity and external dependencies
- Concurrent data structures are intentionally used to manage shared state in high-concurrency API scenarios
Tech Stack
- Go 1.20+ backend with minimal dependencies, compiled into a static binary for distroless deployment
- PostgreSQL as the primary database, managed via Docker with secret-backed environment variables for secure credential handling
- Distroless container images eliminate unnecessary attack surfaces by removing shells and package managers
- Tailwind CSS and Iconify power the frontend with optimized asset pipelines using Brotli compression
- Docker Compose enables production-grade orchestration with multi-stage builds, health checks, and secret mounting
- Vue.js and Handlebars enable dynamic UI rendering, integrated with an npm-based asset build pipeline
Code Quality
- Extensive test coverage across all layers with unit and integration tests using mock dependencies and structured validation
- Clean, modular code organization enforces clear boundaries between models, services, routes, and configuration
- Robust error handling with explicit validation and meaningful HTTP responses prevents silent failures and panics
- Consistent, expressive naming conventions improve readability and maintainability across the codebase
- Strong type safety and generic utilities reduce runtime errors and enhance reliability
- Comprehensive linting and environment isolation practices ensure consistent behavior in development and production
What Makes It Unique
- Full API compatibility with WakaTime enables seamless migration for existing users without breaking integrations
- Event-driven leaderboard system uses publish-subscribe patterns to deliver real-time updates without blocking requests
- Dynamic coding activity aggregation with configurable filters decouples data access from business logic
- Built-in Shields.io-compatible endpoints generate dynamic badges natively, removing reliance on third-party services
- WebAuthn and API key authentication support both personal and team deployments with fine-grained data sharing
- Embedded static assets and auto-generated documentation enable zero-configuration, self-contained deployment