📊 A minimalist, self-hosted WakaTime-compatible backend for coding statistics
Go to file
Ferdinand Mütsch f7d2a39a00 No live mode for requests larger than one day. 2019-05-20 20:57:49 +02:00
middlewares Major refactorings. 2019-05-19 19:49:27 +02:00
models Allow heartbeat fields to be unset. 2019-05-20 18:44:16 +02:00
routes Parallelization. 2019-05-19 21:00:19 +02:00
services Properly order heartbeats. 2019-05-20 19:46:41 +02:00
static No live mode for requests larger than one day. 2019-05-20 20:57:49 +02:00
utils Add intervals for summary requests. 2019-05-19 20:06:07 +02:00
.env.example Update config. 2019-05-19 22:23:51 +02:00
.gitignore Read config from env. 2019-05-06 00:58:01 +02:00
README.md Update Readme. 2019-05-20 20:56:27 +02:00
config.ini Major refactorings. 2019-05-19 19:49:27 +02:00
main.go Add UI and graphs. 2019-05-20 20:44:53 +02:00

README.md

wakapi

Usage

  • Create an empty MySQL database
  • Clone repository
  • Copy .env.example to .env and set database credentials
  • Install dependencies: go get -d ./...
  • Set target port in config.ini
  • Build executable: go build
  • Run server: ./wakapi
  • Edit your local ~/.wakatime.cfg file and add api_url = https://your.server:someport/api/heartbeat

First run (create user account): When running the server for the very first time, the database gets populated. Afterwards you have to create yourself a user account. Until proper user sign up and login is implemented, this is done via SQL, like this.

  • mysql -u yourusername -p -H your.hostname
  • USE yourdatabasename;
  • INSERT INTO users (id, api_key) VALUES ('your_cool_nickname', '728f084c-85e0-41de-aa2a-b6cc871200c1'); (the latter value is your api key from ~/.wakatime.cfg)

Todo

  • Persisted summaries / aggregations (for performance)
  • User sign up and log in
  • Additional endpoints for retrieving statistics data
  • Dockerize
  • Unit tests

Important note

This is not an alternative to using WakaTime. It is just a custom, non-commercial, self-hosted application to collect coding statistics using the already existing editor plugins provided by the WakaTime community. It was created for personal use only and with the purpose of keeping the sovereignity of your own data. However, if you like the official product, please support the authors and buy an official WakaTime subscription!

License

GPL-v3 @ Ferdinand Mütsch