Coder Social home page Coder Social logo

ziggle-fe's Introduction

Ziggle Frontend

엄청난 역사를 지닌 지글 프론트엔드 레포지토리를 방문해주신 여러분, 환영합니다

Project Structure

.
├── public
│   ├── .well-known: 앱 링크를 위한 파일
│   └── tinymce: wysiwyg editor
└── src
    ├── api: 앱 내부에서 호출하는 api. fetch를 통해 호출
    │   ├── auth
    │   ├── image
    │   ├── log
    │   ├── notice
    │   └── tag
    ├── app
    │   ├── [lng]: 지글의 모든 화면은 이 디렉토리 밑에 있습니다
    │   │   ├── (common)
    │   │   │   ├── (common)
    │   │   │   │   ├── mypage
    │   │   │   │   ├── search
    │   │   │   │   └── section
    │   │   │   │       └── [type]
    │   │   │   └── (needSidebar)
    │   │   │       ├── [category]
    │   │   │       └── notice
    │   │   │           └── [id]
    │   │   │               └── assets
    │   │   ├── (empty): 레이아웃이 비어있는 화면
    │   │   │   ├── app: /[lng]/app - 앱 설치 페이지 리다이렉션
    │   │   │   └── login: /[lng]/login - 로그인 페이지 리다이렉션
    │   │   └── (write): 사이드바가 없고, 상단바가 있는 글쓰기 화면
    │   │       └── write: /[lng]/write
    │   ├── api
    │   │   ├── auth: nextauth를 사용하여 인증을 처리
    │   │   │   └── [...nextauth]
    │   │   ├── bff: ziggle-backend와 통신하는 api. proxy 역할
    │   │   │   └── [...ziggle]
    │   │   ├── notice: 직접 ziggle-backend와 통신하는 api (deprecated)
    │   │   │   └── [noticeId]
    │   │   │       ├── [contentId]
    │   │   │       │   └── foreign
    │   │   │       ├── additional
    │   │   │       └── full
    │   │   └── og: open graph image를 생성하는 api
    │   ├── components: 모든 컴포넌트는 이 디렉토리 밑에 있습니다
    │   │   ├── atoms: 가장 작은 단위의 컴포넌트
    │   │   │   ├── Analytics
    │   │   │   ├── Button
    │   │   │   ├── Checkbox
    │   │   │   ├── ExternalLink
    │   │   │   └── Toggle
    │   │   ├── molecules: atom을 조합한 컴포넌트
    │   │   │   ├── Chip
    │   │   │   ├── DDay
    │   │   │   ├── HighlightedText
    │   │   │   ├── HorizontalScrollButton
    │   │   │   ├── Pagination
    │   │   │   ├── Tag
    │   │   │   └── ZaboImage
    │   │   ├── organisms: molecule을 조합한 컴포넌트
    │   │   │   ├── DateTimePicker
    │   │   │   ├── ImageCarousel
    │   │   │   ├── Tags
    │   │   │   └── Zabo
    │   │   └── templates: organism을 조합한 컴포넌트
    │   │       ├── Footer
    │   │       ├── LoadingCatAnimation
    │   │       ├── Navbar
    │   │       ├── NavbarWrite
    │   │       ├── ResultZabo
    │   │       ├── SearchAnimation
    │   │       ├── SearchResults
    │   │       └── Sidebar
    │   └── i18next: 다국어 지원을 위한 설정
    │       └── locales
    │           ├── en
    │           └── ko
    ├── assets: 이미지, 폰트, 아이콘 등의 정적 파일
    │   ├── animations: lottie 애니메이션
    │   ├── fonts
    │   ├── icons
    │   └── logos
    ├── mock: 개발 환경(storybook)에서 사용하는 mock 데이터
    └── utils: 유틸성 파일

몇가지 알아두면 좋은 점

Next.js

지글은 Next.js의 app directory 구조를 따르고 있습니다. 이 때문에 각 컴포넌트(페이지)는 Client Component와 Server Component로 나눠지게 됩니다

각각은 각자의 특성을 가지고 있습니다.

  • Client Component: 클라이언트에서 hydrate되는 컴포넌트
  • Server Component: 서버에서 렌더링되는 컴포넌트 (hydration이 필요 없음)

i18next

지글은 다국어 지원을 위해서 i18next를 사용하고 있습니다. src/app/i18next/locales 디렉토리에 각 언어별 폴더로 json 파일을 만들어서 다국어를 지원하고 있습니다.

자세한 json 파일 작성법은 i18next 문서를 참고해주세요.

Server Component에서는 const {t} = await createTranslation()을, Client Component에서는 const {t} = useTranslation을 사용해야 합니다. 서버와 클라이언트에서 동일한 번역을 사용하기 위해서 파라미터로 받은 lng를 각 함수의 인수로 넘겨주어야 합니다.

auth

지글은 NextAuth를 사용하여 인증을 처리하고 있습니다. src/api/auth 디렉토리에 NextAuth의 설정 파일이 있습니다.

별도로 설정 값을 바꿀 필요는 없이 token refresh, access token 등의 정보가 모두 세션에 담겨 있습니다.

  • session.user.studentNumber
  • session.user.uuid
  • session.accessToken

Server Component에서는 const session = await auth()로 인증정보를 가져올 수 있고, Client Component에서는 const { data: session } = useSession()으로 인증정보를 가져올 수 있습니다.

.env

기본적으로 제공되는 .env 파일은 localhost:3000으로 개발 서버를 열 때 사용 가능한 파일입니다.

이외에 두가지 환경변수가 추가로 필요합니다

  • NEXTAUTH_SECRET
  • IDP_CLIENT_SECRET

이 두가지 환경변수를 .env.local 파일에 작성하시면 버전 관리에 tracking 되지 않고 편하게 사용하실 수 있습니다.

NEXTAUTH_SECRETopenssl rand -base64 128과 같은 명령어로 생성한 랜덤한 문자열이면 되고, IDP_CLIENT_SECRET은 infisical에서 ziggle2023 client의 secret값을 받아오실 수 있습니다.

Install & Run

yarn berry를 사용하고 있습니다 - zero-install X - node-modules linker - `.yarnrc.yml` 파일 참고
yarn install
yarn dev

Misc

해당 프로젝트는 .gitattributes 파일에서 eol 설정을 lf로 하고 있습니다. 만약에 이미지 파일과 같은 바이너리 파일을 추가하는 경우에는, 해당 파일에 대해서 *.png binary와 같은 설정을 해주셔야 의도치 않은 결과를 막을 수 있습니다.

ziggle-fe's People

Contributors

2paperstar avatar dohyun-ko avatar parkjumyung avatar miroro2 avatar shimsuyeon avatar no-ikjun avatar enc2586 avatar siwonpada avatar yebeen23 avatar

Stargazers

이신혁 avatar Jetty avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ziggle-fe's Issues

[FEATURE] Add Login require toast

Description

로그인 필요한 페이지 접근 시 로그인이 필요하다는 toast를 표시합니다.

Todos

  • 로그인 필요 Toast 추가

ETC

No response

[FEATURE] 전체공지 페이지

Description

figma에 새로 추가된 전체 공지 페이지를 제작합니다

Todos

  • 전체 공지 페이지 제작

ETC

No response

[FEATURE] Add Detailed Notice Page

Description

공지 상세 페이지 추가하기
image

Todos

  • Build the page UI
  • Build Lazy-loading zabo component

BugFix

  • Box-shadow -> Border + Border-box
  • FilledArrowBtn.tsx -> Switch 문을 AnimatedBtn 안으로
  • tGP와 tMS를 직관적인 이름으로 바꾸기

Refactor

  • Animation 관련 컴포넌트 - 재사용 없으므로 줄이기
  • FilledArrow

ETC

무한스크롤 되는 컴포넌트는 어떻게 처리하여야 할지 감이 잡히지 않는데
일단 해당 컴포넌트도 이 페이지 개발하는 겸 같이 개발해보겠습니다

[FEATURE] fix notice writing and tag bug

Description

공지 작성 API 연결 불완전
태그 생성 api 작동하지 않음
추가로 보성이가 언급한 수정사항들 반영

Todos

  • 공지 작성 로직
  • 태그 생성 로직
  • 보성이가 말한 수정사항들 적용

ETC

No response

[FEATURE] Add sharing button

Description

notice detail 에 공유하기 기능 추가
클릭 시 제목 + 링크 복사

Todos

  • 공유하기 추가

ETC

No response

[FEATURE] mypage ui

Description

mypage ui

Todos

  • navBar
  • profile
  • article list1
  • article list2
  • footer
  • add detail

ETC

No response

[BUG] [UI] image zabo title text align

Description

title text align in image zabo component is center not left

How to reproduce (재현 불가능 한 경우 '재현 불가능'이라고 적어주세요)

  1. display image zabo component with long title (at least two lines)

ETC

No response

[FEATURE] Change the overall size of each components naturally

Description

전체적인 컴포넌트, 페이지 사이징을 통합하고 자연스럽게 보이도록 늘리거나 줄이는 작업을 진행
디렉터리 구조도 목업용 데이터를 따로 뺄 예정

Todos

  • Manipulate Size
  • Build Mocks

ETC

No response

[BUGFIX] FIx Various UI Bugs

Description

잡다한 UI 버그를 고친다.
마이페이지 에서 글 삭제 기능을 추가한다.
자기가 작성했거나 리마인드 표시한 모든 공지를 볼 수 있게 한다.

Todos

  • Banner Navigation
  • Banner에 공지 작성 링킹
  • ZaboCarousel에 내용 들어오지 않을 시 없다고 표시
  • TextZabo 가독성있게 만들기
  • TextZabo 미리보기 표시
  • ZaboCarousel에 표시되는 자보 수 제한 (10)
  • SearchResult 이상하게 나오는 버그 수정
  • 학사공지 게시판 링킹
  • 지스트 링크 변경

ETC

No response

[BUG] [UI] TextZabo with deadline results overlapped UI

Description

CleanShot 2023-08-28 at 18 52 12@2x

제목과 dday가 겹치는 문제가 발생합니다

How to reproduce (재현 불가능 한 경우 '재현 불가능'이라고 적어주세요)

  1. upload notice without image and with deadline

ETC

No response

[HOTFIX] Fix UI bug and Add Logout

Description

마이페이지에서 로그아웃, 회원탈퇴 UI가 깨짐
로그아웃, 회원탈퇴 기능이 없음
라우팅 수정

Todos

  • UI FIX
  • Add Logout, 회원탈퇴
  • 라우팅 수정

ETC

No response

[FEATURE] Mypage Responsive + Empty content Design

Description

마이페이지가 작은 view width에서도 제대로 보일 수 있도록 반응형 추가

image

테이블에 아무 데이터도 없을 때 아래같은 고양이 사진이 나타날 수 있도록 수정

image

고양이 asset은 Mypage 디렉토리에 LazyCat.tsx로 넣어놓음

Todos

  • Add Responsive View
  • Add Empty Content Design (LazyCat)

BugFix

  • p tag 중첩

ETC

No response

[BUG] D-day 표시 관련

Description

d-day 표시 이슈 관련

How to reproduce

  1. 마감일 1일 전
  • 미리보기에서: dday 표시 안뜸⭕
  • 상세페이지에서: D-day라고 뜸(하루 이미 지났음에도)❌
    image
    image
  1. 마감일 당일
  • 미리보기에서: dday 표시 안뜸❌
  • 상세페이지에서: D-day라고 뜸⭕
    image
    image

ETC

No response

[FEATURE] add meta tags

Description

html 파일에 정적으로 메타태그를 넣어서 SEO(검색 엔진 최적화)하기

Todos

  • add meta tags in index.html file

ETC

No response

[FEATURE] footer linking

Description

image
푸터의 각 아이템을 클릭했을 때 새로운 페이지가 뜨게끔 합니다.

Todos

  • github (organization으로)
  • appstore
  • playstore
  • introduce page
  • tos
  • privacy
  • support mail
  • other services (gist.ac.kr, giganpyo..?, gijol)

ETC

No response

[FEATURE] improve performance

Description

useIsMobile이 수십개의 event listener를 등록하는 문제, 마이 페이지의 useAuth 활용 문제를 해결

Todos

  • useIsMobile 해결
  • my page 해결

ETC

No response

[FEATURE] Add Navigations and connect APIs

Description

페이지간 네비게이션을 추가하고 API를 연결합니다.

Todos

  • 네비게이션 추가
  • Tag API 연결
  • Notice API 연결
  • Image API 연결

ETC

No response

[UI] input tag line height

CleanShot 2023-07-26 at 00 48 18@2x

input tag의 line height가 낮아서 baseline 밑으로 내려가는 글자는 아랫부분이 잘려 보입니다.

[BUG] tinymce editor doesn't appear in build environment

Description

tinymce 스크립트 파일이 개발 환경에서 바라보는 상대 경로로 잡혀있어서 빌드 환경에서는 tree-shaking에 의해 tinymce 파일이 제거 되게 되고 (아마?), 또한 경로가 모두 바뀌게 되기 때문에 에디터가 빌드시에는 보이지 않습니다.

How to reproduce (재현 불가능 한 경우 '재현 불가능'이라고 적어주세요)

  1. yarn build
  2. serve build output
  3. go to writing page (/notice/write)
  4. cannot see tinymce editor

ETC

No response

[BUG] can't see any page without authentication

Description

로그인 없이는 다른 페이지로 이동이 불가능합니다

How to reproduce (재현 불가능 한 경우 '재현 불가능'이라고 적어주세요)

  1. logout if logged in.
  2. navigate to any page not root(/)

ETC

No response

[FEATURE] Build Compositions

Description

Build these composition items (in below list)

Todos

  • 메인페이지에서 자보 묶는 것 + 좌우 스크롤 : ZaboCarousel
  • 검색 아이템 컴포넌트 (사진 있는 것) : SearchResult
  • 검색 아이템 컴포넌트 (사진 없는 것) : SearchResultText
  • Navbar
  • Footer
  • 공지글 테이블 컴포넌트 (학사 공지) : AcademicTable

ETC

Font "Noto Sans KR" is not working; ill try to fix it

[PAGE] search page UI

Description

make a search page UI

Todos

  • navBar
  • searchBar
  • searchTag
  • defaultImage
  • footer
  • pagecCloseButton

ETC

No response

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.