#Matrix.js
Nodejs scaffold based on Koa. You can transform it to be a matrix monster.
##Get Started
Before you start, take a moment to see how the project structure looks like:
.
├── bin
│ ├── build.sh deployment: build shell
│ └── run.sh deployment: run shell
│
├── config
│ ├── defalut.js default config
│ ├── dev.js NODE_ENV: dev config
│ └── prod.js NODE_ENV: prod config
│
├── client
│ ├── resource
│ │ ├── src
│ │ │ ├── js
│ │ │ └── scss
│ │ └── build
│ └── view
│ ├── cmp
│ │ ├── head.html
│ │ ├── header.html
│ │ └── footer.html
│ ├── layout
│ │ └── default.html
│ └── page
│ └── index.html
│
├── server
│ ├── recipe framework startup rule
│ │ ├── template.js
│ │ ├── resource.js
│ │ ├── router.js
│ │ └── middleware.js
│ │
│ ├── model
│ │ ├── datasource NODE_ENV: st/prod datasource
│ │ └── mock NODE_ENV: dev mock datasource
│ │
│ ├── controller
│ ├── middleware
│ ├── extension extension tools
│ └── app.js application script
│
├── log NODE_ENV: dev logs
├── index.js entry point
├── gulpfile.js workflow script
├── pm2.json
└── package.json
You can start by cloning the latest version of Matrix.js on your local machine by running:
$ git clone -o Matrix.js -b master --single-branch \
https://github.com/yooungt13/Matrix.js.git MyApp
$ cd MyApp
Alternatively, you can start a new project based on Matrix.js right from Yeoman generator.
This will install both run-time project dependencies and developer tools listed in package.json file.
This command will start the Node.js server (node index.js
with pm2) and gulp task for watching files change to reload.
http://localhost:3000/ — Node.js server
http://localhost:3000/ — Health check
http://localhost:3000/ — API Datasource
Note that the npm run dev
commond launches the app in dev
mode, the compiled output files are not optimized and minimized in this case. You can use prod
argument to launch it in release (production) mode:
$ npm run prod
This command will output the logs into terminal for checking, or you can check logs in the directory MyApp/log
.
If you need to keep your project up to date with the recent changes made to Matrix.js, you can always fetch and merge them from this repo back into your own project by running:
$ git checkout master
$ git fetch Matrix.js
$ git merge Matrix.js/master
$ npm install