HTML5 mobile web app game powered by Heroku and Salesforce
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
conf
lib
web
.gitignore
Procfile
README.md
package.json
server.js

README.md

Cheezburger

HTML5 mobile web app game powered by Heroku and Salesforce

This is an entry for a CloudSpokes challenge.

Live presentation: http://cheezburger.herokuapp.com

Features

  • Our favorite cheezburger cat meme is finally arrived as a mobile game!
  • Game can be opened right from mobile browser (iPhone users should add it to their home screen for maximum experience, and there are in-game instructions for this)
  • Using Geolocation API for locating the nearest franchise location from salesforce records, score is submitted specifically to that store
  • Using W3C motion API for controlling the game (tilting the phone)
  • All kind of crazy CSS transforms
  • Using cache manifest for fast loading
  • Leaderboard/High Score based on specific store location
  • Tested on iPhone 4S, and Samsung Galaxy S2

Configuration

  • conf/config.json contains all salesforce related OAuth2 credentials you need for basic setup (You need to generate OAuth credentials in database.com, under the menu Develop -> Remote Access, and copy the client ID, secret and callback fields to the config. For username use your username, for passwordAndToken use your password + a token generated by My Personal Information -> Reset My Security Token)
  • If you need to modify backend logic (for example you need a bit different database.com fields, etc.), it's very straightforward in the /lib/salesforce-connector.js file (it is using the node-salesforce library to connect to Salesforce)
  • If you want to customize the UI, you will find the css/images in the /web directory

Run locally

  • Install necessary node.js libraries with npm install
  • Launch the web server with node ./server.js

Deployment on Heroku

  • Issue heroku create [app-name] --stack cedar in a terminal, then clone the prompted git URL
  • Copy content of this repository to the empty heroku repo
  • git commit -a and git push origin master to push&deploy the repository on heroku
  • heroku open will open your brand new application in a browser

Database.com relations

The sample setup is the following (according to the challenge requirements):

  • Account__c object with lat__c and long__c fields, which are Number(3, 6) data types. This is a list of franchise locations.
  • Patron name is stored in patron__c object with field Name. Basically they are the users of our game.
  • Each score submission is stored in score__c object with field points__c, with lookup relationship to account and patron.

When a user submits a score, a new score record is always created. A new patron record is also created, if the patron's name did not exist before.

License

MIT license