/express-mvc

Templating expressJS and Dockering :flags: :rocket: :dolphin: :tada:

Primary LanguageJavaScript

ExpressMVC

MVC design pattern for developing Express app. Technology stack:

Vietnamese tutorial is available at readme.txt.

Set up in local

  1. Preinstall nodejs, npm and mongodb at local computer
  2. Clone this repo: git clone https://github.com/BKFA/expressMVC.git
  3. Config your view engine in package.json: ejs, pug, hjs, etc...
  4. npm install
  5. npm install -g nodemon to install nodemon, it track and monitor your project
  6. npm install -g browser-sync to saving-time synchronised browser testing
  7. (Optinal) npm audit fix sometimes any module old and need update
  8. npm start to run -> it start gulp and nodemon
    Note: this repo run with sass preprocessor, if you run in windows environment, you need to install sass preprocessor. In ubuntu, you need to install ruby and compass to make gulp active.

Set up with

  1. You need to install docker and docker-compose
  2. sudo docker-composer up

File and folder structure:

+ Config: your customize (etc: const), database.js where you define your mongodb string - it contain db name.
+ Controllers: code your logic and bussiness, it call models, and return views or data.
+ Models: define schema and query db.
+ Views: your front-end.
+ routers: define routers and call controller.
+ Public: somethings client can access at sometimes (css, js, img, file...)


Connect router, controller, models with your customize.

Thanks to read this article 🎁. Feel comfortable to put your issues. Hope it help. ⭐ ⭐ ⭐