Share❣ is a usability-optimized smartphone web-app to remember your social sharing:
- Objects borrowed or lent,
- Time given or received,
- Promises given or received.
Just snap a photo, choose the person from your contacts and Share❣ will remember.
Technically speaking, it is web application created using Angular JS and Parse.com cloud.
It's completely JavaScript application. It uses Parse.com as a backend service, where data are stored and several server functions are implemented like images scaling or notifications creating, To learn more about Parse.com see JavaScript guid https://www.parse.com/docs/js_guide.
Main technology used in frontend is Angular JS.
- AngularJS
- Hammer.js to bind swipe events
- Lawnchair to provide offline support.
- SASS for stylesheets
- compass SASS extension
- cloudCode - parse.com server-side code
- docs - ngdocs documentation template file (docs are generated into here (see Generating documentation above)
- settings - settings file shared between server & app-side
- shareApp - application source code
How is this put together???
- see github documentation https://help.github.com/articles/set-up-git
Install npm node package manager
- windows -
- mac/osx - requires installation of a package manager such as mac ports
- port install npm
- linux
- npm install -g bower
Follow install instructions on SASS Installation page
- Install ruby - on OSX already installed, on Linux it depends, on Windows needs to be installed...
- Install sass:
gem install sass
- Install compass
gem install compass
Share requires parse.com back-end for development at https://www.parse.com/apps/ (free registration required)
Share requires facebook application, either create your own at https://developers.facebook.com/ or ask share development team to use our test application.
For local testing set-up the application on the domain share.test (and add share.test to your /etc/hosts), note if you want to use a different domain then share.test need to change Gruntfile.js
New application settings for local testing as:
- namespace: empty
- add App on facebook with settings:
- canvas URL: http://share.test:9000/
- secure canvas URL: https://share.test:9000/
- app domains: share.test
git clone git+ssh://[email protected]/ShareApp/share.git
1.
cd share
1.
npm install
1.
node_modules/grunt-google-cdn/node_modules/bower/bin/bower install
- Read
https://parse.com/docs/cloud_code_guide#cloud_code
and install Parse Command Line Tool - Set up new Parse App - requires parse.com account (free)
parse new cloudCode
- Create
parse_app_name.txt
file in root directory and put there Parse App name (used by makefile) - Copy
settings/settings_example.js
tosettings/settings.js
and input application keys for facebook, parse (see above) - Ensure
cloudCode/cloud/settings.js
andshareApp/app/settings.js
are links tosettings/settings.js
- this is set-up automatically on Linux/OSX on git pull as the links are in the repository, not sure how works on windows. - Add
127.0.0.1 share.test
to your/etc/hosts
file. This is because Facebook API needs domain to work. (for OSX need to flush the cache to make changes register - google "/etc/hosts OSX" for more info) - Upload cloudCode into your parse.com app using parse deploy command as follows:
cd cloudCode
parse deploy `cat ../parse_app_name.txt`
After completing Getting Started section above you are ready to start coding...
- to run local server:
node_modules/grunt-cli/bin/grunt server
- (note even local development talks to parse.com server and cloud code must have been uploaded to parse.com)
- set in settings file
- currently only used to put "test" string over logo
- To generate inline documentation call
node_modules/grunt-cli/bin/grunt ngdocs
and go to 'docs' directory
For managing translation editing C3PO is used, or displaying the translations on the front-end angular-translate is used.
See Share translations wiki page for more details
Share! uses compass sprites for combining images into one file and offline caching for offline mode. For this to work the following must be done when the application is being deployed:
Everytime a new file is added or a file is changed in shareApp/app/img directory
- find the sprite file generated by compass in shareApp/img/filters the names are normal-.png and retina-.png
- open cloudCode/cloud/views/manifest.ejs
the manifest.ejs file must be updated to add the file and increment version number.
- every time you will change CSS sprites, you should change generated filename
cloudCode/cloud/views/manifest.ejs
file
- every time you will change any HTML/CSS/JS file, you should increment version in
cloudCode/cloud/views/manifest.ejs
file to refresh HTML5 Application Cache
- every time you will change CSS sprites, you should change generated filename
cloudCode/cloud/views/manifest.ejs
file - every time you will change any HTML/CSS/JS file, you should increment version in
cloudCode/cloud/views/manifest.ejs
file to refresh HTML5 Application Cache
After doing Getting started section you can easily deploy your app to Parse by calling
make deploy
in root directory.