{"id":13472440,"url":"https://github.com/mujx/hakatime","last_synced_at":"2025-03-26T15:32:17.768Z","repository":{"id":42237323,"uuid":"243290741","full_name":"mujx/hakatime","owner":"mujx","description":"Wakatime server implementation \u0026 analytics dashboard","archived":false,"fork":false,"pushed_at":"2024-04-20T11:41:38.000Z","size":1545,"stargazers_count":638,"open_issues_count":22,"forks_count":47,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-30T04:14:17.379Z","etag":null,"topics":["mithriljs","self-hosted","servant","wakatime","wakatime-dashboard","wakatime-server"],"latest_commit_sha":null,"homepage":"https://hakatime.mtx-dev.xyz","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mujx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-26T15:02:37.000Z","updated_at":"2024-10-27T07:13:27.000Z","dependencies_parsed_at":"2024-01-01T00:39:03.646Z","dependency_job_id":"5356a207-5ac4-4be5-aad5-00f1eba8cafb","html_url":"https://github.com/mujx/hakatime","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujx%2Fhakatime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujx%2Fhakatime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujx%2Fhakatime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujx%2Fhakatime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mujx","download_url":"https://codeload.github.com/mujx/hakatime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245681467,"owners_count":20655202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mithriljs","self-hosted","servant","wakatime","wakatime-dashboard","wakatime-server"],"created_at":"2024-07-31T16:00:54.646Z","updated_at":"2025-03-26T15:32:17.190Z","avatar_url":"https://github.com/mujx.png","language":"Haskell","funding_links":[],"categories":["Haskell","Time Tracking","Software","Open Source"],"sub_categories":["Packages","Software Development - IDE \u0026 Tools"],"readme":"# hakatime\n\n[![Latest version](https://img.shields.io/github/v/release/mujx/hakatime)](https://github.com/mujx/hakatime/releases)\n[![BuiltWithNix](https://img.shields.io/badge/Built_With-Nix-5277C3.svg?logo=nixos\u0026labelColor=73C3D5)](https://nixos.org/)\n\nHakatime is a server implementation of [Wakatime](https://wakatime.com/). You can use it as a self-hosted alternative.\n\nIt comes together with a dashboard which provides a graphical representation of the collected data.\n\n## Features\n\n- Import Wakatime activity using an API token and a range of dates.\n- See time spent on Github commits.\n- Forward incoming heartbeats to another Wakatime compatible server (e.g `wakatime.com`)\n- Group projects together with tags (e.g `#work`, `#personal`) and view their aggregated statistics.\n- User registration \u0026 login through the UI.\n- Leaderboards for all the users of the instance.\n- Badge generation for a project that displays that total amount of hours spent for a configurable\n  time period. [![my-app](https://hakatime.mtx-dev.xyz/badge/svg/4e8273d1-84bc-46f9-890b-14fdfb83cdcc?days=14)](https://hakatime.mtx-dev.xyz/badge/svg/4e8273d1-84bc-46f9-890b-14fdfb83cdcc?days=7)\n- Global and per project charts\n  - Breakdown by project or language.\n  - Breakdown by day of week and hour of the day.\n  - Timeline of activity for a configurable time-frame.\n  - Total time spent per file.\n- API token management \u0026 generation.\n\n## Demo\n\nThere is an instance [here](https://hakatime.mtx-dev.xyz) that you can use to send data or browse\naround.\n\nUse `demo` as username and `demodemo` as password or create your own user to login. You can create\nan API token and try sending your data.\n\n## Client setup\n\nAfter you've generated a new API token from Hakatime's UI, update your `~/.wakatime.cfg` file like below:\n\n```ini\n[settings]\napi_key=\u003cgenerated_token\u003e\n\n# e.g api_url=https://hakatime.mtx-dev.xyz/api/v1/users/current/heartbeats.bulk for the demo instance.\napi_url=\u003chakatime_instance_url\u003e/api/v1/users/current/heartbeats.bulk\n\n# e.g If you're using the docker-compose-deploy.yml to test things locally, use the following:\n# api_url=http://localhost:8080/api/v1/users/current/heartbeats.bulk\n```\n\nThe file's location might be different depending on your system and editor. Please consult the [client docs](https://wakatime.com/plugins)\nfor further information.\n\n## Deployment\n\nYou can use the following docker-compose setup for testing locally or an actual\ndeployment. Change `HAKA_BADGE_URL` to match the actual external endpoint of your\ninstance.\n\nDeploying on ARM is also possible using the `mujx/hakatime:latest-arm` or `mujx/hakatime:v1.7.3-arm` image or the dedicated\nDockerfile ([`Dockerfile.arm`](/Dockerfile.arm)) to build the image.\n\n```yaml\nversion: \"3\"\nservices:\n  server:\n    container_name: hakatime\n    image: mujx/hakatime:v1.7.3\n    environment:\n      # DB settings.\n      HAKA_DB_HOST: haka_db\n      HAKA_DB_PORT: 5432\n      HAKA_DB_NAME: test\n      HAKA_DB_PASS: test\n      HAKA_DB_USER: test\n      # Server settings.\n      # Fill out this field if the api is behind another path (e.g behind a reverse proxy).\n      # This will adjust the Set-Cookie path for all the /auth related API calls.\n      HAKA_API_PREFIX: \"\"\n      # Update this with the external endpoint that you use to access hakatime.\n      HAKA_BADGE_URL: \"http://localhost:8080\"\n      HAKA_PORT: 8080\n      HAKA_SHIELDS_IO_URL: \"https://img.shields.io\"\n      HAKA_ENABLE_REGISTRATION: \"true\" # Toggle after you've created your account.\n      # Number of hours after which inactive browser sessions will expire (login required).\n      HAKA_SESSION_EXPIRY: \"24\"\n      HAKA_LOG_LEVEL: \"info\" # Control the verbosity of the logger.\n      HAKA_ENV: \"dev\" # Use a json logger for production, otherwise key=value pairs.\n      HAKA_HTTP_LOG: \"true\" # If you want to log http requests.\n      GITHUB_TOKEN: \"\u003ctoken\u003e\" # If you want to retrieve time spent per commit. No extra scope is required.\n      # Add the following variables if you want to forward any received heartbeats to another\n      # Wakatime compatible server.\n      HAKA_REMOTE_WRITE_URL: \"https://wakatime.com/api/v1/users/current/heartbeats.bulk\"\n      # You can also use this URL format to forward heartbeats to Wakapi:\n      # https://[wakapi-instance]/api/compat/wakatime/v1/users/current/heartbeats.bulk\n      HAKA_REMOTE_WRITE_TOKEN: \"\u003ctoken\u003e\"\n    ports:\n      # This will start the services on all interfaces. \n      # More info here: https://github.com/compose-spec/compose-spec/blob/master/spec.md#ports\n      - \"8080:8080\"\n  haka_db:\n    container_name: haka_db\n    image: postgres:12-alpine\n    environment:\n      POSTGRES_DB: test\n      POSTGRES_PASSWORD: test\n      POSTGRES_USER: test\n    volumes:\n      - deploy_db_data:/var/lib/postgresql/data\n\nvolumes:\n  deploy_db_data: {}\n```\n\nTo start all the services run:\n\n```bash\n$ docker-compose -f ./docker-compose-deploy.yml up\n```\n\nand navigate to [http://localhost:8080](http://localhost:8080) to access the dashboard.\n\n## Building\n\n### Server\n\nRequirements:\n\n- [GHC](https://www.haskell.org/ghc/) (tested with 8.8 \u0026 8.10)\n- [libpq](https://www.postgresql.org/docs/11/libpq.html) (PostgreSQL bindings)\n- [cabal-install](https://www.haskell.org/cabal/) (Build system for Haskell)\n\n```bash\ncabal build\ncabal run exe:hakatime -- run\n```\n\n### Dashboard\n\nThe output files will be located at `dashboard/dist`.\n\nRequirements:\n\n- Node.js \u0026 npm\n\n```bash\ncd dashboard\n\nnpm install\nnpm run prod\n```\n\n## CLI options\n\n```\nhakatime :: v1.7.3\n\nUsage: hakatime COMMAND\n  Wakatime server implementation\n\nAvailable options:\n  -h,--help                Show this help text\n\nAvailable commands:\n  create-token             Create a new auth token\n  create-user              Create a new user account\n  run-migrations           Apply pending database migrations\n  run                      Start the Server\n```\n\n## Screens\n\n### Overview\n\n![Overview Page](img/overview.png \"Overview Page\")\n\n### Projects\n\n![Projects Page](img/projects.png \"Projects Page\")\n\n![Projects Page - Commits](img/commits.png \"Projects Page - Commits\")\n\n## Contributing\n\nAny kind of contribution is greatly appreciated. This could be:\n\n- Bug fixes\n- Suggesting/Implementing new features\n- UI/UX improvements/suggestions\n- Code refactoring\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmujx%2Fhakatime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmujx%2Fhakatime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmujx%2Fhakatime/lists"}