c68ee0a81e
There is no need to upload the artifact to the Action itself since it will be uploaded to the release. |
||
---|---|---|
.github | ||
data | ||
middlewares | ||
migrations | ||
models | ||
routes | ||
scripts | ||
services | ||
static/assets | ||
utils | ||
views | ||
.dockerignore | ||
.env.example | ||
.gitignore | ||
config.ini | ||
doap.rdf | ||
Dockerfile | ||
go.mod | ||
go.sum | ||
LICENSE | ||
main.go | ||
README.md | ||
version.txt | ||
wait-for-it.sh |
📈 wakapi
A minimalist, self-hosted WakaTime-compatible backend for coding statistics
If you like this project, please consider supporting it 🙂. You can donate either through buying me a coffee or becoming a GitHub sponsor. Every little donation is highly appreciated and boosts the developers' motivation to keep improving Wakapi!
Demo
🔥 New: There is hosted demo version available now. Go check it out! Please use responsibly.
To use the demo version set api_url = https://apps.muetsch.io/wakapi/api/heartbeat
. However, this hosted instance might be taken down again in the future, so you might potentially lose your data ❕
Prerequisites
On the server side:
- Go >= 1.13 (with
$GOPATH
properly set) - gcc (to compile go-sqlite3)
- Fedora / RHEL:
dnf install @development-tools
- Ubuntu / Debian:
apt install build-essential
- Windows: See here
- Fedora / RHEL:
- Optional: A MySQL- or Postgres database
On your local machine:
- WakaTime plugin for your editor / IDE
Server Setup
Run from source
- Clone the project
- Copy
.env.example
to.env
and set database credentials - Adapt
config.ini
to your needs - Build executable:
GO111MODULE=on go build
- Run server:
./wakapi
Run with Docker
docker run -d -p 3000:3000 --name wakapi n1try/wakapi
By default, SQLite is used as a database. To run Wakapi in Docker with MySQL or Postgres, see Dockerfile and .env.example for further options.
Client Setup
Wakapi relies on the open-source WakaTime client tools. In order to collect statistics to Wakapi, you need to set them up.
- Set up WakaTime for your specific IDE or editor. Please refer to the respective plugin guide
- Make your local WakaTime client talk to Wakapi by editing your local
~/.wakatime.cfg
file as follows
api_url = https://your.server:someport/api/heartbeat`
api_key = the_api_key_printed_to_the_console_after_starting_the_server`
You can view your API Key after logging in to the web interface.
Customization
Aliases
There is an option to add aliases for project names, editors, operating systems and languages. For instance, if you want to map two projects – myapp-frontend
and myapp-backend
– two a common project name – myapp-web
– in your statistics, you can add project aliases.
At the moment, this can only be done via raw database queries. For the above example, you would need to add two aliases, like this:
INSERT INTO aliases (`type`, `user_id`, `key`, `value`) VALUES (0, 'your_username', 'myapp-web', 'myapp-frontend');
Types
- Project ~ type 0
- Language ~ type 1
- Editor ~ type 2
- OS ~ type 3
NOTE: In order for the aliases to take effect for non-live statistics, you would either have to wait 24 hours for the cache to be invalidated or restart Wakapi.
Best Practices
It is recommended to use wakapi behind a reverse proxy, like Caddy or nginx to enable TLS encryption (HTTPS).
However, if you want to expose your wakapi instance to the public anyway, you need to set listen = 0.0.0.0
in config.ini
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