The template is used to create nodejs project. All nodejs projects must follow the conventions in the template. Calling for exceptions must be brought up in the cweb team.
Below we describe the conventions or tools specific to golang project.
├── .github
│ ├── ISSUE_TEMPLATE
│ └── PULL_REQUEST_TEMPLATE
├── CHANGELOG.md
├── CODEOWNERS
├── Jenkinsfile
├── Makefile
├── README.md
├── app.js
├── bin
│ └── www.js
├── build
│ └── node-project
│ └── Dockerfile
├── configs
│ ├── README.md
│ └── runtime.json
├── controllers
│ └── site.js
├── docs
│ └── README.md
├── gulp
│ └── build.js
├── i18n
│ └── index.js
├── lib
│ ├── logger.js
│ └── util.js
├── models
│ └── README.md
├── package.json
├── public
│ ├── ejs
│ │ └── index.ejs
│ └── src
│ ├── img
│ │ └── favicon.ico
│ ├── js
│ │ └── index.js
│ └── less
│ └── index.less
├── routes
│ └── index.js
├── scripts
│ ├── README.md
├── test
│ └── README.md
└── webpack
├── dev.js
├── dll.js
└── prod.js
A brief description of the layout:
.github
has two template files for creating PR and issue. Please see the files for more details..gitignore
varies per project, but all projects need to ignorenode_modules
directory..babelrc
config of babel..eslintrc
config of eslint..eslintigore
config of eslintignore. ignore built files.Makefile
is used to build the project.Dockerfile
is used to build docker image.CHANGELOG.md
contains auto-generated changelog information.CODEOWNERS
contains owners of the project.README.md
is a detailed description of the project.build
dockerfile herebin
only one file: www.jsapp.js
index of the projectcontrollers
controller of nodejsconfigs
runtime or other configmodels
define models for databasedocs
for project documentations.lib
library for the project.i18n
i18n for the project.test
holds all tests (include unit tests).public
for all static file, e.g. js, img, css.routes
contains all route.scripts
contains all .sh filegulp
gulpfile here.webpack
webpack config, contains dev and prod.
- Nodejs v8
- Express v4
- Webpack v2
- Gulp
- EsLint
- Prettier
- EsLint, Prettier
- You can’t commit if there is any error in the staged files.
- npm run watch,support es6, react。
- it will build runtime.json in configs, when npm run watch or build
- start nodejs server
- dev:npm run start:dev
- online:npm run start
- listen on port 3000
- make release VERSION=${TAG}
- npm run watch
- npm run start:dev
- npm run watch:all
- npm run build
- npm run start
- make lint
- make doctoc
- make container VERSION=${TAG}
- make push VERSION=${TAG}