Vietnamese tutorial is available at readme.txt.
- Preinstall nodejs, npm and mongodb at local computer
- Clone this repo:
git clone https://github.com/BKFA/expressMVC.git
- Config your view engine in package.json: ejs, pug, hjs, etc...
npm install
npm install -g nodemon
to install nodemon, it track and monitor your projectnpm install -g browser-sync
to saving-time synchronised browser testing- (Optinal)
npm audit fix
sometimes any module old and need update 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.
- You need to install docker and docker-compose
sudo docker-composer up
+ 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.