sMite

May 5, 2016 0 By addshore

sMite stands for ‘simple Mite’, which to most people still means nothing at all. Mite is a time tracking web service, and depending on how companies make use of it things can become more complicated than they should be.
smite is how I tried to tackle this complexity in less than 8 hours!

More on Mite

mite screenshotEvery employee within a company that uses Mite will have a unique login. This allows the tracking of time against a collection of pre defined projects and services. As far as I have been able to tell every combination of project and service is possible, so if a company has registered 3 projects and 6 services there are a total of 18 combinations.
In the reality that I live in there are actually 12 projects and 57 services which leads to a total of 684 combinations, ouch…
Throughout the last 12 months I have only ever had the need to track time against roughly 12 of these combinations, ever, and at most 6 on a single day.

Mite has an inbuilt timer which can be started and stopped through a day that records minutes directly to a project service combination. Only one timer can be running at once which means you can only record time to a single project service combination at once.
Of course if people forget to start and stop the timer you can also edit time entries manually, adding or removing minutes or specifying periods of time.

The issues I encountered

  • I work for a German company and although I speak some German sometimes some of the project or service names are simply too complicated to instantly know and understand.
  • As I only use roughly 12 combinations of projects and services, I don’t really want to be shown the whole list.
  • Sometimes I work on tasks that could be split between multiple projects but there is not a super easy way to do this!

An initial solution

smite screenshotI decided to keep my solution simple and decided to go for a simple PHP app that could be run on a server for everyone to use but would also work just as well on a local machine.
I used Composer to manage the dependencies of sMite and made use of the syseleven/mite-eleven library for interaction with the mite API. I also used Twitters bootstrap library twbs/bootstrap to give things a little bit of style.
The interface is simple, and currently has only 2 views.

Upon first visiting the tool you are asked for your API key which you retrieve from your mite preferences, you should probably also be asked for your organization domain at this stage but initially I hard-coded this for my single use case.
Once logged in the API key is handled fairly poorly and is stored in a cookie and also re inserted back into the html for use in further requests. The token is also used as the file name for the JSON stored by sMite for the logged in user.

The main interface contains a collection of predefined buttons which can be selected individually to track time for a single project service combination or together if a task covers multiple projects.
If multiple buttons are selected the time will be split equally.
Each time the timers are changed the current recorded time is dumped into the JSON file in seconds and displayed on the interface.
This time can then be spent to mite by clicking a final button.

Future plans

  • As said above the mite endpoint to be used should be configurable upon login.
  • Currently it is no possible to remove a single timer once started, instead you must stop all timers and then re add the ones that you still want running.
  • The buttons displayed are currently hard coded but should be configurable per user. Essentially a user would login for the first time and then specify what project service combinations they use repetitively and then give each a name.
  • Right now everything is recorded in seconds and displayed in seconds. Some simple formatting here would make the interface much more user friendly.
  • sMite currently contains no JavaScript which means every button press is a page reload.
  • If a user accidentally changes their API key in their mite preferences there is no way to recover their lots time :(
  • When time is incorrectly recorded it must first be submitted to mite before it can be changed as sMite provides no way to adjust the number of seconds recorded.

Summary

I am happy that I managed to complete a first draft in the 8 hour window and I can see myself using sMite instead of mite in the future once some of the above points have been implemented.
Bring on the next 8 hour stint in a few months, and of course, pull requests welcome!