X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-demo.git;a=blobdiff_plain;f=afb-client%2FREADME.md;h=e31390ebafeeaaa1b6ea02c0483be83e4ec17699;hp=11a8f45ffd66208b1956267aa5480a331a854b7f;hb=c4e1fc1d683701400491a6ccfd8ccb0514dbd74b;hpb=fa38a594987d958bab7b154d6afdca461081aa83 diff --git a/afb-client/README.md b/afb-client/README.md index 11a8f45..e31390e 100644 --- a/afb-client/README.md +++ b/afb-client/README.md @@ -1,2 +1,95 @@ -# afb-client-sample -Simple HTML5 Application Framework Client base on Angular & Zurb Foundation + Gulp + +## Installation + +Install HTML5 development toolchain on your host + +1. Check out this repository + git clone https://github.com/iotbzh/afb-client-sample.git + +2) Install NodeJs [not used on target] + zypper install nodejs + yum install nodejs + +3) Install building tools [bower, gulp, ....] + npm install # this install all development tool chain dependencies + sudo npm install --global gulp # this is not mandatory but it will make your live simpler + +4. For livereload functionality [automatic refresh of HTML/CSS] + install [livereload Chrome extension](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei) + + +### Overload ./etc/Defaults.js with '.noderc.js' + var config= { + APPNAME : 'AFBclient', // AppName is use as main Angular Module name + FRONTEND: "Frontend", // HTML5 frontend [no leading ./] + BACKEND : "Backend", // NodeJS Rest API [no leading ./] + URLBASE : '/opa/', // HTML basedir when running in production [should end with a /] + APIBASE : '/api/', // Api url base dir [should end with a /] + DEBUG : 4001, // Node Debug Port [for mock API debug only] + DBG_LVL : 5, // Debug Trace Level 0=no trace. + }; + module.exports = config; + + WARNING: in current version Frontend/services/ConfigApp.js is not updated automatically + you should make sure than your backend config fit with your frontend config. + Note: FCS version should have ConfigApp.js configurated automatically from GULP, but this is for "tomorrow" + +### Build project + gulp help + gulp build-app-dev + gulp watch-dev + http://localhost:3001/opa /* debug mock api base on Backend/RestApi */ + +### Test with Application server binder [you may safely run gulp 'watch-dev' + 'afb-daemon' simultaneously] + export MYWORKSPACE=$HOME/Workspace + $MYWORKSPACE/afb-daemon/build/afb-daemon --port=1234 --verbose --token=123456789 --rootdir=$MYWORKSPACE/afb-client/dist.dev + http://localhost:1234/opa + + Note: + - do not forget "/opa" that should match with your config.URLBASE + - if you change --token=xxxx do not forget to update ./Frontend/pages/HomeModules.js + - Force HTML/OPA reload with F5 after each HTML5/OPA update or new pages may not be loaded. + - 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. + +### Move to Target + cd $MYWORKSPACE/afb-client + gulp build-app-prod + scp -r ./dist.pro/* user@mytarget:/rootdir/apfDaemon + + /AppClient + | + |---- package.json + |---- bower.json + |---- gulpfile.js + |---- .noderc.js [Warning: contains private keys should not uploaded in Github] + | + |---- /Frontend + | | + | |---- index.html + | |---- app.js + | | + | |---- /styles + | | | + | | |---- _settings.scss + | | |---- app.scss + | | + | |---- /Widgets + | | | + | | |--- Widget-1 + | | |... + | | + | |-----/Pages + | |--- Home-Page + | |... + | + | + |---- /Backend + | |-- server.js // launcher + | |----/ models // mogoose database schemas + | |----/ providers // authentication services + | |----/ restapis // application APIs + | + |---- (/dist.dev) + |---- (/dist.prod) + + \ No newline at end of file