-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Server] 개발환경 세팅 (#4) * build: open-list-server init * chore: @nestjs/config class-validator class-transformer 설치 * chore: 루트 레벨에서 설치한 패키지 삭제 * chore: NestJs 개발 환경 세팅 * chore: @nestjs/config class-validator class-transformer 설치 * Server/feature/#13 (#25) * chore: postgresql, nestjs docker 세팅 * chore: @nestjs/typeorm, typeorm, pg 설치 * chore: Typeorm 세팅 및 TestModel 테이블 생성 * 테스트용 유저 API 구현 (#30) * chore: common resource 추가 * chore: users resource 추가 * feature: base entity 구현 * feature: usersEntity 구현 * feature: 모듈에 usersModel 추가 * style: entity,dto의 users -> user로 변경 * feature: CreateUserDto 구현 * feature: userEntity 이메일 필드 추가 * feature: createUserDto 이메일 필드 추가 * feature: user patch->put으로 변경 * feature: updateUserDto 구현 * feature : create user 구현 * feature: 모든 유저의 정보를 가져오는 API 구현 * feature: 특정 유저의 정보를 가져오는 API 구현 * feature: user 정보 수정 API 구현 * feature: user 삭제 API 구현 * feature: ValidationPipe 적용 * refactor: usersService 리팩토링 * [Server] 유닛 테스트 환경 세팅 (#32) * chore: test 경로 설정 * feature: TestCommonModule 구현 * feature: users.service.spec.ts 의존성 주입 * feature: users.controller.spec.ts 의존성 주입 * [Server] Users resource 이름 변경 (#34) * style: usersController 네이밍에 컨벤션 맞게 변경 * style: usersService 컨벤션에 따른 네이밍 변경 * style: UsersModel -> UserModel 컨벤션에 따른 네이밍 변경 * feature: usersService 테스트 코드 작성 (#39) * [Server] Folder entity 생성 및 crud 구현 (#42) * feat: folders crud 구현 * chore: TestModel 삭제 및 관련된 종속성 제거 * feat: folders.controller.spec.ts 삭제, folders.service.spec.ts 구현 * feature: docker파일 수정 (#57) * feat: private checklist entity 생성 및 crud 구현 (#61) * chore: 개발용 postgres 포트변경 5432->5433, .env도 port 5433으로 변경필요 * feat: checklists res 생성 * feat: checklist, private-checklist, shared-checklisst 엔티티 생성, user모델과 folder모델과의 의존관계 주입 * feat: author->editor로 수정, 공유체크리스트와 사용자의 relation을 many to many로 업데이트 * feat: 개인, 공유 체크리스트에 대해 생성과 업데이트 시 dto 생성 * fix: class 이름 오타 수정 * refactor: rest api 방식에 따라 함수명 변경 * feat: CheckListModel에서 진행률 컬럼 삭제 * feat: folder와 user간의 manyToOne relation적용 * feat: private-checklist crud 작성 * feat: folder service 커버리지 100 달성 * test: private-checklist test code 작성, 커버리지 92퍼센트 * feat: checklist 폴더 분리 & dto 빈문자열 검증 추가 (#66) * refactor: checklists를 private, shared폴더로 분리. * refactor: private-checklists를 folders 하위로 이동 * fix: 빈문자열 검증 추가 * [Server] Winston으로 로그 관리 (#70) * chore: nest-winston winston winston-daily-rotate-file 설치 * feat: winston logger 설정 파일 구현 * feat: winston logger middleware 구현 * feat: 요청 logger middleware 구현 * feat: 로그에 요청 처리 시간 추가되도록 개선 * chore: PR 템플릿 수정 * chore: PR 템플릿 수정 * feat: jwt access, refresh token 기반 인가 구현 * chore: auth resource 추가 * chore: jwt 모듈 추가 * feature: signToken 구현 * feature: 토큰 검증, 토큰 재발급 기능 구현 * feature: 로그인 기능 구현 * feature: 로그인 관련 서비스 구현 * feature: login 컨트롤러 구현 * style: loginDto -> loginUserDto로 변경 * feature: access 토큰 재발급 컨트롤러 구현 * refactor: access토큰 재발급 형식 변경 * feature: 유저 register 기능 구현 * feature: auth.service.ts 테스트 코드 작성 * fix: 이메일 중복시 에러 메시지 수정 --------- Co-authored-by: Minseong Park <[email protected]> * [Server] shared-checklist 소켓 구현 (#78) * [Server] apple oauth api 구현 (#86) * chore: @nestjs/axios 설치 * chore: axios 설치 * chore: axios 설치 * feat: dto수정, userId 컬럼추가, providerId 수정, fullName 컬럼 추가 * feat: entity에 따라 dto 항목 수정 * feat: apple oauth 로그인 서비스 함수 추가 client secret 만들고, axios post로 user 정보 가지고옴. * feat: apple oauth 로그인 엔드포인트 추가 * feat: apple 유저에대해 create, update 함수 구현 * feat: publicKey 발급받는 로직추가 * [Server] access 토큰 재발급시 유저 정보 없는 버그 수정 (#83) * [Server] privateChecklist의 내용 저장 api 구현 (#88) * [Server] apple oauth 로그인 로직 수정 (#118) * feat: env 사용방식 변경 + idToken 검증로직 추가 * chore: jwk를 pem으로 변환하기 위한 jose 라이브러리 설치 * chore: jose 라이브러리 제거 @panva/jose 설치 * feat: request body로 들어오는 auth-user.dto.ts 수정 * feat: 애플 유저 등록 로직 수정 * docs: jsdoc return type 수정 * feat: apple login 로직 수정(appleToken, clientSecret 로직 삭제) * feat: refreshAccessToken 함수에서 refreshToken도 함께 반환해주도록 로직 수정 --------- Co-authored-by: Minseong Park <[email protected]>
- Loading branch information
1 parent
8564edc
commit 8ad34c7
Showing
69 changed files
with
8,705 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
## 완료한 기능 혹은 수정 기능 | ||
## 🚀 완료한 기능 혹은 수정 기능 | ||
|
||
## 고민과 해결 과정 | ||
|
||
## 스크린샷 | ||
<br> | ||
|
||
## 테스트 결과(커버리지/테스트 결과) | ||
## 💡 고민과 해결 과정 | ||
### `배경` | ||
|
||
### `고민` | ||
|
||
### `해결과정` | ||
|
||
<br> | ||
|
||
## 📸 스크린샷 | ||
|
||
<br> | ||
|
||
## ✅ 테스트 결과(커버리지/테스트 결과) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 디폴트 무시된 파일 | ||
/.idea/shelf/ | ||
/.idea/workspace.xml | ||
# 에디터 기반 HTTP 클라이언트 요청 | ||
/httpRequests/ | ||
# Datasource local storage ignored files | ||
/dataSources/ | ||
/dataSources.local.xml | ||
|
||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.gitignore | ||
Dockerfile | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
tsconfigRootDir: __dirname, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint/eslint-plugin'], | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
root: true, | ||
env: { | ||
node: true, | ||
jest: true, | ||
}, | ||
ignorePatterns: ['.eslintrc.js'], | ||
rules: { | ||
'@typescript-eslint/interface-name-prefix': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# compiled output | ||
/dist | ||
/node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
pnpm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# OS | ||
.DS_Store | ||
|
||
# Tests | ||
/coverage | ||
/.nyc_output | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/extensions.json | ||
|
||
.env | ||
postgres-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:18 | ||
RUN mkdir -p /app | ||
WORKDIR /app | ||
ADD . /app/ | ||
|
||
RUN rm yarn.lock || true | ||
RUN rm package-lock.json || true | ||
RUN yarn | ||
RUN yarn build | ||
|
||
ENV HOST 0.0.0.0 | ||
EXPOSE 3000 | ||
|
||
CMD [ "yarn", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<p align="center"> | ||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a> | ||
</p> | ||
|
||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 | ||
[circleci-url]: https://circleci.com/gh/nestjs/nest | ||
|
||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> | ||
<p align="center"> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a> | ||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> | ||
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a> | ||
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> | ||
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> | ||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> | ||
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a> | ||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a> | ||
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a> | ||
</p> | ||
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer) | ||
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)--> | ||
|
||
## Description | ||
|
||
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. | ||
|
||
## Installation | ||
|
||
```bash | ||
$ yarn install | ||
``` | ||
|
||
## Running the app | ||
|
||
```bash | ||
# development | ||
$ yarn run start | ||
|
||
# watch mode | ||
$ yarn run start:dev | ||
|
||
# production mode | ||
$ yarn run start:prod | ||
``` | ||
|
||
## Test | ||
|
||
```bash | ||
# unit tests | ||
$ yarn run test | ||
|
||
# e2e tests | ||
$ yarn run test:e2e | ||
|
||
# test coverage | ||
$ yarn run test:cov | ||
``` | ||
|
||
## Support | ||
|
||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). | ||
|
||
## Stay in touch | ||
|
||
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) | ||
- Website - [https://nestjs.com](https://nestjs.com/) | ||
- Twitter - [@nestframework](https://twitter.com/nestframework) | ||
|
||
## License | ||
|
||
Nest is [MIT licensed](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3.8' | ||
services: | ||
postgresql_db: | ||
image: postgres:15 | ||
restart: always | ||
volumes: | ||
- ./postgres-data:/var/lib/postgresql/data | ||
ports: | ||
- '5433:5432' | ||
environment: | ||
POSTGRES_USER: ${DB_USERNAME} | ||
POSTGRES_PASSWORD: ${DB_PASSWORD} | ||
POSTGRES_DB: ${DB_DATABASE} | ||
|
||
# nestjs_server: | ||
# build: . | ||
# ports: | ||
# - '3000:3000' | ||
# depends_on: | ||
# - postgresql_db | ||
# environment: | ||
# JWT_SECRET: ${JWT_SECRET} | ||
# HASH_ROUNDS: ${HASH_ROUNDS} | ||
# PROTOCOL: ${PROTOCOL} | ||
# HOST: ${HOST} | ||
# DB_HOST: ${DB_HOST} | ||
# DB_PORT: ${DB_PORT} | ||
# DB_USERNAME: ${DB_USERNAME} | ||
# DB_PASSWORD: ${DB_PASSWORD} | ||
# DB_DATABASE: ${DB_DATABASE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/nest-cli", | ||
"collection": "@nestjs/schematics", | ||
"sourceRoot": "src", | ||
"compilerOptions": { | ||
"deleteOutDir": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"name": "server", | ||
"version": "0.0.1", | ||
"description": "", | ||
"author": "", | ||
"private": true, | ||
"license": "UNLICENSED", | ||
"scripts": { | ||
"build": "nest build", | ||
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", | ||
"start": "nest start", | ||
"start:dev": "nest start --watch", | ||
"start:debug": "nest start --debug --watch", | ||
"start:prod": "node dist/main", | ||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"test:cov": "jest --coverage", | ||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", | ||
"test:e2e": "jest --config ./test/jest-e2e.json" | ||
}, | ||
"dependencies": { | ||
"@nestjs/axios": "^3.0.1", | ||
"@nestjs/common": "^10.0.0", | ||
"@nestjs/config": "^3.1.1", | ||
"@nestjs/core": "^10.0.0", | ||
"@nestjs/jwt": "^10.2.0", | ||
"@nestjs/mapped-types": "*", | ||
"@nestjs/platform-express": "^10.0.0", | ||
"@nestjs/platform-ws": "^10.2.10", | ||
"@nestjs/typeorm": "^10.0.0", | ||
"@nestjs/websockets": "^10.2.10", | ||
"@panva/jose": "^1.9.3", | ||
"axios": "^1.6.2", | ||
"class-transformer": "^0.5.1", | ||
"class-validator": "^0.14.0", | ||
"nest-winston": "^1.9.4", | ||
"pg": "^8.11.3", | ||
"reflect-metadata": "^0.1.13", | ||
"rxjs": "^7.8.1", | ||
"typeorm": "^0.3.17", | ||
"winston": "^3.11.0", | ||
"winston-daily-rotate-file": "^4.7.1" | ||
}, | ||
"devDependencies": { | ||
"@nestjs/cli": "^10.0.0", | ||
"@nestjs/schematics": "^10.0.0", | ||
"@nestjs/testing": "^10.0.0", | ||
"@types/express": "^4.17.17", | ||
"@types/jest": "^29.5.2", | ||
"@types/node": "^20.3.1", | ||
"@types/supertest": "^2.0.12", | ||
"@typescript-eslint/eslint-plugin": "^6.0.0", | ||
"@typescript-eslint/parser": "^6.0.0", | ||
"eslint": "^8.42.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"jest": "^29.5.0", | ||
"prettier": "^3.0.0", | ||
"source-map-support": "^0.5.21", | ||
"supertest": "^6.3.3", | ||
"ts-jest": "^29.1.0", | ||
"ts-loader": "^9.4.3", | ||
"ts-node": "^10.9.1", | ||
"tsconfig-paths": "^4.2.0", | ||
"typescript": "^5.1.3" | ||
}, | ||
"jest": { | ||
"moduleFileExtensions": [ | ||
"js", | ||
"json", | ||
"ts" | ||
], | ||
"rootDir": "src", | ||
"moduleNameMapper": { | ||
"^src/(.*)$": "<rootDir>/$1", | ||
"^test/(.*)$": "<rootDir>/../test/$1" | ||
}, | ||
"testRegex": ".*\\.spec\\.ts$", | ||
"transform": { | ||
"^.+\\.(t|j)s$": "ts-jest" | ||
}, | ||
"collectCoverageFrom": [ | ||
"**/*.(t|j)s" | ||
], | ||
"coverageDirectory": "../coverage", | ||
"testEnvironment": "node" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { AppController } from './app.controller'; | ||
import { AppService } from './app.service'; | ||
|
||
describe('AppController', () => { | ||
let appController: AppController; | ||
|
||
beforeEach(async () => { | ||
const app: TestingModule = await Test.createTestingModule({ | ||
controllers: [AppController], | ||
providers: [AppService], | ||
}).compile(); | ||
|
||
appController = app.get<AppController>(AppController); | ||
}); | ||
|
||
describe('root', () => { | ||
it('should return "Hello World!"', () => { | ||
expect(appController.getHello()).toBe('Hello World!'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Controller, Get } from '@nestjs/common'; | ||
import { AppService } from './app.service'; | ||
|
||
@Controller() | ||
export class AppController { | ||
constructor(private readonly appService: AppService) {} | ||
|
||
@Get() | ||
getHello(): string { | ||
return this.appService.getHello(); | ||
} | ||
} |
Oops, something went wrong.