[홍승전] Sprint 6#116
Merged
iamjaeholee merged 1 commit intocodeit-sprint-fullstack:react-홍승전from Aug 27, 2025
Hidden character warning
The head ref may contain hidden characters: "react-\ud64d\uc2b9\uc804"
Merged
Conversation
iamjaeholee
approved these changes
Aug 27, 2025
iamjaeholee
left a comment
There was a problem hiding this comment.
스프린트 미션 6 수행하느라 수고하셨습니다 🥇
프론트엔드에 대한 미션도 있었는데요.
그것과 관련한 코드는 PR에서 딱히 보이지가 않네요.
혹시 수행하셨는데 제가 못 찾는 것일까봐 피드백 남겨놓도록 하겠습니다.
백엔드 코드는 글로벌 에러핸들링을 활용해 API가 안정적으로 동작할 수 있도록 잘 만들어주신 것 같아요 👍
Comment on lines
+1
to
+5
| server/node_modules/ | ||
| client/node_modules/ | ||
| .env | ||
| server/.env | ||
| client/.env |
There was a problem hiding this comment.
gitignore에 .env와 node_modules 관련하여 설정을 잘 해주셨어요.
.env
node_modules
이렇게 작성을 해도 동일한 기능을 해서 참고용으로 적어드립니다.
Comment on lines
+14
to
+21
| ProductSchema.set("toJSON", { | ||
| virtuals: true, | ||
| versionKey: false, | ||
| transform: (_, ret) => { | ||
| ret.id = ret._id.toString(); | ||
| delete ret._id; | ||
| }, | ||
| }); |
Comment on lines
+27
to
+35
| const { _id, name, description, price, tags, createdAt } = p; | ||
| return res.json({ | ||
| id: _id.toString(), | ||
| name, | ||
| description, | ||
| price, | ||
| tags, | ||
| createdAt, | ||
| }); |
There was a problem hiding this comment.
const {_id, ...rest } = p;
resturn res.json({
id: ...,
...rest
})
이렇게 destructuring을 활용하는 방법도 있으니 참고해보세요 : -)
Comment on lines
+88
to
+94
| const [items, total] = await Promise.all([ | ||
| Product.find(filter) | ||
| .sort(sort === "recent" ? { createdAt: -1 } : {}) | ||
| .skip(offset) | ||
| .limit(limit) | ||
| .select("name price createdAt") | ||
| .lean(), |
There was a problem hiding this comment.
조회 API에서 lean 메서드를 사용하신 이유는 퍼포먼스 개선을 위한 것이라고 생각하면 될까요 ? 🤔
|
|
||
| const app = express(); | ||
|
|
||
| app.use(cors({ origin: process.env.CORS_ORIGIN?.split(",") || "*" })); |
There was a problem hiding this comment.
origin 설정을 환경변수로 받아서 해주는 것 매우 좋은 방법입니다.
더 보안적으로 서버를 설계하게 되면 cors({origin: ""})는 지양하는 문법이기에 참고 부탁드립니다 ^^
혹은 개발, 로컬 환경에서만 ""사용하게끔 설정하는 것도 방법 중에 하나에요 !
| app.use(express.json()); | ||
| app.use(morgan("dev")); | ||
|
|
||
| app.get("/health", (_, res) => res.status(200).json({ ok: true })); |
Comment on lines
+21
to
+25
| app.use((err, req, res, next) => { | ||
| console.error(err); | ||
| const status = err.status || 500; | ||
| res.status(status).json({ message: err.message || "Internal Server Error" }); | ||
| }); |
aa5c944
into
codeit-sprint-fullstack:react-홍승전
1 check passed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요구사항
기본
공통
Github에 스프린트 미션 PR을 만들어 주세요.
React, Express를 사용해 진행합니다.
프론트엔드 구현 요구사항
랜딩 페이지
HTML과 CSS로 구현한 랜딩페이지를 React로 마이그레이션하세요.
랜딩 페이지 url path는 "/"로 설정하세요.
중고마켓 페이지
중고마켓 페이지 url path를 "/items"으로 설정하세요.
페이지 주소가 "/items" 일 때 상단내비게이션바의 "중고마켓" 버튼의 색상은 "3692FF"입니다.
중고마켓 페이지 판매 중인 상품은 본인이 만든 GET 메서드를 사용해 주세요.
다만 좋아요 순 정렬 기능은 제외해 주세요.
사진은 디폴트 이미지로 프론트엔드에서 처리해주세요.
베스트 상품 목록 조회는 구현하지 않습니다.
'상품 등록하기' 버튼을 누르면 "/registration" 로 이동합니다. ( 빈 페이지 )
상품 등록 페이지
PC, Tablet, Mobile 디자인에 해당하는 상품 등록 페이지를 만들어 주세요.
상품 등록 url path는 "/registration"입니다.
상품 등록은 본인이 만든 POST 메서드를 사용해 주세요.
등록 성공 시, 해당 상품 상세 페이지로 이동합니다. (빈페이지)
백엔드 구현 요구사항
중고마켓
Product 스키마를 작성해 주세요.
id, name, description, price, tags, createdAt, updatedAt필드를 가집니다.
필요한 필드가 있다면 자유롭게 추가해 주세요.
상품 등록 API를 만들어 주세요.
name, description, price, tags를 입력하여 상품을 등록합니다.
상품 상세 조회 API를 만들어 주세요.
id, name, description, price, tags, createdAt를 조회합니다.
상품 수정 API를 만들어 주세요.
PATCH 메서드를 사용해 주세요.
상품 삭제 API를 만들어 주세요.
상품 목록 조회 API를 만들어 주세요.
id, name, price, createdAt를 조회합니다.
offset 방식의 페이지네이션 기능을 포함해 주세요.
최신순(recent)으로 정렬할 수 있습니다.
name, description에 포함된 단어로 검색할 수 있습니다.
각 API에 적절한 에러 처리를 해 주세요.
각 API 응답에 적절한 상태 코드를 리턴하도록 해 주세요.
. env 파일에 환경 변수를 설정해 주세요.
CORS를 설정해 주세요.
render.com로 배포해 주세요.
MongoDB를 활용해 주세요.
##심화 요구사항
###프론트엔드 구현 요구사항
###상품 등록 페이지
유효한 조건
상품명: 1자 이상, 10자 이내
상품 소개: 10자 이상, 100자 이내
판매 가격: 1자 이상, 숫자
태그: 5글자 이내
스크린샷
멘토에게