Skip to content

jersearls/present

 
 

Repository files navigation

Test Double Present™

Stories in Ready Badgers Code Climate Code Climate

This is an open source application for tracking activities on a weekly billing model and generating invoices via the Harvest API.

Do you bill clients on a weekly rate?

We wrote Present because test double bills (almost all) our clients on a weekly rate, but pretty much every T&E system only supports hourly billing. Our goal is to have a system to track our activity for generating invoices with a minimal amount of friction. The system also supports clients billed hourly.

screen shot 2014-11-02 at 12 00 25 am

A few features and aspects of the app:

  • Weekly-rate projects, each entry tracking absence/half-day/full-day
  • Hourly-rate projects, tracking numeric hours
  • Biweekly billing cadence
  • Users mark when their time is ready to be invoiced to their client(s)
  • Lists invoices that need to be sent, along with any problems with the invoicing period's timesheets
  • Generates invoices and sends them to Harvest
  • Tracks location worked, each user with a default location that can be overridden for each entry
  • Tracks holiday & vacation time

There are a few values hard-coded into the application specific to test double, but could otherwise be deployed and used by other organizations. If you're interested in using Present and would like to chat about it or see a demo of it in action, please get in touch with us by e-mail!

Getting up and running

Do you work at Test Double? Congratulations! There is a really easy script to get you set up! Just run this:

$ ./script/setup

If you don't work at Test Double, here's some general advice to getting started:

Prerequisites

  • Ruby
  • Postgres
  • Harvest account (for clients and invoicing)
  • GitHub OAuth application (for access)

Setup

Environment

First copy the example environment file .env.example to .env.

cp .env.example .env

Then update the variables with their corresponding values.

PRESENT_WEEKLY_RATE=""
PRESENT_HOURLY_RATE=""
PRESENT_ADMIN_GITHUB_IDS="username1,username2"
PRESENT_HARVEST_SUBDOMAIN=""
PRESENT_HARVEST_USERNAME=""
PRESENT_HARVEST_PASSWORD=""

Authentication

GitHub authentication is used to restrict access to only members belonging to a given GitHub Organization. Register a new OAuth application; be sure to set the authorization callback url and homepage url correctly. For example, when running on localhost these would be:

Once created, update your GitHub client id and client secret to your environment along with the following required environment variables in your .env file:

PRESENT_GITHUB_CLIENT_ID="blahblah982374dsblah"
PRESENT_GITHUB_CLIENT_SECRET="blahas83828blahthelongerofthetwo"
PRESENT_GITHUB_ORGANIZATION_NAME="someorg"

Running the application

Finally, you can go through a pretty standard Ruby dance of setting up a rails app:

bundle install
bundle exec rake db:create db:migrate db:seed

Start the server with the following:

bundle exec rails s

And then visit http://localhost:3000 in a browser.

Backing and restoring from a heroku backup

If you need to debug with heroku data locally, you can do so with:

$ ./script/production_backup.sh

Then edit your "development" connection in database.yml to point to a database named "present_development"

Running offline

Once you've set up at least one user in a database, you can work entirely offline by setting the LOCAL_OVERRIDE_AS environment variable to bypass the OAuth flow.

To run offline in development, you may:

$ LOCAL_OVERRIDE_AS="Justin Searls" rails s

About

Activity Tracking for Test Double

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 66.9%
  • HTML 26.1%
  • CoffeeScript 3.3%
  • CSS 2.9%
  • Other 0.8%