Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[전종훈] Good-Night-Hackathon-Backend 제출 #6

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .eslintrc.js
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',
},
};
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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/launch.json
!.vscode/extensions.json
25 changes: 25 additions & 0 deletions .gitmessage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# <타입> : <제목> 형식으로 작성하며 제목은 최대 50글자 정도로만 입력
# 제목을 아랫줄에 작성, 제목 끝에 마침표 금지, 무엇을 했는지 명확하게 작성

################
# 본문(추가 설명)을 아랫줄에 작성

################
# 꼬릿말(footer)을 아랫줄에 작성 (관련된 이슈 번호 등 추가)

################
# feat: 새로운 기능 추가
# fix: 버그 수정
# docs: 문서 수정
# test: 테스트 코드, 리팩토링 테스트 코드 추가
# refact: 코드 리팩토링
# style: 코드 formatting, 세미콜론 누락, 코드 자체의 변경이 없는 경우
# chore: 패키지 매니저 수정, 그 외 기타 수정 ex) .gitignore
# design: CSS 등 사용자 UI 디자인 변경
# comment: 필요한 주석 추가 및 변경
# rename: 파일 또는 폴더 명을 수정하거나 옮기는 작업만인 경우
# remove: 파일을 삭제하는 작업만 수행한 경우
# !BREAKING CHANGE: 커다란 API 변경의 이유
# !HOTFIX: 급하게 치명적인 버그를 고쳐야 하는 경우

################
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
47 changes: 28 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---

# 📽️ 영화 리뷰 앱 📽️

---

<br>

## 안내사항

- 본 레포지토리를 fork하여 과제를 수행하고, 완료시 PR을 보냅니다.
- 과제의 소스코드는 본인의 GitHub 레포지토리에 **Public**으로 올려주세요.
- 진행 간 문의사항은 이 레포지토리의 Issue로 등록해주세요.
Expand All @@ -15,6 +14,7 @@
<br>

## 기본 요구사항

- 아래 제시된 라이브러리, 프레임워크를 활용하여 영화 리뷰 앱을 구현합니다.
- 일관된 코딩 컨벤션을 유지해주세요.
- 기능 당 커밋은 필수입니다.
Expand All @@ -24,13 +24,16 @@
## 기술스택별 요구사항

### 1. Kotlin + Springboot

- 빌드 도구는 gradle를 사용해주세요.
- Spring data JPA를 사용해주세요.

### 2. Typescript + Nest.JS

- TypeORM을 사용해주세요.

### 3. Golang

- 프레임워크 사용은 자유입니다.
- Gorm이라는 ORM이 있지만 사용은 자유입니다.

Expand All @@ -50,11 +53,12 @@
## [📽️ 영화]

### 1. 영화 등록
- 제목, 장르, 개봉일, 상영 종료일, 상영 중 여부 정보를 포함해야 합니다.
- 등록 일자를 저장해야 합니다.
- 장르는 스릴러, 로맨스, 코믹, 액션 네 가지만 등록 가능합니다.
- 제목을 null로 등록하려고 할 때 예외를 처리합니다. (추가기능)


- 제목, 장르, 개봉일, 상영 종료일, 상영 중 여부 정보를 포함해야 합니다.
- 등록 일자를 저장해야 합니다.
- 장르는 스릴러, 로맨스, 코믹, 액션 네 가지만 등록 가능합니다.
- 제목을 null로 등록하려고 할 때 예외를 처리합니다. (추가기능)

<br>

### 2. 영화 삭제
Expand All @@ -70,41 +74,46 @@
<br>

### 4. 영화 단일 조회
- 제목, 장르, 개봉일, 상영 종료일, 상영 중 여부 정보를 반환합니다.
- 존재하지 않는 영화를 조회할 경우의 예외를 처리합니다. (추가기능)

- 제목, 장르, 개봉일, 상영 종료일, 상영 중 여부 정보를 반환합니다.
- 존재하지 않는 영화를 조회할 경우의 예외를 처리합니다. (추가기능)

<br>

### 5. 영화 목록 조회
- 하나의 API에서 전체 조회와 장르, 현재 상영중 여부 조건을 선택하여 조회할 수 있어야 합니다. (쿼리 파라미터)
- 개봉일 순으로 정렬합니다.

- 하나의 API에서 전체 조회와 장르, 현재 상영중 여부 조건을 선택하여 조회할 수 있어야 합니다. (쿼리 파라미터)
- 개봉일 순으로 정렬합니다.

<br>

### 6. 영화 목록 평점 순 조회 (추가기능)
- 페이지네이션이 가능합니다.
- 영화 정보와 영화별 평점평균을 반환합니다.

<br> <br>
<br> <br>

## [📝 리뷰]

### 7. 리뷰 등록
- 영화에 대한 리뷰 등록이 가능해야 합니다.
- 평점 (5점 만점), 리뷰 내용을 포함해야 합니다.

- 영화에 대한 리뷰 등록이 가능해야 합니다.
- 평점 (5점 만점), 리뷰 내용을 포함해야 합니다.

<br>

### 8. 리뷰 목록 조회
- 영화별로 리뷰 목록 조회가 가능해야 합니다.
- 등록일의 역순으로 정렬되어 있어야 합니다.
- 평점 n점 이상만 조회하도록 필터링 조건을 추가할 수 있어야 합니다. (추가기능)
예) 평점 3.5이상 리뷰 조회

- 영화별로 리뷰 목록 조회가 가능해야 합니다.
- 등록일의 역순으로 정렬되어 있어야 합니다.
- 평점 n점 이상만 조회하도록 필터링 조건을 추가할 수 있어야 합니다. (추가기능)
예) 평점 3.5이상 리뷰 조회

<br><br>

## [✅ 유닛 테스트]
- 유닛 테스트 코드를 작성합니다. (추가기능)

- 유닛 테스트 코드를 작성합니다. (추가기능)

<br><br>

Expand Down
8 changes: 8 additions & 0 deletions nest-cli.json
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
}
}
28 changes: 28 additions & 0 deletions orm.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
import { Movie } from 'src/movies/entities/movie.entity';
import { Comment } from 'src/comments/entities/comment.entity';
function ormConfig(): TypeOrmModuleOptions {
const commonConf = {
SYNCRONIZE: true,
ENTITIES: [Movie, Comment],
MIGRATIONS: [__dirname + '/migrations/**/*{.ts,.js}'],
MIGRATIONS_RUN: false,
};

return {
name: 'default',
type: 'mysql',
database: 'test',
host: 'localhost',
port: Number(3307),
username: 'root',
password: '12341234',
logging: true,
synchronize: commonConf.SYNCRONIZE,
entities: commonConf.ENTITIES,
migrations: commonConf.MIGRATIONS,
migrationsRun: commonConf.MIGRATIONS_RUN,
};
}

export { ormConfig };
Loading