Skip to content

Commit

Permalink
Merge pull request #131 from ljlm0402/development
Browse files Browse the repository at this point in the history
🌼 Update Version - v7.0.0
  • Loading branch information
ljlm0402 committed Dec 23, 2021
2 parents 239275e + 1f40ca4 commit 1767ad3
Show file tree
Hide file tree
Showing 51 changed files with 1,405 additions and 22 deletions.
24 changes: 13 additions & 11 deletions README.kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ $ npx typescript-express-starter "project name"
| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Default | Express 기본 |
| Routing Controllers | 데코레이터 사용량이 많은 구조화되고 선언적이며 아름답게 구성된 클래스 기반 컨트롤러 생성 |
| Sequlize | Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server를 지원하는 Promise 패턴 기반의 Node.js ORM |
| Sequelize | Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server를 지원하는 Promise 패턴 기반의 Node.js ORM |
| Mongoose | Node.js와 MongoDB를 위한 ODM(Object Data Mapping) 라이브러리 |
| TypeORM | 자바스크립트, 타입스크립트과 함께 사용되어 Node.js, React Native, Expo에서 실행될 수 있는 ORM |
| Prisma | 데이터베이스에 데이터를 프로그래밍 언어의 객체와 매핑하여 기존에 SQL로 작성하던 데이터를 수정, 테이블 구조 변경등의 작업을 객체를 통해 프로그래밍적으로 할 수 있도록 해주는 ORM |
| Knex | 쿼리 빌더를 위한 라이브러리 |
| GraphQL (개발중) | API 용 쿼리 언어이며 기존 데이터로 이러한 쿼리를 수행하기위한 런타임 |
| GraphQL | API 용 쿼리 언어이며 기존 데이터로 이러한 쿼리를 수행하기위한 런타임 |

## 🛎 Script 명령어

Expand Down Expand Up @@ -145,24 +145,24 @@ $ npx typescript-express-starter "project name"

> [Simple Icons](https://simpleicons.org/)
### 🐳 도커 :: 컨테이너 플랫폼
### 🐳 Docker :: 컨테이너 플랫폼

[도커](https://docs.docker.com/)란, 컨테이너 기반의 오픈소스 가상화 플랫폼이다.
[Docker](https://docs.docker.com/)란, 컨테이너 기반의 오픈소스 가상화 플랫폼이다.

[도커 설치 홈페이지](https://docs.docker.com/get-docker/)에 접속해서 설치를 해줍니다.
[설치 홈페이지](https://docs.docker.com/get-docker/)에 접속해서 설치를 해줍니다.

- 백그라운드에서 컨테이너를 시작하고 실행 : `docker-compose up -d`
- 컨테이너를 중지하고 컨테이너, 네트워크, 볼륨 및 이미지를 제거 : `docker-compose down`

수정을 원하시면 `docker-compose.yml``Dockerfile`를 수정해주시면 됩니다.

### ♻️ 엔진엑스 :: 웹 서버
### ♻️ Nginx :: 웹 서버

[엔진엑스](https://www.nginx.com/) 역방향 프록시,로드 밸런서, 메일 프록시 및 HTTP 캐시로도 사용할 수있는 웹 서버입니다.
[Nginx](https://www.nginx.com/) 역방향 프록시,로드 밸런서, 메일 프록시 및 HTTP 캐시로도 사용할 수있는 웹 서버입니다.

프록시는 일반적으로 여러 서버에로드를 분산하거나, 다른 웹 사이트의 콘텐츠를 원활하게 표시하거나, HTTP 이외의 프로토콜을 통해 처리 요청을 애플리케이션 서버에 전달하는 데 사용됩니다.

엔진엑스가 요청을 프록시하면 지정된 프록시 서버로 요청을 보내고 응답을 가져 와서 클라이언트로 다시 보냅니다.
Nginx 요청을 프록시하면 지정된 프록시 서버로 요청을 보내고 응답을 가져 와서 클라이언트로 다시 보냅니다.

수정을 원하시면 `nginx.conf` 파일을 수정해주시면 됩니다.

Expand All @@ -188,13 +188,13 @@ $ npx typescript-express-starter "project name"

> 2019년, TSLint 지원이 종료 되어 ESLint를 적용하였습니다.
### 📗 스웨거 :: API 문서화
### 📗 Swagger :: API 문서화

[스웨거](https://swagger.io/)는 개발자가 REST 웹 서비스를 설계, 빌드, 문서화, 소비하는 일을 도와주는 대형 도구 생태계의 지원을 받는 오픈 소스 소프트웨어 프레임워크이다.
[Swagger](https://swagger.io/)는 개발자가 REST 웹 서비스를 설계, 빌드, 문서화, 소비하는 일을 도와주는 대형 도구 생태계의 지원을 받는 오픈 소스 소프트웨어 프레임워크이다.

API를 대규모로 설계하고 문서화하는 데 용이하게 사용합니다.

스웨거 URL은 `http://localhost:3000/api-docs` 으로 작성했습니다.
Swagger URL은 `http://localhost:3000/api-docs` 으로 작성했습니다.

수정을 원하시면 `swagger.yaml` 파일을 수정해주시면 됩니다.

Expand Down Expand Up @@ -364,6 +364,8 @@ VSCode Extension에서 [REST Client](https://marketplace.visualstudio.com/items?

- oricc [https://github.com/oricc](https://github.com/oricc)

- Dustin Newbold [https://github.com/dustinnewbold](https://github.com/dustinnewbold)

## 💳 라이센스

[MIT](LICENSE)
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ Start your typescript-express-starter app in development mode at `http://localho

#### Template Type

| Name | Desc |
| :------------------- | :----------------------------------------------------------------------------------------------------------- |
| Default | Express Default |
| Routing Controllers | Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage |
| Sequelize | Easy to use multi SQL dialect ORM for Node.js |
| Mongoose | MongoDB Object Modeling(ODM) designed to work in an asynchronous environment |
| TypeORM | An ORM that can run in Node.js and Others |
| Prisma | Modern Database Access for TypeScript & Node.js |
| Knex | SQL query builder for Postgres, MySQL, MariaDB, SQLite3 and Oracle |
| GraphQL (Developing) | query language for APIs and a runtime for fulfilling those queries with your existing data |
| Name | Desc |
| :------------------ | :----------------------------------------------------------------------------------------------------------- |
| Default | Express Default |
| Routing Controllers | Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage |
| Sequelize | Easy to use multi SQL dialect ORM for Node.js |
| Mongoose | MongoDB Object Modeling(ODM) designed to work in an asynchronous environment |
| TypeORM | An ORM that can run in Node.js and Others |
| Prisma | Modern Database Access for TypeScript & Node.js |
| Knex | SQL query builder for Postgres, MySQL, MariaDB, SQLite3 and Oracle |
| GraphQL | query language for APIs and a runtime for fulfilling those queries with your existing data |

## 🛎 Available Commands for the Server

Expand Down Expand Up @@ -369,6 +369,8 @@ Modify `.swcrc` file to your source code.

- oricc [https://github.com/oricc](https://github.com/oricc)

- Dustin Newbold [https://github.com/dustinnewbold](https://github.com/dustinnewbold)

## 💳 License

[MIT](LICENSE)
Expand Down
18 changes: 18 additions & 0 deletions lib/graphql/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# compiled output
.vscode
/node_modules

# code formatter
.eslintrc
.eslintignore
.editorconfig
.huskyrc
.lintstagedrc.json
.prettierrc

# test
jest.config.js

# docker
Dockerfile
docker-compose.yml
9 changes: 9 additions & 0 deletions lib/graphql/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions lib/graphql/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PORT=3000
1 change: 1 addition & 0 deletions lib/graphql/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist
18 changes: 18 additions & 0 deletions lib/graphql/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"parser": "@typescript-eslint/parser",
"extends": ["prettier", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"@typescript-eslint/explicit-member-accessibility": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-parameter-properties": 0,
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-var-requires": "off"
}
}
5 changes: 5 additions & 0 deletions lib/graphql/.huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"pre-commit": "lint-staged"
}
}
5 changes: 5 additions & 0 deletions lib/graphql/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.ts": [
"npm run lint"
]
}
8 changes: 8 additions & 0 deletions lib/graphql/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 150,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all",
"semi": true,
"arrowParens": "avoid"
}
39 changes: 39 additions & 0 deletions lib/graphql/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"dynamicImport": true,
"decorators": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"target": "es2017",
"externalHelpers": false,
"keepClassNames": true,
"loose": false,
"minify": {
"compress": false,
"mangle": false
},
"baseUrl": "src",
"paths": {
"@/*": ["*"],
"@databases": ["databases"],
"@dtos/*": ["dtos/*"],
"@entities/*": ["entities/*"],
"@exceptions/*": ["exceptions/*"],
"@interfaces/*": ["interfaces/*"],
"@middlewares/*": ["middlewares/*"],
"@repositories/*": ["repositories/*"],
"@resolvers/*": ["resolvers/*"],
"@typedefs/*": ["typedefs/*"],
"@utils/*": ["utils/*"]
}
},
"module": {
"type": "commonjs"
}
}
35 changes: 35 additions & 0 deletions lib/graphql/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node-terminal",
"request": "launch",
"name": "Dev typescript-express-starter",
"command": "npm run dev"
},
{
"type": "node-terminal",
"request": "launch",
"name": "Start typescript-express-starter",
"command": "npm run start"
},
{
"type": "node-terminal",
"request": "launch",
"name": "Test typescript-express-starter",
"command": "npm run test"
},
{
"type": "node-terminal",
"request": "launch",
"name": "Lint typescript-express-starter",
"command": "npm run lint"
},
{
"type": "node-terminal",
"request": "launch",
"name": "Lint:Fix typescript-express-starter",
"command": "npm run lint:fix"
}
]
}
6 changes: 6 additions & 0 deletions lib/graphql/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.formatOnSave": false
}
24 changes: 24 additions & 0 deletions lib/graphql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Common build stage
FROM node:14.14.0-alpine3.12 as common-build-stage

COPY . ./app

WORKDIR /app

RUN npm install

EXPOSE 3000

# Development build stage
FROM common-build-stage as development-build-stage

ENV NODE_ENV development

CMD ["npm", "run", "dev"]

# Production build stage
FROM common-build-stage as production-build-stage

ENV NODE_ENV production

CMD ["npm", "run", "start"]
6 changes: 6 additions & 0 deletions lib/graphql/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build:
docker build -t ${tag} .
clean:
docker rmi -f ${tag}
run:
docker run -d -p ${port}:${port} --name ${name} ${tag}
50 changes: 50 additions & 0 deletions lib/graphql/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: '3.7'

services:
proxy:
image: nginx:alpine
container_name: proxy
ports:
- '80:80'
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
restart: 'unless-stopped'
networks:
- backend
server:
build:
context: ./
target: development-build-stage
dockerfile: Dockerfile
container_name: server
ports:
- '3000:3000'
volumes:
- ./:/app
- /app/node_modules
restart: 'unless-stopped'
networks:
- backend
links:
- pg
depends_on:
- pg
pg:
image: bitnami/postgresql:11-debian-9
container_name: pg
environment:
POSTGRESQL_USERNAME: root
POSTGRESQL_PASSWORD: password
POSTGRESQL_DATABASE: test
ports:
- '5432:5432'
networks:
- backend

networks:
backend:
driver: bridge

volumes:
data:
driver: local
Loading

0 comments on commit 1767ad3

Please sign in to comment.