Skip to content

johnisom/sinatra_timemanager

Repository files navigation

Time Manager

Effectively Track and Intelligently View Your Productive Hours

Build Status Coverage Status codebeat badge License: MIT Made With Love

Time Manager is a Sinatra web application for tracking study/work time so that you know exactly how many of your precious hours are going to good use. The web app is hosted here on Heroku and the Github repository is here.

This app was created as an optional project for Launch School's RB175 course. The two other optional projects I created are the games Tic Tac Toe and Twenty-One.

Usage

Additional help and instructions on how to use this application can be found on the help section of the app website.

Home Page Signed Out

Here you'll find all the links and pages that you can access in your current state of being signed out, as well as simple first time instructions on the home (current) page.

2) Go To The Help Page

Help Page

Here you can read up on all of the different commands: what they do and how to use them. It is suggested you read this whole section before using this application.

Sign In Page

If you already have an account, you can just sign in here and get right to work. If you don't, you may create one or use the test account that is free for everybody to use as explained in this disclaimer at the bottom of the About section:

Disclaimer for Heroku's ephemeral file system

4) Or, Alternatively, Sign Up

Sign Up Page

If you decide to use this application with your own user, it is very important that you are connected to this application with HTTPS. You can verify this by looking at the URL field in your browser to see that it has a lock icon and says that your connection is secure. If you view the whole URL (you must double-click in Chrome, Firefox and Edge show by default), You will see something like this:

Secure URL Example

Once you have signed up, you will now see that your header has changed and has a few additional buttons, one of which is highligthed in this screenshot:

Signed In Header with 'About' Highlighted

5) Do An Action

Actions Page

This is the control terminal of the application. You can start your time, stop it, or undo the last start or stop that you did. Get familiar with it. I suggest you read up on Start, Stop, and Undo on the help page. Be careful with the actions that you commit here. Currently, there is no feature to edit a previously started/stopped time or message, only to delete the last entry, whether it was a start or a stop.

6) View Logged Time

Default View Page

This is by no doubt the heart of the application. All your intelligent reporting is on this very page, where you can view within a specified timeframe with a selection of 5 different view options. To be able to effectively use this section, read the help section on View where you can get sufficient help on the Timeframe and View Options filters of viewing.

Here is an example with Timeframe set from 19 to 13 days ago with the view option of Day Delimited:

Scrolling View

7) Sign Out (optional)

Sign Out Page

Once you've finished using the application, go ahead and sign out. While not mandantory, it is recommended as your session will last the duration that Heorku's dyno is up and running, which is approximately a full day.

Inspiration

TL;DR: Inspired by this.

The design and idea for this app comes from a similar command-line application that I had previously made with Python. The Github repository for that project can be found here. The impact that my command-line version had on the web application becomes very apparent when you look at the View page.

I created the original command-line version of this application partly in response to a challenge of getting 400 good hours of Launch School studying in between 2019-11-08–2019-12-31 and partly because I didn't have any idea where my time was actually going. At the very least, I needed a tool to help me to track just the raw time going towards study-related stuff, and I didn't want to have to learn to use Microsoft Excel or to manually calculate the time.

Out of this desire came a command-line prototype, implemented in Python, that allowed me to track my raw time as well as displaying each study session. I could just type time-manager john start and time-manager john stop into my terminal, carefree, and it would take care of it all for me.

However, I quickly came to the realization that this was simply not enough. Sure, I can track my time, sparing me the need to manually write my entries down, but how would I know exactly what it was going to? Or how could I quickly view results for each day?

Enter messages and view options.

Implementing messages was easy. All I had to do was change how the data was stored and parsed, and then I had a message I could display.

View options? Not so much.

They required lots of logic to summarize and display and separate, which is reflected by how powerful they can be. No, they won't magically change your lives, but they spare you the mental work that I so desperately wanted to avoid that caused me to make this application in the first place.

After many more iterations of this cycle, I found myself with a command-line application to use on the daily as well as a web aplication to demonstrate my abilities and give my programmings skills a little stretch.

Limitations

This is a fully-functional application that can store usernames and bcrypt encrypted password hashes. However, the server that it is hosted on, Heroku, does not support these features, as breifly explained in this disclaimer:

Disclaimer for Heroku's ephemeral file system

I don't plan on making the web version have permanent accounts or data storage anytime soon, but if requests for that come in, I'll consider it because all it requires is hosting it somewhere without an ephemeral file system.

Installation

  1. Clone this repository (git clone https://github.com/johbnisom/sinatra_timemanager.git)
  2. cd into the repository (cd sinatra_timemanager)
  3. Install dependencies (bundle install)
    • If you don’t have ruby-2.6.5, install it
  4. Ensure that all tests are passing (bundle exec rake)
  5. Run the server locally (bundle exec rackup)
  6. Enjoy tracking and managing your time at http://localhost:9292/

Contributing

Send a pull request or open an issue.

Please also update tests to reflect those changes.

License

MIT © 2019