├── .gitignore ├── favicon.png ├── notify15a.mp3 ├── screen1.png ├── screen2.png ├── screen3.png ├── notify30-60a.mp3 ├── freelance-timetracker.sketch ├── LICENSE ├── SECURITY.md ├── README.md ├── index.php └── timetracker.js /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | timetracker.json 3 | -------------------------------------------------------------------------------- /favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckyshot/freelance-timetracker/HEAD/favicon.png -------------------------------------------------------------------------------- /notify15a.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckyshot/freelance-timetracker/HEAD/notify15a.mp3 -------------------------------------------------------------------------------- /screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckyshot/freelance-timetracker/HEAD/screen1.png -------------------------------------------------------------------------------- /screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckyshot/freelance-timetracker/HEAD/screen2.png -------------------------------------------------------------------------------- /screen3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckyshot/freelance-timetracker/HEAD/screen3.png -------------------------------------------------------------------------------- /notify30-60a.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckyshot/freelance-timetracker/HEAD/notify30-60a.mp3 -------------------------------------------------------------------------------- /freelance-timetracker.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckyshot/freelance-timetracker/HEAD/freelance-timetracker.sketch -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Xavi Esteve (xaviesteve.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policies and Procedures 2 | 3 | This document outlines security procedures and general policies for the 4 | project. 5 | 6 | * [Reporting a Vulnerability](#reporting-a-vulnerability) 7 | * [Disclosure Policy](#disclosure-policy) 8 | 9 | ## Reporting a Vulnerability 10 | 11 | The team and community take all security vulnerabilities seriously. Thank 12 | you for improving the security of our open source software. We appreciate 13 | your efforts and responsible disclosure and will make every effort to 14 | acknowledge your contributions. 15 | 16 | Report security vulnerabilities by emailing the team at: 17 | 18 | security at xaviesteve.com 19 | 20 | The lead maintainer will acknowledge your email within 24-72 hours. 21 | After the initial reply to your report, the team will endeavor to keep 22 | you informed of the progress towards a fix and full announcement, 23 | and may ask for additional information or guidance. 24 | 25 | Report security vulnerabilities in third-party modules to the person or 26 | team maintaining the module. 27 | 28 | ## Disclosure Policy 29 | 30 | When the security team receives a security bug report, they will assign it 31 | to a primary handler. This person will coordinate the fix and release 32 | process, involving the following steps: 33 | 34 | * Confirm the problem and determine the affected versions. 35 | * Audit code to find any potential similar problems. 36 | * Prepare fixes for all releases still under maintenance. These fixes 37 | will be released as fast as possible to the repository. 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Freelance Timetracker 2 | 3 | 4 |  5 | 6 | 7 | Freelance Timetracker is a free and super-simple web-based timetracking system. All the information is stored in a JSON file so no database is needed. 8 | 9 | 10 | ### 10 second Setup 11 | 12 | 1. Copy the files to your web server 13 | 2. You are done! 14 | 15 | #### Quick notes 16 | 17 | Make sure PHP can create/edit files in that path. You should use Freelance Timetracker locally since there is no password protection, everyone could access it and play around with it. Also, make sure not to open several tabs of it since you may overwrite the database. No configuration is necessary although you can customize some things such as saving interval, default rate, currency, database extension and a few other things. 18 | 19 | 20 | ### How to use 21 | 22 | Click the checkbox to start timing a task, edit any fields by clicking on them. 23 | 24 | 25 | ### Contents 26 | 27 | The code is just one PHP, CSS, JS and JSON file. 28 | 29 | 30 | ### How it works 31 | 32 | - Tailwindcss gives it styling 33 | - jQuery/AJAX sends the information to the back-end (every 10 seconds by default) 34 | - PHP stores everything in a JSON file 35 | 36 | This setup makes it extremely easy to install Freelance Timetracker with just a copy-paste and start using straight away. It also makes backing up your stuff super-easy. 37 | 38 | 39 | ### License 40 | 41 | Freelance Timetracker is authored by [Xavi Esteve](https://xaviesteve.com/) and [Renats K.](http://www.myworld.lv/), and it is licensed under a MIT License. 42 | 43 | Feel free to fork it and send any pull requests. 44 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 20, // default rate per hour 25 | 'currency' => '€', 26 | 'filename' => 'timetracker', // name of the database 27 | 'tasksno' => 5, // TODO: Number of tasks to show 28 | 'saveinterval' => 10 // save every N seconds 29 | ); 30 | 31 | /** 32 | * Save database 33 | */ 34 | if (isset($_GET['action'])) { 35 | if ($_GET['action'] == 'save' && (strlen($_POST['json']) > 2)) { 36 | $filename = $settings['filename'].".json"; 37 | $filehandle = fopen($filename, 'w') or die("Error: Can't create or save files, please modify folder permissions"); 38 | $fwrite = fwrite($filehandle, stripslashes($_POST['json'])); 39 | fclose($filehandle); 40 | echo $fwrite; 41 | die(); 42 | } 43 | } 44 | 45 | /** 46 | * Read database 47 | */ 48 | $data = ''; 49 | if (file_exists($settings['filename'].".json")) { 50 | $data = file_get_contents($settings['filename'].".json"); 51 | } 52 | 53 | // If no database then generate a blank one 54 | if (strlen($data) < 3) { 55 | $data = '{'; 56 | for ($i = 0; $i < $settings['tasksno']; $i++) { 57 | $data .= '"'.$i.'":{"date":"","client":"","task":"","rate":'.$settings['rate'].',"total":0,"desc":"","timed":0}'; 58 | if ($i < $settings['tasksno']-1) { 59 | $data .= ','; 60 | } 61 | } 62 | $data .= '}'; 63 | } 64 | 65 | /** 66 | * HTML 67 | */ 68 | ?> 69 | 70 | 71 |
72 | 73 || 125 | | Date | 126 |127 | | Project | 128 |Task | 129 |Rate | 130 |Total | 131 |Note | 132 |Time | 133 |134 | |
|---|