Giter Site home page Giter Site logo

todolist-next-app's Introduction

Typescript 개인 과제

주제 : 통계정보, 주기적인 업데이트 페이지, 일반 리스트 페이지가 들어간 렌더링 종합세트 TodoList 만들기


개발 기간

  • 2024.03.14 ~ 15

개발 환경

  • Environment : Visual Studio Code
  • Development : typescript, React
  • Framework : Next.js
  • DB : json-server
  • Design System: DaisyUI

요구사항

목표 : Next.js의 라우팅과 렌더링의 핵심 개념을 이해할 수 있는 TodoList를 만듭니다.

(1) 애플리케이션 전역에서 사용할 내비게이션 만들기
  • 다음 페이지에 접근할 수 있는 내비게이션 바를 만듭니다.
  • about, report, todos-csr, todos-ssr
  • RootLayout에 삽입하여 모든 페이지에서 접근이 가능케합니다.
(2) react-query 세팅
  • QueryProvider를 이용하여 react-query를 세팅합니다.
(3) json-server 세팅
  • 데이터베이스 서버로 가정할 json-server를 생성합니다.
  • DB : todos, companyInfo
(4) 백엔드를 구축합니다.
  • 두 파일을 만듭니다. (app > api > 1.company > route.ts / 2.todos > route.ts )
  • (5)에서 제공할 페이지에 대한 백엔드 로직을 완성합니다. (GET, POST, PATCH, DELETE)
(5) 각 페이지를 구축합니다.
  • about 페이지 : companyInfo 정보를 불러와서 회사에 대한 소개를 구현하는 페이지 (SSG)
  • report 페이지 : todos의 통계 정보를 구현하는 페이지, 매 10초마다 결과가 갱신 (ISR,revalidate,useRouter로 페이지 이동)
  • todos CSR 페이지 : react query를 이용해 todoList의 목록을 만드는 페이지 (CSR, CRUD)
  • todos SSR 페이지 : todoList의 목록을 나타내는 페이지 (SSR, Link 태그로 페이지 이동)
  • 할일정보통계보러가기 버튼 생성 : CSR, SSR 페이지에만 존재, 버튼 클릭 시 report 페이지로 이동

선택 구현 사항

  • comments 페이지 : 댓글 추가, 조회가 가능한 페이지 구현

Code block : 데이터 모델 정의

export type Company = {
  name: string;
  description: string;
  image: string;
};
export type Todo = {
  id: string;
  title: string;
  contents: string;
  isDone: boolean;
};
export type NewTodo = Pick<Todo, "title" | "contents">;
export type EditTodo = Pick<Todo, "id" | "isDone">;

보완할 점

  • 커스텀훅을 이용해 useQuery 및 useMutation 재사용성 높이기
  • 댓글 기능 CRUD 구현
  • 완벽하게 Route Handlers 개념 복습하기

todolist-next-app's People

Contributors

dpwl032 avatar

Watchers

 avatar

todolist-next-app's Issues

피드백 - 박가현 튜터

안녕하세요, 예지님!
선택 과제임에도 불구하고 완성도 높은 프로젝트를 제출해 주신 부분이 인상 깊습니다 :)

체크리스트

image

불필요한 파일

  • src/api/useMutation.ts 라는 파일이 코드 내용이 없고 미사용됨에도 불구하고 남아있습니다. 미사용 파일 혹은 코드를 깨끗히 정리해주시면 완성도가 더 높은 프로젝트가 될 수 있습니다.

폴더 구조

  • src/api 폴더와 src/app/api 폴더가 이름은 같으나 용도가 달라 가독성이 좋지가 않습니다. api 폴더 내에는 백엔드 로직만 있도록 정리해주시고, src/api는 목적에 맞는 폴더 이름을 지정해주셨으면 더 좋았을 것 같습니다.

백엔드 구축 요구사항

  • app > api > company > route.ts를 작성하지 않은 것과, GET 메소드 로직 구현이 누락된 것이 아쉽습니다.

용도에 맞는 태그 사용

  • onClick 기능이 없는 부분에 button 태그를 사용하였습니다. 오로지 상태를 보여주기 위한 부분인 만큼 div 태그를 사용해주시면 UX적으로 혼란을 줄일 수 있을 것 같습니다!
    {item.isDone ? (
    <button className="btn btn-primary">Done</button>
    ) : (
    <button className="btn btn-primary">Not done</button>
    )}

전체적으로 요구사항을 거의 다 구현하셨고, 이번 과제의 학습 목표였던 next.js를 사용하여 다양한 랜더러를 적용해보는 부분에서 이해도가 높은 것을 잘 보여주는 프로젝트였습니다.
이번 프로젝트도 구현하시느라 정말 고생 많으셨습니다 :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.