ProductPromotion
Logo

Open.Source

made by https://0x3d.site

GitHub - mujx/hakatime: Wakatime server implementation & analytics dashboard
Wakatime server implementation & analytics dashboard - mujx/hakatime
Visit Site

GitHub - mujx/hakatime: Wakatime server implementation & analytics dashboard

GitHub - mujx/hakatime: Wakatime server implementation & analytics dashboard

hakatime

Latest version BuiltWithNix

Hakatime is a server implementation of Wakatime. You can use it as a self-hosted alternative.

It comes together with a dashboard which provides a graphical representation of the collected data.

Features

  • Import Wakatime activity using an API token and a range of dates.
  • See time spent on Github commits.
  • Forward incoming heartbeats to another Wakatime compatible server (e.g wakatime.com)
  • Group projects together with tags (e.g #work, #personal) and view their aggregated statistics.
  • User registration & login through the UI.
  • Leaderboards for all the users of the instance.
  • Badge generation for a project that displays that total amount of hours spent for a configurable time period. my-app
  • Global and per project charts
    • Breakdown by project or language.
    • Breakdown by day of week and hour of the day.
    • Timeline of activity for a configurable time-frame.
    • Total time spent per file.
  • API token management & generation.

Demo

There is an instance here that you can use to send data or browse around.

Use demo as username and demodemo as password or create your own user to login. You can create an API token and try sending your data.

Client setup

After you've generated a new API token from Hakatime's UI, update your ~/.wakatime.cfg file like below:

[settings]
api_key=<generated_token>

# e.g api_url=https://hakatime.mtx-dev.xyz/api/v1/users/current/heartbeats.bulk for the demo instance.
api_url=<hakatime_instance_url>/api/v1/users/current/heartbeats.bulk

# e.g If you're using the docker-compose-deploy.yml to test things locally, use the following:
# api_url=http://localhost:8080/api/v1/users/current/heartbeats.bulk

The file's location might be different depending on your system and editor. Please consult the client docs for further information.

Deployment

You can use the following docker-compose setup for testing locally or an actual deployment. Change HAKA_BADGE_URL to match the actual external endpoint of your instance.

Deploying on ARM is also possible using the mujx/hakatime:latest-arm or mujx/hakatime:v1.7.3-arm image or the dedicated Dockerfile (Dockerfile.arm) to build the image.

version: "3"
services:
  server:
    container_name: hakatime
    image: mujx/hakatime:v1.7.3
    environment:
      # DB settings.
      HAKA_DB_HOST: haka_db
      HAKA_DB_PORT: 5432
      HAKA_DB_NAME: test
      HAKA_DB_PASS: test
      HAKA_DB_USER: test
      # Server settings.
      # Fill out this field if the api is behind another path (e.g behind a reverse proxy).
      # This will adjust the Set-Cookie path for all the /auth related API calls.
      HAKA_API_PREFIX: ""
      # Update this with the external endpoint that you use to access hakatime.
      HAKA_BADGE_URL: "http://localhost:8080"
      HAKA_PORT: 8080
      HAKA_SHIELDS_IO_URL: "https://img.shields.io"
      HAKA_ENABLE_REGISTRATION: "true" # Toggle after you've created your account.
      # Number of hours after which inactive browser sessions will expire (login required).
      HAKA_SESSION_EXPIRY: "24"
      HAKA_LOG_LEVEL: "info" # Control the verbosity of the logger.
      HAKA_ENV: "dev" # Use a json logger for production, otherwise key=value pairs.
      HAKA_HTTP_LOG: "true" # If you want to log http requests.
      GITHUB_TOKEN: "<token>" # If you want to retrieve time spent per commit. No extra scope is required.
      # Add the following variables if you want to forward any received heartbeats to another
      # Wakatime compatible server.
      HAKA_REMOTE_WRITE_URL: "https://wakatime.com/api/v1/users/current/heartbeats.bulk"
      # You can also use this URL format to forward heartbeats to Wakapi:
      # https://[wakapi-instance]/api/compat/wakatime/v1/users/current/heartbeats.bulk
      HAKA_REMOTE_WRITE_TOKEN: "<token>"
    ports:
      # This will start the services on all interfaces. 
      # More info here: https://github.com/compose-spec/compose-spec/blob/master/spec.md#ports
      - "8080:8080"
  haka_db:
    container_name: haka_db
    image: postgres:12-alpine
    environment:
      POSTGRES_DB: test
      POSTGRES_PASSWORD: test
      POSTGRES_USER: test
    volumes:
      - deploy_db_data:/var/lib/postgresql/data

volumes:
  deploy_db_data: {}

To start all the services run:

$ docker-compose -f ./docker-compose-deploy.yml up

and navigate to http://localhost:8080 to access the dashboard.

Building

Server

Requirements:

cabal build
cabal run exe:hakatime -- run

Dashboard

The output files will be located at dashboard/dist.

Requirements:

  • Node.js & npm
cd dashboard

npm install
npm run prod

CLI options

hakatime :: v1.7.3

Usage: hakatime COMMAND
  Wakatime server implementation

Available options:
  -h,--help                Show this help text

Available commands:
  create-token             Create a new auth token
  create-user              Create a new user account
  run-migrations           Apply pending database migrations
  run                      Start the Server

Screens

Overview

Overview Page

Projects

Projects Page

Projects Page - Commits

Contributing

Any kind of contribution is greatly appreciated. This could be:

  • Bug fixes
  • Suggesting/Implementing new features
  • UI/UX improvements/suggestions
  • Code refactoring

Articles
to learn more about the open-source concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Open-Source.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory