Preparation

1.1 Installation

1.1.1 NodeJS & Nodemon

  • Download and install NodeJS for lastest version from: https://nodejs.org/en/download
  • Install Nodemon tool (use the sudo command for MacOS)
    • $ npm install nodemon --global
  • Confirm NodeJS & Nodemon are installed on your machine
    • $ node --version
    • $ nodemon --version

1.1.2 Visual Studio Code

1.2 MVC project

- Create ’index.js’ file

- Start server

  • $PROJECT_PATH$ >nodemon index.js

1.3 Database

1.3.1 MongoDB Atlas

  • Sign up account from MongoDB Atlas: https://www.mongodb.com/atlas/database
  • Menu Projects » New Project
    • Name Your Project: ShoppingOnline
  • Menu Database » Create a database (Free)
    • Cloud Provider & Region: AWS + Singapore
    • Cluster Name: ClusterXXX
  • Menu Database Access » Create a Database User
    • Authentication Method: Password
    • Password Authentication: <db_user> + <db_pass>
  • Menu Network Access » Add an IP address
    • Access List Entry: 0.0.0.0/0 (allow access from anywhere)

1.3.2 MongoDB Compass

  • Download and install MongoDB Compass from: menu Database » ClusterXXX » Connect » Connect using MongoDB Compass
  • Open MongoDB Compass » New Connection » copy the connection string:
    mongodb+srv://<db_user>:<db_pass>@<cluster>.mongodb.net/test

1.3.3 Models

- Create ’models/Models.js’ file

1.4 Stylesheets

- Create ’public/css/styles.css’ file

- Create ’public/css/menu.css’ file

- Create ’public/css/datatable.css’ file

1.5 Utils

- Create ’utils/MyConstants.js’ file

- Create ’utils/MongooseUtil.js’ file

- Create ’utils/MyUtil.js’ file

- Create ’utils/EmailUtil.js’ file