1 ### Sample client application for Application Framework Binder
3 ![AFB-Client screenshot](http://iot.bzh/images/afb-client.jpg)
5 _(Application Framework Binder can be found on https://github.com/iotbzh/afb-daemon)_
9 Install HTML5 development toolchain on your host
11 1. Check out this repository
12 git clone https://github.com/iotbzh/afb-client.git
14 2) Install NodeJs [not used on target]
18 3) Install building tools [bower, gulp, ....]
19 npm install # this install all development tool chain dependencies
20 sudo npm install --global gulp # this is not mandatory but it will make your live simpler
22 4. For livereload functionality [automatic refresh of HTML/CSS]
23 install [livereload Chrome extension](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei)
26 ### Overload ./app/etc/AppDefaults.js with '.noderc.js'
28 APPNAME : 'AFBclient', // AppName is use as main Angular Module name
29 FRONTEND: "Frontend", // HTML5 frontend [no leading ./]
30 BACKEND : "Backend", // NodeJS Rest API [no leading ./]
31 URLBASE : '/opa/', // HTML basedir when running in production [should end with a /]
32 APIBASE : '/api/', // Api url base dir [should end with a /]
33 DEBUG : 4001, // Node Debug Port [for mock API debug only]
34 DBG_LVL : 5, // Debug Trace Level 0=no trace.
36 module.exports = config;
38 WARNING: in current version Frontend/services/AppConfig.js is not updated automatically
39 you should make sure than your backend config fit with your frontend config.
40 Note: FCS version should have AppConfig.js configurated automatically from GULP, but this is for "tomorrow"
46 http://localhost:3001/opa /* debug mock api base on Backend/RestApi */
48 ### Test with Application server binder
50 # Start AppFramework Binder
51 export MYWORKSPACE=$HOME/Workspace
52 $MYWORKSPACE/afb-daemon/build/afb-daemon --port=1234 --verbose --token=123456789 --rootdir=$MYWORKSPACE/afb-client/dist.dev
54 Point your browser onto: http://localhost:1234/opa
57 - do not forget '/opa' that should match with your config.URLBASE
58 - if you change --token=xxxx do not forget to update ./Frontend/pages/HomeModules.js
59 - Force HTML/OPA reload with F5 after each HTML5/OPA update or new pages may not be loaded.
60 - When reloading HTML/OPA with F5 do not forget that your initial token wont be accepted anymore. You should either restart to clean existing session or cleanup AJB_session cookie.
63 cd $MYWORKSPACE/afb-client
65 scp -r ./dist.prod/* user@mytarget:/rootdir/afb-client
66 ssh user@mytarget "afb-daemon --port=3001 --token='' --rootdir=/rootdir/afb-client"
67 http://mytarget:3001/opa
69 ### Directory structure
75 |---- .noderc.js [Warning: contains private keys should not uploaded in Github]
84 | | |---- _settings.scss
98 | |-- server.js // launcher
99 | |----/ models // mogoose database schemas
100 | |----/ providers // authentication services
101 | |----/ restapis // application APIs