matachi / somafm-firefox-os-app

SomaFM Firefox OS app
https://marketplace.firefox.com/app/somafm
MIT License
1 stars 0 forks source link

SomaFM Firefox OS app

Author: Daniel "MaTachi" Jonsson
License: MIT License

Prerequisites

Install npm and Grunt on a Debian based system (Ubuntu for example):

$ sudo apt-get install nodejs
$ sudo npm install -g bower grunt-cli
$ sudo chown -R `whoami`:`whoami` ~/.npm ~/tmp

To export the SVG icon into PNG images Inkscape is also required to be installed:

$ sudo apt-get install inkscape

Set up

Install development dependencies (Grunt and Grunt modules) and app dependencies (jQuery, Backbone, Underscore and Building Blocks):

$ npm install

Build development version of the app

Watch for changes in the text files (JavaScript, HTML, etc) and perform continuous building:

$ grunt

Build production version of the app

$ grunt build

This does the same as grunt, but with more minimization, cleaning and without the continuous building.

Run the app

The built app is available in the directory dist/. Use Firefox's App Manager to install the app on either a real device or in the Firefox OS Simulator. With the App Manager it's also possible to debug the app's JS, DOM and CSS.

The app isn't runnable in the regular browser due to the same-origin policy which restricts the app's JS code from making a GET request to SomaFM's API. This could be fixed if SomaFM were to enable CORS.

Credits

The app depends on the following JavaScript libraries:

And the following library for the layout (CSS, and icons):

The following font is used for the app's icon: