typescript-express-starter 6.1.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.kr.md +122 -53
- package/README.md +127 -59
- package/bin/cli.js +4 -3
- package/lib/default/.swcrc +41 -0
- package/lib/default/Dockerfile +1 -1
- package/lib/default/ecosystem.config.js +40 -24
- package/lib/default/nodemon.json +2 -2
- package/lib/default/package.json +15 -8
- package/lib/default/src/app.ts +1 -2
- package/lib/default/src/http/auth.http +12 -15
- package/lib/default/src/http/users.http +12 -16
- package/lib/default/src/index.ts +1 -0
- package/lib/default/src/middlewares/auth.middleware.ts +3 -3
- package/lib/default/src/models/users.model.ts +5 -5
- package/lib/default/src/server.ts +1 -2
- package/lib/default/src/services/auth.service.ts +5 -5
- package/lib/default/src/services/users.service.ts +3 -3
- package/lib/default/src/tests/auth.test.ts +4 -4
- package/lib/default/src/tests/users.test.ts +4 -4
- package/lib/default/src/utils/logger.ts +5 -5
- package/lib/default/tsconfig.json +2 -2
- package/lib/graphql/.dockerignore +18 -0
- package/lib/graphql/.editorconfig +9 -0
- package/lib/graphql/.env +1 -0
- package/lib/graphql/.eslintignore +1 -0
- package/lib/graphql/.eslintrc +18 -0
- package/lib/graphql/.huskyrc +5 -0
- package/lib/graphql/.lintstagedrc.json +5 -0
- package/lib/graphql/.prettierrc +8 -0
- package/lib/graphql/.swcrc +39 -0
- package/lib/graphql/.vscode/launch.json +35 -0
- package/lib/graphql/.vscode/settings.json +6 -0
- package/lib/graphql/Dockerfile +24 -0
- package/lib/graphql/Makefile +6 -0
- package/lib/graphql/docker-compose.yml +50 -0
- package/lib/graphql/ecosystem.config.js +59 -0
- package/lib/graphql/jest.config.js +12 -0
- package/lib/graphql/nginx.conf +40 -0
- package/lib/graphql/nodemon.json +12 -0
- package/lib/graphql/package.json +79 -0
- package/lib/graphql/src/app.ts +105 -0
- package/lib/graphql/src/configs/development.json +19 -0
- package/lib/graphql/src/configs/production.json +19 -0
- package/lib/graphql/src/configs/test.json +19 -0
- package/lib/graphql/src/databases/index.ts +24 -0
- package/lib/graphql/src/dtos/users.dto.ts +14 -0
- package/lib/{typeorm/src/entity → graphql/src/entities}/users.entity.ts +3 -3
- package/lib/graphql/src/exceptions/HttpException.ts +10 -0
- package/lib/graphql/src/http/auth.http +49 -0
- package/lib/graphql/src/http/users.http +78 -0
- package/lib/graphql/src/index.ts +1 -0
- package/lib/graphql/src/interfaces/auth.interface.ts +14 -0
- package/lib/graphql/src/interfaces/db.interface.ts +7 -0
- package/lib/graphql/src/interfaces/users.interface.ts +5 -0
- package/lib/graphql/src/middlewares/auth.middleware.ts +32 -0
- package/lib/graphql/src/middlewares/error.middleware.ts +17 -0
- package/lib/graphql/src/repositories/auth.repository.ts +61 -0
- package/lib/graphql/src/repositories/users.repository.ts +60 -0
- package/lib/graphql/src/resolvers/auth.resolver.ts +32 -0
- package/lib/graphql/src/resolvers/users.resolver.ts +47 -0
- package/lib/graphql/src/server.ts +14 -0
- package/lib/graphql/src/tests/auth.test.ts +52 -0
- package/lib/graphql/src/tests/index.test.ts +18 -0
- package/lib/graphql/src/tests/users.test.ts +71 -0
- package/lib/graphql/src/typedefs/users.type.ts +13 -0
- package/lib/graphql/src/utils/logger.ts +75 -0
- package/lib/graphql/src/utils/util.ts +19 -0
- package/lib/graphql/src/utils/validateEnv.ts +10 -0
- package/lib/graphql/tsconfig.json +39 -0
- package/lib/knex/.swcrc +39 -0
- package/lib/knex/Dockerfile +1 -1
- package/lib/knex/ecosystem.config.js +57 -43
- package/lib/knex/knexfile.ts +6 -6
- package/lib/knex/nodemon.json +2 -2
- package/lib/knex/package.json +14 -8
- package/lib/knex/src/app.ts +2 -3
- package/lib/knex/src/databases/index.ts +6 -6
- package/lib/knex/src/http/auth.http +12 -15
- package/lib/knex/src/http/users.http +12 -16
- package/lib/knex/src/index.ts +1 -0
- package/lib/knex/src/middlewares/auth.middleware.ts +4 -4
- package/lib/knex/src/server.ts +1 -2
- package/lib/knex/src/services/auth.service.ts +5 -5
- package/lib/knex/src/services/users.service.ts +3 -3
- package/lib/knex/src/tests/auth.test.ts +2 -2
- package/lib/knex/src/tests/index.test.ts +1 -1
- package/lib/knex/src/tests/users.test.ts +2 -2
- package/lib/knex/src/utils/logger.ts +5 -5
- package/lib/knex/tsconfig.json +2 -2
- package/lib/mongoose/.swcrc +39 -0
- package/lib/mongoose/Dockerfile +1 -1
- package/lib/mongoose/docker-compose.yml +0 -4
- package/lib/mongoose/ecosystem.config.js +42 -27
- package/lib/mongoose/nodemon.json +2 -2
- package/lib/mongoose/package.json +15 -8
- package/lib/mongoose/src/app.ts +2 -3
- package/lib/mongoose/src/configs/development.json +1 -1
- package/lib/mongoose/src/configs/production.json +1 -1
- package/lib/mongoose/src/configs/test.json +1 -1
- package/lib/mongoose/src/http/auth.http +32 -0
- package/lib/mongoose/src/http/users.http +34 -0
- package/lib/mongoose/src/index.ts +1 -0
- package/lib/mongoose/src/middlewares/auth.middleware.ts +3 -3
- package/lib/mongoose/src/server.ts +1 -2
- package/lib/mongoose/src/services/auth.service.ts +5 -5
- package/lib/mongoose/src/services/users.service.ts +3 -3
- package/lib/mongoose/src/utils/logger.ts +5 -5
- package/lib/mongoose/tsconfig.json +2 -2
- package/lib/prisma/.env +1 -1
- package/lib/prisma/.swcrc +37 -0
- package/lib/prisma/Dockerfile +1 -1
- package/lib/prisma/docker-compose.yml +1 -6
- package/lib/prisma/ecosystem.config.js +40 -24
- package/lib/prisma/nodemon.json +2 -2
- package/lib/prisma/package.json +17 -10
- package/lib/prisma/src/app.ts +2 -3
- package/lib/prisma/src/http/auth.http +12 -15
- package/lib/prisma/src/http/users.http +12 -16
- package/lib/prisma/src/index.ts +1 -0
- package/lib/prisma/src/middlewares/auth.middleware.ts +4 -4
- package/lib/prisma/src/server.ts +1 -2
- package/lib/prisma/src/services/auth.service.ts +5 -5
- package/lib/prisma/src/services/users.service.ts +3 -3
- package/lib/prisma/src/utils/logger.ts +5 -5
- package/lib/prisma/tsconfig.json +2 -2
- package/lib/routing-controllers/.swcrc +37 -0
- package/lib/routing-controllers/Dockerfile +1 -1
- package/lib/routing-controllers/ecosystem.config.js +40 -24
- package/lib/routing-controllers/nodemon.json +2 -2
- package/lib/routing-controllers/package.json +15 -9
- package/lib/routing-controllers/src/app.ts +3 -4
- package/lib/routing-controllers/src/http/auth.http +12 -15
- package/lib/routing-controllers/src/http/users.http +12 -16
- package/lib/routing-controllers/src/index.ts +1 -0
- package/lib/routing-controllers/src/middlewares/auth.middleware.ts +3 -3
- package/lib/routing-controllers/src/middlewares/validation.middleware.ts +10 -2
- package/lib/routing-controllers/src/models/users.model.ts +5 -5
- package/lib/routing-controllers/src/server.ts +1 -3
- package/lib/routing-controllers/src/services/auth.service.ts +5 -5
- package/lib/routing-controllers/src/services/users.service.ts +3 -3
- package/lib/routing-controllers/src/utils/logger.ts +5 -5
- package/lib/routing-controllers/tsconfig.json +2 -2
- package/lib/sequelize/.swcrc +39 -0
- package/lib/sequelize/Dockerfile +1 -1
- package/lib/sequelize/docker-compose.yml +1 -6
- package/lib/sequelize/ecosystem.config.js +42 -27
- package/lib/sequelize/nodemon.json +2 -2
- package/lib/sequelize/package.json +15 -8
- package/lib/sequelize/src/app.ts +1 -2
- package/lib/sequelize/src/configs/development.json +2 -2
- package/lib/sequelize/src/configs/production.json +1 -1
- package/lib/sequelize/src/configs/test.json +1 -1
- package/lib/sequelize/src/http/auth.http +32 -0
- package/lib/sequelize/src/http/users.http +34 -0
- package/lib/sequelize/src/index.ts +1 -0
- package/lib/sequelize/src/middlewares/auth.middleware.ts +4 -4
- package/lib/sequelize/src/server.ts +1 -2
- package/lib/sequelize/src/services/auth.service.ts +5 -5
- package/lib/sequelize/src/services/users.service.ts +3 -3
- package/lib/sequelize/src/utils/logger.ts +5 -5
- package/lib/sequelize/tsconfig.json +2 -2
- package/lib/starter.js +5 -9
- package/lib/typeorm/.swcrc +39 -0
- package/lib/typeorm/Dockerfile +1 -1
- package/lib/typeorm/docker-compose.yml +1 -1
- package/lib/typeorm/ecosystem.config.js +42 -27
- package/lib/typeorm/nodemon.json +2 -2
- package/lib/typeorm/package.json +15 -8
- package/lib/typeorm/src/app.ts +1 -2
- package/lib/typeorm/src/configs/development.json +1 -1
- package/lib/typeorm/src/configs/production.json +1 -1
- package/lib/typeorm/src/configs/test.json +1 -1
- package/lib/typeorm/src/databases/index.ts +5 -5
- package/lib/typeorm/src/entities/users.entity.ts +26 -0
- package/lib/typeorm/src/http/auth.http +12 -15
- package/lib/typeorm/src/http/users.http +12 -16
- package/lib/typeorm/src/index.ts +1 -0
- package/lib/typeorm/src/middlewares/auth.middleware.ts +5 -9
- package/lib/typeorm/src/server.ts +1 -2
- package/lib/typeorm/src/services/auth.service.ts +13 -17
- package/lib/typeorm/src/services/users.service.ts +16 -22
- package/lib/typeorm/src/utils/logger.ts +5 -5
- package/lib/typeorm/tsconfig.json +3 -3
- package/package.json +13 -4
package/README.kr.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<h1 align="center">
|
|
2
2
|
<br>
|
|
3
|
-
<img src=
|
|
3
|
+
<img src="https://github.com/ljlm0402/typescript-express-starter/raw/images/logo.jpg" alt="프로젝트 로고" />
|
|
4
4
|
<br>
|
|
5
5
|
<br>
|
|
6
6
|
타입스크립트 익스프레스 스타터
|
|
@@ -10,10 +10,33 @@
|
|
|
10
10
|
<h4 align="center">🚀 타입스크립트 기반의 익스프레스 보일러 플레이트 스타터 패키지</h4>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
|
-
<a href="http://npm.im/typescript-express-starter" target="_blank"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<a href="http://npm.im/typescript-express-starter" target="_blank"
|
|
13
|
+
<a href="http://npm.im/typescript-express-starter" target="_blank">
|
|
14
|
+
<img src="https://img.shields.io/npm/v/typescript-express-starter.svg" alt="npm 버전" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="http://npm.im/typescript-express-starter" target="_blank">
|
|
17
|
+
<img src="https://img.shields.io/github/v/release/ljlm0402/typescript-express-starter" alt="npm 릴리즈 버전" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="http://npm.im/typescript-express-starter" target="_blank">
|
|
20
|
+
<img src="https://img.shields.io/npm/l/typescript-express-starter.svg" alt="npm 패키지 라이선스" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="http://npm.im/typescript-express-starter" target="_blank">
|
|
23
|
+
<img src="https://img.shields.io/npm/dm/typescript-express-starter.svg" alt="npm 다운로드 수" />
|
|
24
|
+
</a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="https://github.com/ljlm0402/typescript-express-starter/stargazers" target="_blank">
|
|
29
|
+
<img src="https://img.shields.io/github/stars/ljlm0402/typescript-express-starter" alt="github 스타"/>
|
|
30
|
+
</a>
|
|
31
|
+
<a href="https://github.com/ljlm0402/typescript-express-starter/network/members" target="_blank">
|
|
32
|
+
<img src="https://img.shields.io/github/forks/ljlm0402/typescript-express-starter" alt="github 포크" />
|
|
33
|
+
</a>
|
|
34
|
+
<a href="https://github.com/ljlm0402/typescript-express-starter/stargazers" target="_blank">
|
|
35
|
+
<img src="https://img.shields.io/github/contributors/ljlm0402/typescript-express-starter" alt="github 컨트리뷰터" />
|
|
36
|
+
</a>
|
|
37
|
+
<a href="https://github.com/ljlm0402/typescript-express-starter/issues" target="_blank">
|
|
38
|
+
<img src="https://img.shields.io/github/issues/ljlm0402/typescript-express-starter" alt="github 이슈" />
|
|
39
|
+
</a>
|
|
17
40
|
</p>
|
|
18
41
|
|
|
19
42
|
<br />
|
|
@@ -29,7 +52,7 @@
|
|
|
29
52
|
|
|
30
53
|
## 웹 사이트 - 프로젝트 소개 및 홍보
|
|
31
54
|
|
|
32
|
-
- [
|
|
55
|
+
- [💁🏻♂️ Dylan Iqbal :: A TypeScript Express Starter App](https://bit.ly/3rrZFZ9)
|
|
33
56
|
|
|
34
57
|
> 웹 사이트 및 블로그에 소개를 원하시는 분은 이슈 남겨주시기 바랍니다. 💙
|
|
35
58
|
|
|
@@ -45,7 +68,7 @@ Express는 유형 정의에 취약한 JavaScript로 구성 되어있습니다.
|
|
|
45
68
|
|
|
46
69
|
> 참고 : [express-generator-typescript](https://github.com/seanpmaxwell/express-generator-typescript)
|
|
47
70
|
|
|
48
|
-
|
|
71
|
+
### 🤔 Express는 무엇인가요 ?
|
|
49
72
|
|
|
50
73
|
Node.js를 위한 빠르고 개방적인 간결한 웹 프레임워크입니다.
|
|
51
74
|
|
|
@@ -67,7 +90,7 @@ $ npx typescript-express-starter "project name"
|
|
|
67
90
|
|
|
68
91
|
### 원하시는 템플릿을 선택
|
|
69
92
|
|
|
70
|
-
<img src=
|
|
93
|
+
<img src="https://github.com/ljlm0402/typescript-express-starter/raw/images/cli.gif" alt="예시" />
|
|
71
94
|
|
|
72
95
|
설치가 완료되면 Script 명령어를 통해 프로젝트를 실행합니다.
|
|
73
96
|
|
|
@@ -77,12 +100,12 @@ $ npx typescript-express-starter "project name"
|
|
|
77
100
|
| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
78
101
|
| Default | Express 기본 |
|
|
79
102
|
| Routing Controllers | 데코레이터 사용량이 많은 구조화되고 선언적이며 아름답게 구성된 클래스 기반 컨트롤러 생성 |
|
|
80
|
-
|
|
|
103
|
+
| Sequelize | Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server를 지원하는 Promise 패턴 기반의 Node.js ORM |
|
|
81
104
|
| Mongoose | Node.js와 MongoDB를 위한 ODM(Object Data Mapping) 라이브러리 |
|
|
82
105
|
| TypeORM | 자바스크립트, 타입스크립트과 함께 사용되어 Node.js, React Native, Expo에서 실행될 수 있는 ORM |
|
|
83
106
|
| Prisma | 데이터베이스에 데이터를 프로그래밍 언어의 객체와 매핑하여 기존에 SQL로 작성하던 데이터를 수정, 테이블 구조 변경등의 작업을 객체를 통해 프로그래밍적으로 할 수 있도록 해주는 ORM |
|
|
84
107
|
| Knex | 쿼리 빌더를 위한 라이브러리 |
|
|
85
|
-
| GraphQL
|
|
108
|
+
| GraphQL | API 용 쿼리 언어이며 기존 데이터로 이러한 쿼리를 수행하기위한 런타임 |
|
|
86
109
|
|
|
87
110
|
## 🛎 Script 명령어
|
|
88
111
|
|
|
@@ -94,48 +117,56 @@ $ npx typescript-express-starter "project name"
|
|
|
94
117
|
|
|
95
118
|
## 💎 프로젝트 기능
|
|
96
119
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-

|
|
100
|
-

|
|
107
|
-

|
|
123
|
+

|
|
124
|
+

|
|
125
|
+

|
|
126
|
+
|
|
127
|
+
- DevOps
|
|
128
|
+
|
|
129
|
+
- 
|
|
130
|
+

|
|
131
|
+

|
|
132
|
+

|
|
133
|
+

|
|
134
|
+

|
|
135
|
+
|
|
136
|
+
- Utilities
|
|
137
|
+
|
|
138
|
+
- 
|
|
139
|
+
|
|
140
|
+
- Database
|
|
141
|
+
- 
|
|
142
|
+

|
|
143
|
+

|
|
144
|
+

|
|
112
145
|
|
|
113
146
|
> [Simple Icons](https://simpleicons.org/)
|
|
114
147
|
|
|
115
|
-
### 🐳
|
|
148
|
+
### 🐳 Docker :: 컨테이너 플랫폼
|
|
116
149
|
|
|
117
|
-
[
|
|
150
|
+
[Docker](https://docs.docker.com/)란, 컨테이너 기반의 오픈소스 가상화 플랫폼이다.
|
|
118
151
|
|
|
119
|
-
[
|
|
152
|
+
[설치 홈페이지](https://docs.docker.com/get-docker/)에 접속해서 설치를 해줍니다.
|
|
120
153
|
|
|
121
154
|
- 백그라운드에서 컨테이너를 시작하고 실행 : `docker-compose up -d`
|
|
122
155
|
- 컨테이너를 중지하고 컨테이너, 네트워크, 볼륨 및 이미지를 제거 : `docker-compose down`
|
|
123
156
|
|
|
124
157
|
수정을 원하시면 `docker-compose.yml`과 `Dockerfile`를 수정해주시면 됩니다.
|
|
125
158
|
|
|
126
|
-
### ♻️
|
|
159
|
+
### ♻️ Nginx :: 웹 서버
|
|
127
160
|
|
|
128
|
-
[
|
|
161
|
+
[Nginx](https://www.nginx.com/) 역방향 프록시,로드 밸런서, 메일 프록시 및 HTTP 캐시로도 사용할 수있는 웹 서버입니다.
|
|
129
162
|
|
|
130
163
|
프록시는 일반적으로 여러 서버에로드를 분산하거나, 다른 웹 사이트의 콘텐츠를 원활하게 표시하거나, HTTP 이외의 프로토콜을 통해 처리 요청을 애플리케이션 서버에 전달하는 데 사용됩니다.
|
|
131
164
|
|
|
132
|
-
|
|
165
|
+
Nginx 요청을 프록시하면 지정된 프록시 서버로 요청을 보내고 응답을 가져 와서 클라이언트로 다시 보냅니다.
|
|
133
166
|
|
|
134
167
|
수정을 원하시면 `nginx.conf` 파일을 수정해주시면 됩니다.
|
|
135
168
|
|
|
136
|
-
### ✨ ESLint, Prettier
|
|
137
|
-
|
|
138
|
-
2019년, TSLint 지원이 종료 되어 ESLint를 적용하였습니다.
|
|
169
|
+
### ✨ ESLint, Prettier :: 정적 코드 분석 및 코드 스타일 변환
|
|
139
170
|
|
|
140
171
|
[ESLint](https://eslint.org/)는 JavaScript 코드에서 발견 된 문제 패턴을 식별하기위한 정적 코드 분석 도구입니다.
|
|
141
172
|
|
|
@@ -153,25 +184,47 @@ $ npx typescript-express-starter "project name"
|
|
|
153
184
|
|
|
154
185
|
5. Prettier - Code formatter 적용합니다.
|
|
155
186
|
|
|
156
|
-
<img src=
|
|
187
|
+
<img src="https://user-images.githubusercontent.com/42952358/126604937-4ef50b61-b7e4-4635-b3c9-3c94dd6b06fa.png" alt="Formatter 설정" />
|
|
157
188
|
|
|
158
|
-
|
|
189
|
+
> 2019년, TSLint 지원이 종료 되어 ESLint를 적용하였습니다.
|
|
159
190
|
|
|
160
|
-
|
|
191
|
+
### 📗 Swagger :: API 문서화
|
|
192
|
+
|
|
193
|
+
[Swagger](https://swagger.io/)는 개발자가 REST 웹 서비스를 설계, 빌드, 문서화, 소비하는 일을 도와주는 대형 도구 생태계의 지원을 받는 오픈 소스 소프트웨어 프레임워크이다.
|
|
161
194
|
|
|
162
195
|
API를 대규모로 설계하고 문서화하는 데 용이하게 사용합니다.
|
|
163
196
|
|
|
164
|
-
|
|
197
|
+
Swagger URL은 `http://localhost:3000/api-docs` 으로 작성했습니다.
|
|
165
198
|
|
|
166
199
|
수정을 원하시면 `swagger.yaml` 파일을 수정해주시면 됩니다.
|
|
167
200
|
|
|
168
|
-
### 🌐 REST Client
|
|
201
|
+
### 🌐 REST Client :: HTTP Client 도구
|
|
169
202
|
|
|
170
203
|
REST 클라이언트를 사용하면 HTTP 요청을 보내고 Visual Studio Code에서 직접 응답을 볼 수 있습니다.
|
|
171
204
|
|
|
172
205
|
VSCode Extension에서 [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) 설치합니다.
|
|
173
206
|
|
|
174
|
-
수정을 원하시면 http 폴더 안에 `*.http` 파일을 수정해주시면 됩니다.
|
|
207
|
+
수정을 원하시면 src/http 폴더 안에 `*.http` 파일을 수정해주시면 됩니다.
|
|
208
|
+
|
|
209
|
+
### 🔮 PM2 :: 웹 애플리케이션을 운영 및 프로세스 관리자
|
|
210
|
+
|
|
211
|
+
[PM2](https://pm2.keymetrics.io/)란, 서버에서 웹 애플리케이션을 운영할 때 보통 데몬으로 서버를 띄워야 하고 Node.js의 경우 서버가 크래시나면 재시작을 하기 위해서 워치독(watchdog) 류의 프로세스 관리자이다.
|
|
212
|
+
|
|
213
|
+
- 프로덕션 모드 :: `npm run deploy:prod` 또는 `pm2 start ecosystem.config.js --only prod`
|
|
214
|
+
- 개발 모드 :: `npm run deploy:dev` 또는 `pm2 start ecosystem.config.js --only dev`
|
|
215
|
+
|
|
216
|
+
수정을 원하시면 `ecosystem.config.js` 파일을 수정해주시면 됩니다.
|
|
217
|
+
|
|
218
|
+
### 🏎 SWC :: 강하고 빠른 자바스크립트 / 타입스크립트 컴파일러
|
|
219
|
+
|
|
220
|
+
[SWC](https://swc.rs/)는 차세대 고속 개발자 도구를 위한 확장 가능한 Rust 기반 플랫폼입니다.
|
|
221
|
+
|
|
222
|
+
`SWC는 단일 스레드에서 Babel보다 20배, 4개 코어에서 70배 빠릅니다.`
|
|
223
|
+
|
|
224
|
+
- swc 빌드 :: `npm run build`
|
|
225
|
+
- tsc 빌드 :: `npm run build:tsc`
|
|
226
|
+
|
|
227
|
+
수정을 원하시면 `.swcrc` 파일을 수정해주시면 됩니다.
|
|
175
228
|
|
|
176
229
|
## 🗂 코드 구조 (default)
|
|
177
230
|
|
|
@@ -235,6 +288,7 @@ VSCode Extension에서 [REST Client](https://marketplace.visualstudio.com/items?
|
|
|
235
288
|
│ │ └── vaildateEnv.ts
|
|
236
289
|
│ │
|
|
237
290
|
│ ├── app.ts
|
|
291
|
+
│ ├── index.ts
|
|
238
292
|
│ └── server.ts
|
|
239
293
|
│
|
|
240
294
|
├── .dockerignore
|
|
@@ -246,6 +300,7 @@ VSCode Extension에서 [REST Client](https://marketplace.visualstudio.com/items?
|
|
|
246
300
|
├── .huskyrc
|
|
247
301
|
├── .lintstagedrc.json
|
|
248
302
|
├── .prettierrc
|
|
303
|
+
├── .swcrc
|
|
249
304
|
├── docker-compose.yml
|
|
250
305
|
├── Dockerfile
|
|
251
306
|
├── ecosystem.config.js
|
|
@@ -259,25 +314,17 @@ VSCode Extension에서 [REST Client](https://marketplace.visualstudio.com/items?
|
|
|
259
314
|
└── tsconfig.json
|
|
260
315
|
```
|
|
261
316
|
|
|
262
|
-
##
|
|
317
|
+
## ⭐️ 주신분들
|
|
263
318
|
|
|
264
|
-
|
|
265
|
-
| :----------------- | :-------------------- |
|
|
266
|
-
| 기능 추가 | ✨ 기능 추가 |
|
|
267
|
-
| 버그 수정 | 🐞 버그 수정 |
|
|
268
|
-
| 코드 개선 | 🛠 코드 개선 |
|
|
269
|
-
| 패키지 설치 | 📦 패키지 설치 |
|
|
270
|
-
| 문서 수정 | 📚 문서 수정 |
|
|
271
|
-
| 버전 업데이트 | 🌼 버전 업데이트 |
|
|
272
|
-
| 새로운 템플릿 추가 | 🎉 새로운 템플릿 추가 |
|
|
319
|
+
[](https://github.com/ljlm0402/typescript-express-starter/stargazers)
|
|
273
320
|
|
|
274
|
-
##
|
|
321
|
+
## 🍴 해주신분들
|
|
275
322
|
|
|
276
|
-
[
|
|
323
|
+
[](https://github.com/ljlm0402/typescript-express-starter/network/members)
|
|
277
324
|
|
|
278
325
|
## 🤝 도움을 주신분들
|
|
279
326
|
|
|
280
|
-
<img src="https://contributors-img.web.app/image?repo=ljlm0402/typescript-express-starter" alt="
|
|
327
|
+
<img src="https://contributors-img.web.app/image?repo=ljlm0402/typescript-express-starter" alt="기여자">
|
|
281
328
|
|
|
282
329
|
- Jeongwon Kim [https://github.com/swtpumpkin](https://github.com/swtpumpkin)
|
|
283
330
|
|
|
@@ -313,6 +360,28 @@ VSCode Extension에서 [REST Client](https://marketplace.visualstudio.com/items?
|
|
|
313
360
|
|
|
314
361
|
- Benjamin [https://github.com/benjaminudoh10](https://github.com/benjaminudoh10)
|
|
315
362
|
|
|
363
|
+
- Amrik Singh [https://github.com/AmrikSD](https://github.com/AmrikSD)
|
|
364
|
+
|
|
365
|
+
- oricc [https://github.com/oricc](https://github.com/oricc)
|
|
366
|
+
|
|
367
|
+
- Dustin Newbold [https://github.com/dustinnewbold](https://github.com/dustinnewbold)
|
|
368
|
+
|
|
369
|
+
## 💳 라이센스
|
|
370
|
+
|
|
371
|
+
[MIT](LICENSE)
|
|
372
|
+
|
|
373
|
+
## 📬 커밋 메시지 정의
|
|
374
|
+
|
|
375
|
+
| 언제 | 메시지 |
|
|
376
|
+
| :----------------- | :-------------------- |
|
|
377
|
+
| 기능 추가 | ✨ 기능 추가 |
|
|
378
|
+
| 버그 수정 | 🐞 버그 수정 |
|
|
379
|
+
| 코드 개선 | 🛠 코드 개선 |
|
|
380
|
+
| 패키지 설치 | 📦 패키지 설치 |
|
|
381
|
+
| 문서 수정 | 📚 문서 수정 |
|
|
382
|
+
| 버전 업데이트 | 🌼 버전 업데이트 |
|
|
383
|
+
| 새로운 템플릿 추가 | 🎉 새로운 템플릿 추가 |
|
|
384
|
+
|
|
316
385
|
## 📬 이슈를 남겨주세요
|
|
317
386
|
|
|
318
387
|
추후 추가하고자하는 템플릿, 질문, 기능을 적어 주시면 최선을 다해 답변하고 반영하겠습니다.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<h1 align="center">
|
|
2
2
|
<br>
|
|
3
|
-
<img src=
|
|
3
|
+
<img src="https://github.com/ljlm0402/typescript-express-starter/raw/images/logo.jpg" alt="Project Logo" />
|
|
4
4
|
<br>
|
|
5
5
|
<br>
|
|
6
6
|
TypeScript Express Starter
|
|
@@ -10,17 +10,40 @@
|
|
|
10
10
|
<h4 align="center">🚀 Express RESTful API Boilerplate Using TypeScript</h4>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
|
-
<a href="http://npm.im/typescript-express-starter" target="_blank"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<a href="http://npm.im/typescript-express-starter" target="_blank"
|
|
13
|
+
<a href="http://npm.im/typescript-express-starter" target="_blank">
|
|
14
|
+
<img src="https://img.shields.io/npm/v/typescript-express-starter.svg" alt="npm Version" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="http://npm.im/typescript-express-starter" target="_blank">
|
|
17
|
+
<img src="https://img.shields.io/github/v/release/ljlm0402/typescript-express-starter" alt="npm Release Version" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="http://npm.im/typescript-express-starter" target="_blank">
|
|
20
|
+
<img src="https://img.shields.io/npm/l/typescript-express-starter.svg" alt="npm Package License" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="http://npm.im/typescript-express-starter" target="_blank">
|
|
23
|
+
<img src="https://img.shields.io/npm/dm/typescript-express-starter.svg" alt="npm Downloads" />
|
|
24
|
+
</a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="https://github.com/ljlm0402/typescript-express-starter/stargazers" target="_blank">
|
|
29
|
+
<img src="https://img.shields.io/github/stars/ljlm0402/typescript-express-starter" alt="github Stars" />
|
|
30
|
+
</a>
|
|
31
|
+
<a href="https://github.com/ljlm0402/typescript-express-starter/network/members" target="_blank">
|
|
32
|
+
<img src="https://img.shields.io/github/forks/ljlm0402/typescript-express-starter" alt="github Forks" />
|
|
33
|
+
</a>
|
|
34
|
+
<a href="https://github.com/ljlm0402/typescript-express-starter/stargazers" target="_blank">
|
|
35
|
+
<img src="https://img.shields.io/github/contributors/ljlm0402/typescript-express-starter" alt="github Contributors" />
|
|
36
|
+
</a>
|
|
37
|
+
<a href="https://github.com/ljlm0402/typescript-express-starter/issues" target="_blank">
|
|
38
|
+
<img src="https://img.shields.io/github/issues/ljlm0402/typescript-express-starter" alt="github Issues" />
|
|
39
|
+
</a>
|
|
17
40
|
</p>
|
|
18
41
|
|
|
19
42
|
<br />
|
|
20
43
|
|
|
21
44
|
## Translations - read in your own language
|
|
22
45
|
|
|
23
|
-
- [🇺🇸
|
|
46
|
+
- [🇺🇸 English](https://github.com/ljlm0402/typescript-express-starter/blob/master/README.md)
|
|
24
47
|
- [🇰🇷 Korean](https://github.com/ljlm0402/typescript-express-starter/blob/master/README.kr.md)
|
|
25
48
|
|
|
26
49
|
> Want to translate to your own language? please open an issue 💜
|
|
@@ -29,7 +52,7 @@
|
|
|
29
52
|
|
|
30
53
|
## Web Site - Project Introduction
|
|
31
54
|
|
|
32
|
-
- [
|
|
55
|
+
- [💁🏻♂️ Dylan Iqbal :: A TypeScript Express Starter App](https://bit.ly/3rrZFZ9)
|
|
33
56
|
|
|
34
57
|
> Want to be featured on your blog or site? please open an issue 💙
|
|
35
58
|
|
|
@@ -43,9 +66,9 @@ That's why we avoid supersets with starter packages that introduce TypeScript.
|
|
|
43
66
|
|
|
44
67
|
The package is configured to use TypeScript instead of JavaScript.
|
|
45
68
|
|
|
46
|
-
> The project referred to [express-generator-typescript](https://github.com/seanpmaxwell/express-generator-typescript)
|
|
69
|
+
> The project referred to [express-generator-typescript](https://github.com/seanpmaxwell/express-generator-typescript)
|
|
47
70
|
|
|
48
|
-
|
|
71
|
+
### 🤔 What is Express ?
|
|
49
72
|
|
|
50
73
|
Express is a fast, open and concise web framework and is a Node.js based project.
|
|
51
74
|
|
|
@@ -71,22 +94,22 @@ $ npx typescript-express-starter "project name"
|
|
|
71
94
|
|
|
72
95
|
### Select a Templates
|
|
73
96
|
|
|
74
|
-
<img src=
|
|
97
|
+
<img src="https://github.com/ljlm0402/typescript-express-starter/raw/images/cli.gif" alt="Example Cli" />
|
|
75
98
|
|
|
76
99
|
Start your typescript-express-starter app in development mode at `http://localhost:3000/`
|
|
77
100
|
|
|
78
101
|
#### Template Type
|
|
79
102
|
|
|
80
|
-
| Name
|
|
81
|
-
|
|
|
82
|
-
| Default
|
|
83
|
-
| Routing Controllers
|
|
84
|
-
|
|
|
85
|
-
| Mongoose
|
|
86
|
-
| TypeORM
|
|
87
|
-
| Prisma
|
|
88
|
-
| Knex
|
|
89
|
-
| GraphQL
|
|
103
|
+
| Name | Desc |
|
|
104
|
+
| :------------------ | :----------------------------------------------------------------------------------------------------------- |
|
|
105
|
+
| Default | Express Default |
|
|
106
|
+
| Routing Controllers | Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage |
|
|
107
|
+
| Sequelize | Easy to use multi SQL dialect ORM for Node.js |
|
|
108
|
+
| Mongoose | MongoDB Object Modeling(ODM) designed to work in an asynchronous environment |
|
|
109
|
+
| TypeORM | An ORM that can run in Node.js and Others |
|
|
110
|
+
| Prisma | Modern Database Access for TypeScript & Node.js |
|
|
111
|
+
| Knex | SQL query builder for Postgres, MySQL, MariaDB, SQLite3 and Oracle |
|
|
112
|
+
| GraphQL | query language for APIs and a runtime for fulfilling those queries with your existing data |
|
|
90
113
|
|
|
91
114
|
## 🛎 Available Commands for the Server
|
|
92
115
|
|
|
@@ -98,25 +121,35 @@ Start your typescript-express-starter app in development mode at `http://localho
|
|
|
98
121
|
|
|
99
122
|
## 💎 The Package Features
|
|
100
123
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-

|
|
104
|
-

|
|
111
|
-

|
|
127
|
+

|
|
128
|
+

|
|
129
|
+

|
|
130
|
+
|
|
131
|
+
- DevOps
|
|
132
|
+
|
|
133
|
+
- 
|
|
134
|
+

|
|
135
|
+

|
|
136
|
+

|
|
137
|
+

|
|
138
|
+

|
|
139
|
+
|
|
140
|
+
- Utilities
|
|
141
|
+
|
|
142
|
+
- 
|
|
143
|
+
|
|
144
|
+
- Database
|
|
145
|
+
- 
|
|
146
|
+

|
|
147
|
+

|
|
148
|
+

|
|
116
149
|
|
|
117
150
|
> [Simple Icons](https://simpleicons.org/)
|
|
118
151
|
|
|
119
|
-
### 🐳 Docker
|
|
152
|
+
### 🐳 Docker :: Container Platform
|
|
120
153
|
|
|
121
154
|
[Docker](https://docs.docker.com/) is a platform for developers and sysadmins to build, run, and share applications with containers.
|
|
122
155
|
|
|
@@ -127,7 +160,7 @@ Start your typescript-express-starter app in development mode at `http://localho
|
|
|
127
160
|
|
|
128
161
|
Modify `docker-compose.yml` and `Dockerfile` file to your source code.
|
|
129
162
|
|
|
130
|
-
### ♻️ NGINX
|
|
163
|
+
### ♻️ NGINX :: Web Server
|
|
131
164
|
|
|
132
165
|
[NGINX](https://www.nginx.com/) is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache.
|
|
133
166
|
|
|
@@ -137,16 +170,12 @@ When NGINX proxies a request, it sends the request to a specified proxied server
|
|
|
137
170
|
|
|
138
171
|
Modify `nginx.conf` file to your source code.
|
|
139
172
|
|
|
140
|
-
### ✨ ESLint, Prettier
|
|
173
|
+
### ✨ ESLint, Prettier :: Code Formatter
|
|
141
174
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
So, migration from TSLint to ESLint.
|
|
175
|
+
[Prettier](https://prettier.io/) is an opinionated code formatter.
|
|
145
176
|
|
|
146
177
|
[ESLint](https://eslint.org/), Find and fix problems in your JavaScript code
|
|
147
178
|
|
|
148
|
-
[Prettier](https://prettier.io/) is an opinionated code formatter.
|
|
149
|
-
|
|
150
179
|
It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
|
|
151
180
|
|
|
152
181
|
1. Install [VSCode](https://code.visualstudio.com/) Extension [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode), [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
|
@@ -159,9 +188,12 @@ It enforces a consistent style by parsing your code and re-printing it with its
|
|
|
159
188
|
|
|
160
189
|
5. Prettier - Code formatter
|
|
161
190
|
|
|
162
|
-
<img src=
|
|
191
|
+
<img src="https://user-images.githubusercontent.com/42952358/126604937-4ef50b61-b7e4-4635-b3c9-3c94dd6b06fa.png" alt="Formatter Setting" />
|
|
192
|
+
|
|
193
|
+
> Palantir, the backers behind TSLint announced in 2019 that they would be deprecating TSLint in favor of supporting typescript-eslint in order to benefit the community.
|
|
194
|
+
> So, migration from TSLint to ESLint.
|
|
163
195
|
|
|
164
|
-
### 📗 Swagger
|
|
196
|
+
### 📗 Swagger :: API Document
|
|
165
197
|
|
|
166
198
|
[Swagger](https://swagger.io/) is Simplify API development for users, teams, and enterprises with the Swagger open source and professional toolset.
|
|
167
199
|
|
|
@@ -171,13 +203,33 @@ Start your app in development mode at `http://localhost:3000/api-docs`
|
|
|
171
203
|
|
|
172
204
|
Modify `swagger.yaml` file to your source code.
|
|
173
205
|
|
|
174
|
-
### 🌐 REST Client
|
|
206
|
+
### 🌐 REST Client :: HTTP Client Tools
|
|
175
207
|
|
|
176
208
|
REST Client allows you to send HTTP request and view the response in Visual Studio Code directly.
|
|
177
209
|
|
|
178
210
|
VSCode Extension [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) Install.
|
|
179
211
|
|
|
180
|
-
Modify `*.http` file in http folder to your source code.
|
|
212
|
+
Modify `*.http` file in src/http folder to your source code.
|
|
213
|
+
|
|
214
|
+
### 🔮 PM2 :: Advanced, Production process manager for Node.js
|
|
215
|
+
|
|
216
|
+
[PM2](https://pm2.keymetrics.io/) is a daemon process manager that will help you manage and keep your application online 24/7.
|
|
217
|
+
|
|
218
|
+
- production mode :: `npm run deploy:prod` or `pm2 start ecosystem.config.js --only prod`
|
|
219
|
+
- development mode :: `npm run deploy:dev` or `pm2 start ecosystem.config.js --only dev`
|
|
220
|
+
|
|
221
|
+
Modify `ecosystem.config.js` file to your source code.
|
|
222
|
+
|
|
223
|
+
### 🏎 SWC :: a super-fast JavaScript / TypeScript compiler
|
|
224
|
+
|
|
225
|
+
[SWC](https://swc.rs/) is an extensible Rust-based platform for the next generation of fast developer tools.
|
|
226
|
+
|
|
227
|
+
`SWC is 20x faster than Babel on a single thread and 70x faster on four cores.`
|
|
228
|
+
|
|
229
|
+
- swc build :: `npm run build`
|
|
230
|
+
- tsc build :: `npm run build:tsc`
|
|
231
|
+
|
|
232
|
+
Modify `.swcrc` file to your source code.
|
|
181
233
|
|
|
182
234
|
## 🗂 Code Structure (default)
|
|
183
235
|
|
|
@@ -241,6 +293,7 @@ Modify `*.http` file in http folder to your source code.
|
|
|
241
293
|
│ │ └── vaildateEnv.ts
|
|
242
294
|
│ │
|
|
243
295
|
│ ├── app.ts
|
|
296
|
+
│ ├── index.ts
|
|
244
297
|
│ └── server.ts
|
|
245
298
|
│
|
|
246
299
|
├── .dockerignore
|
|
@@ -252,6 +305,7 @@ Modify `*.http` file in http folder to your source code.
|
|
|
252
305
|
├── .huskyrc
|
|
253
306
|
├── .lintstagedrc.json
|
|
254
307
|
├── .prettierrc
|
|
308
|
+
├── .swcrc
|
|
255
309
|
├── docker-compose.yml
|
|
256
310
|
├── Dockerfile
|
|
257
311
|
├── ecosystem.config.js
|
|
@@ -265,21 +319,13 @@ Modify `*.http` file in http folder to your source code.
|
|
|
265
319
|
└── tsconfig.json
|
|
266
320
|
```
|
|
267
321
|
|
|
268
|
-
##
|
|
322
|
+
## ⭐️ Stargazers
|
|
269
323
|
|
|
270
|
-
|
|
271
|
-
| :--------------- | :----------------- |
|
|
272
|
-
| Add Feature | ✨ Add Feature |
|
|
273
|
-
| Fix Bug | 🐞 Fix Bug |
|
|
274
|
-
| Refactoring Code | 🛠 Refactoring Code |
|
|
275
|
-
| Install Package | 📦 Install Package |
|
|
276
|
-
| Fix Readme | 📚 Fix Readme |
|
|
277
|
-
| Update Version | 🌼 Update Version |
|
|
278
|
-
| New Template | 🎉 New Template |
|
|
324
|
+
[](https://github.com/ljlm0402/typescript-express-starter/stargazers)
|
|
279
325
|
|
|
280
|
-
##
|
|
326
|
+
## 🍴 Forkers
|
|
281
327
|
|
|
282
|
-
[
|
|
328
|
+
[](https://github.com/ljlm0402/typescript-express-starter/network/members)
|
|
283
329
|
|
|
284
330
|
## 🤝 Contributors
|
|
285
331
|
|
|
@@ -319,6 +365,28 @@ Modify `*.http` file in http folder to your source code.
|
|
|
319
365
|
|
|
320
366
|
- Benjamin [https://github.com/benjaminudoh10](https://github.com/benjaminudoh10)
|
|
321
367
|
|
|
368
|
+
- Amrik Singh [https://github.com/AmrikSD](https://github.com/AmrikSD)
|
|
369
|
+
|
|
370
|
+
- oricc [https://github.com/oricc](https://github.com/oricc)
|
|
371
|
+
|
|
372
|
+
- Dustin Newbold [https://github.com/dustinnewbold](https://github.com/dustinnewbold)
|
|
373
|
+
|
|
374
|
+
## 💳 License
|
|
375
|
+
|
|
376
|
+
[MIT](LICENSE)
|
|
377
|
+
|
|
378
|
+
## 📬 Recommended Commit Message
|
|
379
|
+
|
|
380
|
+
| When | Commit Message |
|
|
381
|
+
| :--------------- | :----------------- |
|
|
382
|
+
| Add Feature | ✨ Add Feature |
|
|
383
|
+
| Fix Bug | 🐞 Fix Bug |
|
|
384
|
+
| Refactoring Code | 🛠 Refactoring Code |
|
|
385
|
+
| Install Package | 📦 Install Package |
|
|
386
|
+
| Fix Readme | 📚 Fix Readme |
|
|
387
|
+
| Update Version | 🌼 Update Version |
|
|
388
|
+
| New Template | 🎉 New Template |
|
|
389
|
+
|
|
322
390
|
## 📬 Please request an issue
|
|
323
391
|
|
|
324
392
|
In the future, please write down your desired template, questions, and features to be added, and we will try our best to answer and reflect them.
|
package/bin/cli.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/*****************************************************************
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Typescript Express Starter
|
|
5
|
+
* 2019.12.18 ~ 🎮
|
|
6
|
+
* Made By AGUMON 🦖
|
|
7
|
+
* https://github.com/ljlm0402/typescript-express-starter
|
|
7
8
|
*****************************************************************/
|
|
8
9
|
|
|
9
10
|
const path = require("path");
|