-
To start server:
-
install nodemon npm package -
$ npm i -D nodemon
-
edit script section in package.json
"scripts": {
"start:dev": "nodemon ./bin/www",
"test": "echo "Error: no test specified" && exit 1"
},-
run application using following command -
$ npm run start:dev
-
For developement :
-
this application is built using node.js express framework. First step is to install npm, which is node.js package manager. You can refer www.nodejs.org/en/ and www.npmjs.com for detailed steps depending on your system.
-
node version 8.9.4
npm version 5.6.0 -
dependencies:
body-parser: 1.18.2
express: 4.16.2
morgan: 1.9.0
mysql2: 1.5.2 sequelize: 4.33.4
sequelize-cli: 4.0.0
jade: 1.11.0
nodemon: 1.15.0
bluebird: 3.5.0 -
We are using Sequelize ORM. Following are the steps to install and use sequelize to create models and migration files:
-
install sequelize cli and sequelize for mysql:
$ npm install -g sequelize-cli $ npm install --save sequelize $ npm install --save mysql2
-
add paths to different folders(ex migration files, models)in .sequelizerc file in project's root folder
-
3. run following command to generate directories and boilerplate code as specified in .sequelizerc.
$ sequelize init
-
add database details in server/config.json file.
-
to create a new migration run following command:
$ sequelize migration:generate --name [name_of_your_migration]
-
to run migration :
$ sequelize db:migrate
-
to undo migration :
$ sequelize db:migrate:undo
-
to create new model, run following command:
$ sequelize model:generate --name [model name] --attributes [attribute1]:[attribute1 type], [attribute2]:[attribute2 type]
-
add routes in file server/routes/index.js
Deployment:
Android application deployment steps:
- Open the project in Android Studio.
- Go to Build->Clean Project.
- Go to Build->Rebuild Project
The above steps ensure that there are no errors in the imported project.
- Go to Build->Generate Signed APK…
- Create a new keystore or give the path to an existing keystore. Note: If creating a new keystore, remember the password provided.
- Fill in the rest of the details and click on Next.
- Choose appropriate APK Destination folder.
- Select Build type as Release.
- Choose V2 (Full APK Signature).
- Click on Finish.
The APK will now be available for distribution at your chosen destination folder. While installing the APK on your Android phone, the following steps will need to be performed:
- Navigate to Setting > Security.
- Check the option "Unknown sources".
- Tap OK on the prompt message.
- Select "Trust".