HTML5 mobile web app game powered by Heroku and Salesforce
This is an entry for a CloudSpokes challenge.
Live presentation: http://cheezburger.herokuapp.com
- 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
conf/config.jsoncontains 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
/lib/salesforce-connector.jsfile (it is using the
node-salesforcelibrary to connect to Salesforce)
- If you want to customize the UI, you will find the css/images in the
- Install necessary node.js libraries with
- Launch the web server with
Deployment on Heroku
heroku create [app-name] --stack cedarin a terminal, then clone the prompted git URL
- Copy content of this repository to the empty heroku repo
git commit -aand
git push origin masterto push&deploy the repository on heroku
heroku openwill open your brand new application in a browser
The sample setup is the following (according to the challenge requirements):
long__cfields, which are Number(3, 6) data types. This is a list of franchise locations.
- Patron name is stored in
patron__cobject with field
Name. Basically they are the users of our game.
- Each score submission is stored in
score__cobject 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.