Example app for Ionic, Angular, BreezeJs, and Node/Express API
Install Node.js
Install grunt-cli globally
$ sudo npm -g install grunt-cliThe API lives in the aptly named "api" folder. Cd into the api folder
$ cd apiWithin /api folder, run npm install (may need sudo depending on the permissions of the folder)
$ npm installIf you plan on using the ngdocs to generate app documentation, within /api folder, run grunt build to build the docs (don't need to do this everytime, only when there are code/comment changes)
$ grunt buildTo start the API servces, within /api folder run npm start
$ npm startThe local node services should now be running at localhost:3000
The API uses Sequelize ORM, which expects to have a mysql database running on localhost.
The default credentials are as follows. You can of course modify them to match your specific mysql setup, within config/config.json.
{
"development": {
"username": "ionic",
"password": "ionic",
"database": "ionic",
"host": "127.0.0.1",
"dialect": "mysql",
"define": {
"timestamps": false
}
},
"production": {
"username": "ionic",
"password": "ionic",
"database": "ionic",
"host": "127.0.0.1",
"dialect": "mysql",
"define": {
"timestamps": false
}
}
}To seed the database with data, or to update the schema and reseed when your model changes, with the API running navigate to the dbSeed route:
http://localhost:3000/dbSeedIf you grunt built the documentation:
The node consumer API docs should now be accessible via {path to project root}/apidocs/index.html The node jsdocs should now be accessible via {path to project root}/jsdocs/index.html
First, install ionic and cordova
$ npm install -g cordova ionicNext, from project root cd in to /ionic folder, then use the ionic CLI to create a blank ionic project called "techTalk"
$ cd ionic
$ ionic start techTalk blankThe Angular/Ionic source code resides in the webapp folder. From there, you should be able to install all dependencies, then build the web application into the techTalk/www folder. The build.config.js & Gruntfile.js are setup to do this already based on the the app name being 'techTalk'.
$ cd ..
$ cd webapp
$ npm install
$ bower install
$ grunt buildThese commands install all development dependencies, all application dependencies, then builds and deploys the app into the ionic/cordova www folder. To setup the app to run on android and ios, do the following:
$ cd ..
$ cd ionic/techTalk
$ ionic platform add ios
$ ionic platform add androidTo build the ionic app for a certain platform, run the following command for that platform
$ ionic build iosTo test the app in a web browser for debugging purposes
$ ionic serveTo emulate the app for a certain platform
$ ionic emulate iosTo test from natively from a mobile device:
For iOS, run the Xcode project in ionicTechtalk/plaforms/ios/techTalk.xcode
For android, simply type:
ionic run android