-
Notifications
You must be signed in to change notification settings - Fork 14
[함헌규] sprint12 #36
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
base: express-함헌규
Are you sure you want to change the base?
[함헌규] sprint12 #36
The head ref may contain hidden characters: "express-\uD568\uD5CC\uADDC-sprint12"
Conversation
| @@ -1,5 +1,5 @@ | |||
| import { Request, Response, NextFunction } from 'express'; | |||
| import { AsyncRequestHandler } from '../../types/asyncRequestHandler.types'; | |||
| import type { AsyncRequestHandler } from '@/types/asyncRequestHandler.types'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| "paths": { | ||
| "@/*": ["./src/*"], | ||
| "@prismaDir/*": ["./prisma/*"] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| @@ -1,5 +1,5 @@ | |||
| import { Request, Response } from 'express'; | |||
| import { UserService } from './service'; | |||
| import { UserService } from '../service/service'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 경로에 동일한 단어가 두 번 연속으로 들어가면 위화감이 느껴져서(버그가 아닌데 버그처럼 보이는 기분) 저라면 index.ts를 통해 경로를 보기 좋게 처리해볼 것 같아요.
| export default class UserRepository { | ||
| constructor(private prismaClient: PrismaClient) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 Repository 클래스는 prisma client를 주입받는 repository 클래스이니 이름을 더욱 구체화해본다면 UserPrismaRepository로 지어볼 수도 있을 것 같네요.
사실 지금처럼 Repository 구현체가 하나인 상황에서는 큰 실효성도 느끼고 힘들고, 그렇게 할 필요까지도 없지만, 추후 데이터를 가져올 수 있는 경로가 분산된다면(e.g. local, cache, file, ...) 이때는 명확하게 문제가 생기는 지점일 거에요.
그때는 아마 UserRepositry는 클래스가 아닌 인터페이스로 정의가 되곘죠?
class UserPrismaRepositry implements UserRepository
class UserCacheRepositry implements UserRepository
class UserLocalRepositry implements UserRepository
| import UserRepository from '../user/repository/userRepository'; | ||
| import { AuthController } from './controller/controller'; | ||
| import { AuthService } from './service/service'; | ||
| import express from 'express'; | ||
| import asyncRequestHandler from '../../core/handlers/asyncRequestHandler'; | ||
| import { validateBody } from '../../core/middleware/validate'; | ||
| import { signInRequestStruct, SignUpRequestStruct } from '../../structs/authStruct'; | ||
| import asyncRequestHandler from '@/core/handlers/asyncRequestHandler'; | ||
| import { validateBody } from '@/core/middleware/validate'; | ||
| import { signInRequestStruct, SignUpRequestStruct } from '@/structs/authStruct'; | ||
| import { prismaClient } from '@/prismaClient'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금 eslint 적용하고 있는 중인데 import라는 룰을 적용하면 eslint에서 자동으로 import 구문 순서를 맞춰주는데 적용해보면 적은 비용으로 큰 효용을 만들어낼 수 있을 것 같아요.
요구사항
기본 요구사항
공통
백엔드 배포
프로젝트 구조 및 환경 설정
AWS S3를 이용한 파일 업로드 시스템 구축
AWS RDS를 사용한 데이터베이스 관리
AWS EC2에서의 애플리케이션 운영
백엔드 테스트 구현
심화 요구사항
테스트 구현
상품 이미지 업로드
AWS Route 53을 활용한 도메인 관리
SSL 인증서를 통한 HTTPS 연결 구현
주요 변경사항
스크린샷
Nginx 설정
PM2 목록
EC2 보안 그룹 설정
멘토에게