New Activities Example

Today's release includes a new live data example that focuses on fetching a user's logged activities on a selected date.

Major Refactoring, Code Cleanup, and Move to OmniAuth Login

Today's release includes quite a few structural changes to the reference app code that will make it easier to develop new informational content in the future. The changes include:

  • Unlocking Rails and upgrading to the latest stable (3.2.9).
  • Moving onto omniauth-fitbit as the method for logging onto the reference site. Once logged in, we still use fitgem to query the service for data, but the OAuth login is now handled through OmniAuth & Devise. For a great tutorial on integrating OmniAuth & Devise check out Ryan Bates's Railscast on the subject.
  • The app now uses Simple Form (with it's new Bootstrap support) for the forms on the site.
  • The many levels of indirection used to access the FitgemClient data object have been simplified.
  • The non-Backbone.js structure that was leftover (but not deleted) when I some of the dynamic content to Backbone.js has been cleaned out. Leaving it in was a terrible oversight on my part as it confused folks about what was actually being used.
  • Fitbit developer keys are now passed in via ENV rather than from APP_CONFIG. It's easier to avoid rewriting other developer's keys during pull requests this way.

For anyone looking to contribute to this project, there are two things that can always be improved: the content describing how to use specific fitgem methods in a Rails app and the documentation of the reference app itself so that other developers can clone, inspect, and play with the code easier.

Many, many thanks go to Marcel van Pinxteren for the pull request that started all this work. I hadn't improved or cleaned up the code for quite awhile and his pull request to update Rails and fix tests got the ball rolling on all these other improvements.

Moved to Heroku has moved to Heroku! Along with the change of venue I've spent a considerable amount of time finalizing the update to design that was mentioned in the February 19th post below.

New Guide, Twitter Bootstrap, and More

I settled down at the February 18th MadRailers Meetup Hack Day determined to update this reference site and get it looking nice and clean with the Twitter Bootstrap library. Once I dug into the source, however, I realized I could restructure the whole app to be a lot nice, code-wise, and DRY things up a bit in the process.

Here's the changelog for this release:

  • Redesigned all UI to use Twitter Bootstrap
  • Moved all Fitbit API data fetching into controllers meant to be called from Backbone. The implication is that we don't synchronously wait for the Fitbit API response. Instead the local page loads and then it uses a little Backbone.js scaffold to request an API fetch if the user is logged-in and has their account linked to their Fitbit account.
  • Migrated from two mega-pages about resources and subscriptions to a multi-page guide based on teaching how to use the gem in isolation, and then moving onto using it in a Rails application.

New Foods Examples

I've added a Resources page with new examples around the Foods abstraction. Check it out to learn about searching for foods, retrieving a user's foods, logging a user's foods, creating new foods, and deleting user's logged foods.

A New Look, A New Blog

Today I pushed a new look of this site live to the web. It includes three main features:

  1. New visual look and feel
  2. New examples for the resources API
  3. Integration with the fitbit API that will show you your own health data in the examples, if you have signed in through Fitbit.

The purpose of this site is both to illustrate to developers how to use fitgem in the context of a Rails application, and also to provide a 'real world' application so I can test out the fitgem interfaces to ensure they're sufficiently usable.

I'm continually working on adding new examples on how to use the various interfaces exposed from the gem. I will be pushing them live and noting on this blog the updates as I finish them.

I'm always looking for feedback on this stuff. For suggestions/bug reports on this web site, please enter issues on the fitgem-client repository. For suggestions or bug reports on fitgem itself, please enter issues at the gem repository.