|
| 1 | +# Timetracker |
| 2 | + |
| 3 | +TimeTracker is a robust command-line interface (CLI) and server application designed to help teams to efficiently track time spent on various URLs, such as GitHub issues, project management tasks, or any web-based activities. By seamlessly integrating with your workflow, TimeTracker allows you to start and stop time entries, view detailed logs, and export data in multiple formats. |
| 4 | + |
| 5 | +## Getting started |
| 6 | + |
| 7 | +### Download the Binaries |
| 8 | + |
| 9 | +Get the binaries from the releases or download/clone the source code and build it manually |
| 10 | + |
| 11 | +### Manual Building |
| 12 | + |
| 13 | +### Building the server |
| 14 | + |
| 15 | +Executing `make build-server` is enough, a binary named `timetrackerd` should be created in the `bin` directory |
| 16 | + |
| 17 | +### Building the CLI |
| 18 | + |
| 19 | +Executing `make build-client` will create a binary named `timetracker` in the `bin` directory |
| 20 | + |
| 21 | +### Running the server |
| 22 | + |
| 23 | +#### Sample server configuration |
| 24 | + |
| 25 | +```json |
| 26 | +{ |
| 27 | + "server": { |
| 28 | + "addr": "0.0.0.0:8080", |
| 29 | + "allowed_origins": ["*"] |
| 30 | + }, |
| 31 | + "database": { |
| 32 | + "driver": "sqlite", |
| 33 | + "data_source": "timetracker.db" |
| 34 | + } |
| 35 | +} |
| 36 | +``` |
| 37 | + |
| 38 | +the command to run the server is `./bin/timetrackerd -config ./team-timetracker-server.sample.json` |
| 39 | + |
| 40 | +### Running the client |
| 41 | + |
| 42 | +The client has 3 main commands `start`, `stop`, `entries` |
| 43 | + |
| 44 | +#### Client configurations |
| 45 | + |
| 46 | +The client requires configuration either passed as `-config` flag or in `~/.config/team-timetracker.json` that has the username and backend URL |
| 47 | + |
| 48 | +```json |
| 49 | +{ |
| 50 | + "username": "xmonader", |
| 51 | + "backend_url": "http://localhost:8080" |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +#### Start time entry |
| 56 | + |
| 57 | +``` |
| 58 | +~> ./bin/timetracker start github.com/theissues/issue/142 "helllooo starting" |
| 59 | +Started tracking ID 9 for URL 'github.com/theissues/issue/142'. |
| 60 | +``` |
| 61 | + |
| 62 | +It takes the URL as an argument and a description and returns you a tracking ID |
| 63 | +> Note: you can't start an already started entry. |
| 64 | +
|
| 65 | +#### Stop time entry |
| 66 | + |
| 67 | +``` |
| 68 | +~> ./bin/timetracker stop github.com/theissues/issue/142 |
| 69 | +
|
| 70 | +Stopped tracking for URL 'github.com/theissues/issue/142'. Duration: 35 minutes. |
| 71 | +``` |
| 72 | + |
| 73 | +#### Querying the time entries |
| 74 | + |
| 75 | +> You can generate CSV data by specifying --format=csv |
| 76 | +
|
| 77 | +##### Querying all of the entries |
| 78 | + |
| 79 | +``` |
| 80 | +~> ./bin/timetracker-cli entries |
| 81 | +Time Entries: |
| 82 | +------------------------------ |
| 83 | +ID: 9 |
| 84 | +Username: azmy |
| 85 | +URL: github.com/theissues/issue/154 |
| 86 | +Description: helllooo starting |
| 87 | +Start Time: Sun, 15 Sep 2024 22:08:01 EEST |
| 88 | +End Time: Sun, 15 Sep 2024 22:08:14 EEST |
| 89 | +Duration: 3 minutes |
| 90 | +------------------------------ |
| 91 | +ID: 8 |
| 92 | +Username: xmonader |
| 93 | +URL: github.com/theissues/issue/112 |
| 94 | +Description: hello 142 |
| 95 | +Start Time: Sun, 15 Sep 2024 22:07:10 EEST |
| 96 | +End Time: Sun, 15 Sep 2024 22:07:12 EEST |
| 97 | +Duration: 42 minutes |
| 98 | +------------------------------ |
| 99 | +ID: 7 |
| 100 | +Username: xmonader |
| 101 | +URL: github.com/theissues/issue/52111 |
| 102 | +Description: the descrpition |
| 103 | +Start Time: Sun, 15 Sep 2024 22:06:55 EEST |
| 104 | +End Time: Sun, 15 Sep 2024 22:06:58 EEST |
| 105 | +Duration: 11 minutes |
| 106 | +------------------------------ |
| 107 | +ID: 6 |
| 108 | +Username: guido |
| 109 | +URL: github.com/theissues/issue/4 |
| 110 | +Description: alright done |
| 111 | +Start Time: Sun, 15 Sep 2024 22:03:59 EEST |
| 112 | +End Time: Sun, 15 Sep 2024 22:04:09 EEST |
| 113 | +Duration: 20 minutes |
| 114 | +------------------------------ |
| 115 | +ID: 5 |
| 116 | +Username: guido |
| 117 | +URL: github.com/rfs/issue/87 |
| 118 | +Description: that's tough |
| 119 | +Start Time: Sun, 15 Sep 2024 22:03:00 EEST |
| 120 | +End Time: Sun, 15 Sep 2024 22:03:04 EEST |
| 121 | +Duration: 15 minutes |
| 122 | +------------------------------ |
| 123 | +ID: 4 |
| 124 | +Username: xmonader |
| 125 | +URL: github.com/zos/issue/414 |
| 126 | +Description: woh |
| 127 | +Start Time: Sun, 15 Sep 2024 22:02:26 EEST |
| 128 | +End Time: Sun, 15 Sep 2024 22:02:41 EEST |
| 129 | +Duration: 33 minutes |
| 130 | +------------------------------ |
| 131 | +ID: 3 |
| 132 | +Username: xmonader |
| 133 | +URL: github.com/thesites/www_what_io |
| 134 | +Description: another desc1123 |
| 135 | +Start Time: Sun, 15 Sep 2024 22:00:13 EEST |
| 136 | +End Time: --- |
| 137 | +Duration: --- |
| 138 | +------------------------------ |
| 139 | +ID: 2 |
| 140 | +Username: ahmed |
| 141 | +URL: https://github.com/xmonader/team-timetracker/issues/121 |
| 142 | +Description: el desc |
| 143 | +Start Time: Sun, 15 Sep 2024 20:03:56 EEST |
| 144 | +End Time: Sun, 15 Sep 2024 20:06:05 EEST |
| 145 | +Duration: 24 minutes |
| 146 | +------------------------------ |
| 147 | +ID: 1 |
| 148 | +Username: ahmed |
| 149 | +URL: https://github.com/xmonader/team-timetracker/issues/1 |
| 150 | +Description: another desc |
| 151 | +Start Time: Sun, 15 Sep 2024 20:03:24 EEST |
| 152 | +End Time: Sun, 15 Sep 2024 20:03:50 EEST |
| 153 | +Duration: 23 minutes |
| 154 | +------------------------------ |
| 155 | +``` |
| 156 | + |
| 157 | +###### Generating CSV data |
| 158 | + |
| 159 | +``` |
| 160 | +~> ./bin/timetracker-cli entries --format=csv |
| 161 | +ID,Username,URL,Description,Start Time,End Time,Duration (minutes),Created At,Updated At |
| 162 | +9,azmy,github.com/theissues/issue/154,helllooo starting,2024-09-15T22:08:01+03:00,2024-09-15T22:08:14+03:00,3,2024-09-15T22:08:01+03:00,2024-09-15T22:08:14+03:00 |
| 163 | +8,xmonader,github.com/theissues/issue/112,hello 142,2024-09-15T22:07:10+03:00,2024-09-15T22:07:12+03:00,42,2024-09-15T22:07:10+03:00,2024-09-15T22:07:12+03:00 |
| 164 | +7,xmonader,github.com/theissues/issue/52111,the descrpition,2024-09-15T22:06:55+03:00,2024-09-15T22:06:58+03:00,11,2024-09-15T22:06:55+03:00,2024-09-15T22:06:58+03:00 |
| 165 | +6,guido,github.com/theissues/issue/4,alright done,2024-09-15T22:03:59+03:00,2024-09-15T22:04:09+03:00,20,2024-09-15T22:03:59+03:00,2024-09-15T22:04:09+03:00 |
| 166 | +5,guido,github.com/rfs/issue/87,that's tough,2024-09-15T22:03:00+03:00,2024-09-15T22:03:04+03:00,15,2024-09-15T22:03:00+03:00,2024-09-15T22:03:04+03:00 |
| 167 | +4,xmonader,github.com/zos/issue/414,woh,2024-09-15T22:02:26+03:00,2024-09-15T22:02:41+03:00,33,2024-09-15T22:02:26+03:00,2024-09-15T22:02:41+03:00 |
| 168 | +3,xmonader,github.com/thesites/www_what_io,another desc1123,2024-09-15T22:00:13+03:00,N/A,5,2024-09-15T22:00:13+03:00,2024-09-15T22:00:13+03:00 |
| 169 | +2,ahmed,https://github.com/xmonader/team-timetracker/issues/121,el desc,2024-09-15T20:03:56+03:00,2024-09-15T20:06:05+03:00,24,2024-09-15T20:03:56+03:00,2024-09-15T20:06:05+03:00 |
| 170 | +1,ahmed,https://github.com/xmonader/team-timetracker/issues/1,another desc,2024-09-15T20:03:24+03:00,2024-09-15T20:03:50+03:00,23,2024-09-15T20:03:24+03:00,2024-09-15T20:03:50+03:00 |
| 171 | +
|
| 172 | +``` |
| 173 | + |
| 174 | +##### Querying entries by username |
| 175 | + |
| 176 | +``` |
| 177 | +------------------------------ |
| 178 | +~> ./bin/timetracker-cli entries --username="azmy" |
| 179 | +Time Entries: |
| 180 | +------------------------------ |
| 181 | +ID: 9 |
| 182 | +Username: azmy |
| 183 | +URL: github.com/theissues/issue/154 |
| 184 | +Description: helllooo starting |
| 185 | +Start Time: Sun, 15 Sep 2024 22:08:01 EEST |
| 186 | +End Time: Sun, 15 Sep 2024 22:08:14 EEST |
| 187 | +Duration: 3 minutes |
| 188 | +------------------------------ |
| 189 | +``` |
| 190 | + |
| 191 | +##### Querying entries by URL |
| 192 | + |
| 193 | +``` |
| 194 | +~> ./bin/timetracker-cli entries --url="github.com/theissues/issue/154" |
| 195 | +Time Entries: |
| 196 | +------------------------------ |
| 197 | +ID: 9 |
| 198 | +Username: azmy |
| 199 | +URL: github.com/theissues/issue/154 |
| 200 | +Description: helllooo starting |
| 201 | +Start Time: Sun, 15 Sep 2024 22:08:01 EEST |
| 202 | +End Time: Sun, 15 Sep 2024 22:08:14 EEST |
| 203 | +Duration: 3 minutes |
| 204 | +------------------------------ |
| 205 | +``` |
0 commit comments