npm install generator-matrix#Matrix.js



![npm]()
> Nodejs scaffold based on Koa. You can transform it to be a matrix monster.

##Get Started
* Mac OS X, Windows, or Linux
* Node.js v4.2.1 or newer
* npm v3.9.6 or newer
* PM2 v1.1.3 or newer
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
#### 1. Get the latest version
You can start by cloning the latest version of Matrix.js on your
local machine by running:
`shell`
$ 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.
#### 2. Run npm install
This will install both run-time project dependencies and developer tools listed
in package.json file.
#### 3. Run npm run dev
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:
`shell`
$ npm run prod
#### 4. Run pm2 logs
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:
`shell``
$ git checkout master
$ git fetch Matrix.js
$ git merge Matrix.js/master
$ npm install