Overview
Discover what makes Wakapi powerful
**Wakapi** is a lightweight, self‑hosted backend that aggregates coding activity from IDEs and text editors. Designed to be a drop‑in replacement for the proprietary WakaTime service, it exposes a REST API that accepts JSON payloads from client plugins and stores them in a relational database. The core goal is to provide developers with fine‑grained statistics—project, language, editor, OS, and host—while keeping the stack minimal and fast. The application is written in Go (≥1.22), leveraging the standard library’s HTTP server, `encoding/json`, and a small set of third‑party packages for routing (`chi`), logging, and metrics.
Language
Web Framework
Persistence
Metrics
Overview
Wakapi is a lightweight, self‑hosted backend that aggregates coding activity from IDEs and text editors. Designed to be a drop‑in replacement for the proprietary WakaTime service, it exposes a REST API that accepts JSON payloads from client plugins and stores them in a relational database. The core goal is to provide developers with fine‑grained statistics—project, language, editor, OS, and host—while keeping the stack minimal and fast. The application is written in Go (≥1.22), leveraging the standard library’s HTTP server, encoding/json, and a small set of third‑party packages for routing (chi), logging, and metrics.
Architecture & Technical Stack
- Language: Go (statistically typed, compiled, garbage‑collected) ensures a small binary footprint (~15 MB) and low runtime overhead.
- Web Framework: The standard
net/httppackage with the lightweight routergithub.com/go-chi/chi/v5. This keeps request handling fast and eliminates the need for a heavy MVC framework. - Persistence: By default, SQLite is used via
modernc.org/sqlitefor zero‑configuration deployments. Production setups can switch to MySQL or PostgreSQL by setting environment variables (DB_DRIVER,DB_DSN) in the configuration file. - Metrics: Prometheus client (
github.com/prometheus/client_golang) exposes/metricsfor monitoring CPU, memory, request latency, and custom counters such as “sessions recorded”. - Configuration: YAML (
config.default.yml) is parsed withgithub.com/spf13/viper, allowing environment variable overrides and support for Docker secrets or Kubernetes ConfigMaps. - Deployment: A single binary can be run locally, inside Docker (official image
ghcr.io/muety/wakapi:latest), or on Kubernetes via the community Helm chart. The container image is built with multi‑stage Dockerfiles to keep runtime size under 30 MB.
Core Capabilities & APIs
- RESTful Endpoint:
/api/v1/statsaccepts POST requests with a JSON body containinguser_id,project_name,language,editor, andduration. The endpoint validates payloads, inserts or updates rows in the database, and returns a 201 status. - WakaTime Compatibility: Clients that send data in the WakaTime format are accepted with minimal transformation. This allows existing plugins (VS Code, JetBrains, Sublime) to point directly at a Wakapi instance.
- Badge Generation: An HTTP endpoint
/badges/{user}renders SVG badges that can be embedded in README files. The badge includes total hours, active projects, and language distribution. - Email Reports: A background goroutine can be enabled to send weekly summaries via SMTP. The configuration supports TLS, authentication, and templated HTML bodies.
- Webhooks: On successful ingestion, the server can emit a configurable webhook to external services (e.g., Slack, Discord) for real‑time notifications.
Deployment & Infrastructure
Wakapi’s architecture is intentionally minimal to reduce operational overhead:
- Self‑Hosting: No external services are required beyond the database. The binary is stateless, making it ideal for Docker Swarm or Kubernetes deployments.
- Scalability: While SQLite is great for low‑to‑medium traffic, the application supports sharding by user ID or time range when using MySQL/PostgreSQL. Horizontal scaling can be achieved with a load balancer and shared database.
- Containerization: The Docker image is built on
golang:alpinefor compile time andscratchfor runtime, ensuring fast startup (<0.5 s) and low memory usage (~50 MiB). - CI/CD: The project includes GitHub Actions that run unit tests, linting (
golangci-lint), and SonarCloud analysis. Automated releases publish to GitHub Packages and Docker Hub.
Integration & Extensibility
- Plugin Ecosystem: The client side is agnostic; any editor that can send HTTP POSTs to
/api/v1/statswill work. The official Wakapi client is available for VS Code, but developers can write custom scripts in Python, Rust, or Bash. - Extensible API: Custom endpoints can be added by extending the router. For example, a
/api/v1/leaderboardcould aggregate top users by hours worked. - Webhooks & Callbacks: Developers can register webhook URLs in the configuration file. The server sends a JSON payload containing user stats after each batch.
- Prometheus Exporter: Prometheus can scrape
/metricsfor real‑time monitoring, and Grafana dashboards can be built on top of the exported metrics.
Developer Experience
- Documentation: The README is comprehensive, and inline comments in the source code aid understanding. A dedicated
docs/directory contains API specs and configuration examples. - Community Support: The project has an active GitHub issue tracker, a Discord channel for quick questions, and contributors from the open‑source community. Licensing is MIT, ensuring no restrictions on commercial use.
- Configuration Flexibility: Environment variables can override any YAML setting, making it easy to integrate with CI/CD pipelines or secret managers.
Use Cases
- Personal Coding Dashboard – A solo developer can run Wakapi locally to track time spent across projects and generate badges for GitHub READMEs.
- **
Open SourceReady to get started?
Join the community and start self-hosting Wakapi today
Related Apps in development-tools
Hoppscotch
Fast, lightweight API development tool
code-server
Self-hosted development-tools
AppFlowy
AI-powered workspace for notes, projects, and wikis
Appwrite
All-in-one backend platform for modern apps
PocketBase
Lightweight Go backend in a single file
Gitea
Fast, lightweight self-hosted Git platform
Weekly Views
Repository Health
Information
Explore More Apps
Umbraco
Open, scalable CMS empowering enterprises with speed and flexibility
Yopass
Secure, one‑time secret sharing
OliveTin
Secure web interface for predefined shell commands
WildDuck Mail Server
Scalable, Unicode‑first IMAP/POP3 mail server
Espial
Self‑hosted web bookmark manager
Discourse
Open‑source community forum platform with real‑time chat and AI
