Skip to content

Commit c1d9f27

Browse files
committed
init
0 parents  commit c1d9f27

File tree

26 files changed

+5100
-0
lines changed

26 files changed

+5100
-0
lines changed

.babelrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env"
4+
],
5+
"plugins": [
6+
["@babel/plugin-transform-runtime",
7+
{
8+
"regenerator": true
9+
}
10+
],
11+
["@babel/plugin-transform-async-to-generator", {
12+
"module": "bluebird",
13+
"method": "coroutine"
14+
}]
15+
]
16+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/*
2+
dist/*

.eslintrc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"env": {
3+
"es6": true,
4+
"node": true
5+
},
6+
"extends": [
7+
"airbnb-base",
8+
"plugin:prettier/recommended"
9+
],
10+
"plugins": [
11+
"prettier"
12+
],
13+
"globals": {
14+
"Atomics": "readonly",
15+
"SharedArrayBuffer": "readonly"
16+
},
17+
"parserOptions": {
18+
"ecmaVersion": 2018,
19+
"sourceType": "module"
20+
},
21+
"rules": {
22+
"semi": ["error", "never"],
23+
"no-underscore-dangle": "off",
24+
"import/no-unresolved": "off",
25+
"import/prefer-default-export": "off"
26+
}
27+
}

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
node_modules/
2+
# WebStorm files
3+
.idea/
4+
# built code
5+
dist/
6+
.webpack
7+
.build
8+
.serverless
9+
out.txt
10+
.data/docx_tmp
11+
.data/images
12+
*.log
13+
.env

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"useTabs": false,
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"semi": false
7+
}

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Nodejs TypeScript JsDoc and Clean Architect
2+
### Why have I used clean architect
3+
4+
1. Clean architect helps me focusing on delivering business use cases firstly and implement technical later. Our use cases will not depend on any libraries and frameworks. It is used only pure Programming Language ( I am choosing Javascript ), and an open interface for our Technical Provider can provide.
5+
6+
2. A simple way to write testing, we can do Acceptable Tests by write testing for use cases to make sure our application works well. Moreover, We do Unit Tests in our provider function without depending on other tiers.
7+
8+
3. Our app can be improved performance in the future. Because we implement technical provider lately so that means we can improve a technical provider by moving to a microservice or refactor our code performance without effect to our business use cases
9+
10+
11+
### Why our project combines babel Javascript, Typescript and Jsdoc
12+
13+
1. Why Javascript and Typescript?
14+
Javascript is very messy without checking type.
15+
16+
2. Why Typescript and Jsdoc?
17+
Typescirpt takes a long time at re-compilation and increase our project size.
18+
19+
We combine Jsdoc to type checking in javascript with typescirpt defination.
20+
21+
22+
### What is the project
23+
24+
1. It's one of many ways to implement clean architect.
25+
26+
2. Clean Architect in javascript with type checking helps that we can describe entities easier and make our code cleaner
27+
28+
### notes:
29+
1. add this line to all contructor function to ts-check
30+
```
31+
// wait for @implement tags of typescript and jsdoc
32+
/** @type {Change me as your tyep} */
33+
const instance = this // eslint-disable-line no-unused-vars
34+
```

package.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "nodejs-type-script-clean-architect",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "nodemon --exec babel-node src"
8+
},
9+
"repository": {
10+
"type": "git"
11+
},
12+
"keywords": [
13+
"clean architect",
14+
"typescript",
15+
"jsdoc",
16+
"babel"
17+
],
18+
"author": "hocnguyen90",
19+
"license": "ISC",
20+
"homepage": "https://bitbucket.org/tnetproposals/proposal-api",
21+
"devDependencies": {
22+
"@babel/cli": "^7.6.3",
23+
"@babel/core": "^7.6.3",
24+
"@babel/node": "^7.6.3",
25+
"@babel/plugin-transform-async-to-generator": "^7.5.0",
26+
"@babel/plugin-transform-runtime": "^7.6.2",
27+
"@babel/preset-env": "^7.6.3",
28+
"babel-plugin-module-resolver": "^3.2.0",
29+
"cross-env": "^6.0.3",
30+
"eslint": "^6.5.1",
31+
"eslint-config-airbnb-base": "^14.0.0",
32+
"eslint-config-prettier": "^6.4.0",
33+
"eslint-plugin-import": "^2.18.2",
34+
"eslint-plugin-prettier": "^3.1.1",
35+
"husky": "^3.0.8",
36+
"lint-staged": "^9.4.2",
37+
"prettier": "^1.18.2",
38+
"tsc": "^1.20150623.0",
39+
"typescript": "^3.8.2",
40+
"webpack-node-externals": "^1.7.2"
41+
},
42+
"dependencies": {
43+
"sequelize": "^5.21.5"
44+
},
45+
"husky": {
46+
"hooks": {
47+
"pre-commit": "lint-staged"
48+
}
49+
},
50+
"lint-staged": {
51+
"*.js": [
52+
"eslint --fix",
53+
"git add"
54+
]
55+
},
56+
"config": {
57+
"skip_download": true
58+
}
59+
}

src/config/base.yaml

Whitespace-only changes.

src/config/development.yaml

Whitespace-only changes.

0 commit comments

Comments
 (0)