Skip to content

[김연만] sprint8 #131

Merged
keepoki merged 3 commits intocodeit-sprint-fullstack:next-김연만from
Kimyeonman:next-김연만
Sep 30, 2025

Hidden character warning

The head ref may contain hidden characters: "next-\uae40\uc5f0\ub9cc"
Merged

[김연만] sprint8 #131
keepoki merged 3 commits intocodeit-sprint-fullstack:next-김연만from
Kimyeonman:next-김연만

Conversation

@Kimyeonman
Copy link
Collaborator

@Kimyeonman Kimyeonman commented Sep 28, 2025

요구사항

기본

  • [x]
  • 게시판으로써의 기능을 완성시키는데 중점을 둠
  • useQuery로 바꾸고 싶었지만 시간 부족으로 제출함
  • 추가적으로 db.json으로 강사님이 db 서버 만들어도 된다고 해서 db.json 으로 서버 만들어서 제출함.

심화

  • [x]
  • []

주요 변경사항

스크린샷

image

멘토에게

  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.

Copy link
Collaborator

@keepoki keepoki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

바쁜 일정에도 불구하고, 스프린트 미션 제출해주셔서 감사합니다~!!
기본적인 기능들은 잘 작성하셨습니다 ㅎㅎ

@@ -0,0 +1,180 @@
"use client"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

데이터 페칭을 "use client" 에서만 정의한 것으로 확인 되는데
CSR 방식 말고도 SSR 방식도 있으니 해당 방식으로도 작성해보는 것은 어떨까요~?

Comment on lines +20 to +26
const fetchData = async () => {
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/posts`);
const data = await response.json();

setPosts(data);
}
fetchData();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try/catch문을 사용하여 서버 상태에 따른 분기 처리, 예기치 않은 에러에 대한 예외 상황을 처리하면 좋습니다.

또한 process.env.NEXT_PUBLIC_API_URL 처럼 env를 사용하는 경우 .env.example 파일으로 어떤 값들이 필요한지 파일을 남겨두면 어떤 데이터가 필요한지 명확하게 알 수 있을 것 같습니다. (보안에 위배되지 않는 선에서요)

Comment on lines +85 to +108
<div key={post.id} className='flex-1 bg-[#F9FAFB] bg-gray-50 mr-[24px] ml-[24px] pr-[24px] pl-[24px] rounded'>
<div className='flex bg-[#3692FF] w-[100px] pr-[24px] pl-[24px] rounded-b-2xl mb-[10px]'>
<Image src={best} alt="베스트"></Image>
<div className='text-[#FFF] text-[16px] font-bold leading-[25px] font-pretendard'>best</div>
</div>
<div className='flex justify-between mb-[26px]'>
<div className='text-[#1F2937] font-bold'>{post.title}</div>
<Image src={item} width={50} height={50} alt="물품" className='border'></Image>
</div>

<div className='flex justify-between text-center mb-[10px]'>
<div className='flex gap-[8px] text-[#4B5563] text-[14px]'>
<div>{post.author}</div>
<div className='flex ' onClick={() => likeChange(post.id, post.likes)}>
<Image src={liker} alt="좋아요"></Image>
<div>{post.likes > 9999 ? "9999+": post.likes}</div>
</div>
</div>

<div className='flex gap-[8px] text-[#4B5563] text-[14px]'>
<div>{post.createdAt}</div>
</div>
</div>
</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 로직은 컴포넌트로 분리하여 관리한다면, 재사용 및 확장성의 이점을 가져갈 수 있습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logo 폴더의 리소스는 public 폴더나 assets 폴더에서 관리하는 편이 리소스의 변경하는 데 있어서 더 좋을 것 같습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 폴더명에 오타나셨습니다~ components

{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

절대 경로 임포트를 설정하셨지만, 다른 곳에서 사용되지 않고 있는 것 같습니다.

import Header from "@/app/components/Header"; 와 같이 절대 경로로 변경하면 임포트 경로의 일관성을 유지하고 파일 위치 변경 시 더 유연하게 대처할 수 있습니다.


return (
<div>
<div className='mr-[360px] ml-[360px]'>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tailwindcss를 잘 사용해주셨습니다. 조금 개선하자면, 하드코딩된 스타일을 대신 mx-auto, mx-4와 같은 스타일로 중앙 정렬하는 방식을 고려해보면 좋을 것 같습니다~

@keepoki keepoki merged commit 39ef28f into codeit-sprint-fullstack:next-김연만 Sep 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants