Skip to content

Commit 0242dbc

Browse files
authored
Update after demo (#55)
* feat: 스토리북 초기 설정 * chore: 로컬 환경 설정 gitignore에 추가 * feat: 디자인 토큰 tailwind 적용 설정 * feat: 스토리북 배포용 공용 컴포넌트 설정 * feat: tailwind설정에 postcss관련 설정 임시 복원 및 storybook 배포 설정 * feat: 스토리북 배포 관련 설정 추가 * feat: 디자인 시스템 스토리북 초기 및 테스트용 설정 * feat: 프리티어 및 린트 설치 및 설정 (임시) * style: 린트 및 프리티어로 인한 코드 스타일 변경 * feat: 디자인 시스템 스토리북 배포 설정 수정 포크한 레포에 작동 테스틀 위해 연결 스토리북 형태도 세팅함 * feat: token 변환 설정파일 수정 구조 수정 및 tailwind prefix에 맞게 mapping * docs: 디자인 시스템 관련 리드미 템플릿 수정 * feat: 디자인 시스템 패키지 배포 테스트 성공 * chore: tailwind/postcss 버전 복구 * feat: 스토리북 스타일 autodocs처리 * docs: 디자인 시스템 관련 문서들 정리(임시) * feat: 토큰 설정 및 스토리북 배포 설정 수정 * feat: 빌드 관련 tailwindcss/postcss 버전 수정 및 gitignore 포함 이전 패키지 버전에선 빌드가 안 됐음. * feat: ci linux환경에서의 스토리북 빌드 관련 패키지 설정 수정 * Merge branch 'design' into main * feat: 디자인 시스템 스토리북 예시 수정 * feat: zustand설치 * feat: 상현 개인 레포에서 스토리북 배포 동작하도록 수정 vercel 정책 상 prography계정의 레포는 organization이라 유료 플랜이라. * feat: deploy-storybook path에 자기자신 포함해, 변경 시 동작하도록 수정 * fix: deploy-storybook path경로 수정 마이너 수정이라 main에서 진행 * feat: Chromatic UI 테스팅 github action 실험 적용 * feat: chromatic 설치 * feat: chromatic ci 관련 yarn->npm으로 변경 * feat: chromatic 실험용 Test 컴폰너트 ui 변경 * feat: chromatic github action 패키지 버전 수정 * feat: chromatic ci 중단 옵션 수정 * feat: upstream PR에 대해 작동하도록 수정 * feat: 크로마틱 연동 테스트 * feat: 스토리북 plop통한 템플릿 생성 기능 추가 * docs: 스토리북 Intro 문서 수정 * feat: 크로마틱 연동 upstream에 적용하도록 수정 * docs: 스토리북 Intro 문구 수정 code형태 아니어야 했기에. * docs: 스토리북 intro 스타일 다듬기 * docs: 스토리북 버전 및 change log관련 문구 수정 * feat: 스토리북 배포 주소 추가 * docs: 스토리북 intro 문서 스타일 수정. 숫자 표기 안되는 문제로 인해. * docs: 프로젝트 README에 디자인시스템 배포 페이지 추가 * docs: 스토리북 Intro 스타일 수정 * docs: 프로젝트 README에 디자인시스템 배포 페이지 추가 * Trigger CI/CD for redeploy * Trigger CI/CD for storybook redeploy ci과정 트리거 위해 무의미한 스토리북 수정 * feat: 스토리북 배포 ci 관련 캐싱 삭제 및 cleanup 동작 추가 빌드 시 html생성이 될 때도 있고 안될 때도 있어서. CI에서는 캐싱 문제일 수 있다기에 수정 * Update README.md 참고 사진 및 영상 포함 * docs: 리드미 목록 관련 수정 * fix: 스토리북 배포 favicon 경로 수정 * feat: 모든 fetching에 대해 디바운스 처리 및 fetch 에러에 대해 toast동작 추가 * fix: 바텀시트로 인한 바텀태그 클릭 불능 방지 * feat: 바텀시트 전역 관리 제작 * feat: TodoBottomSheet 전역관리 맞게 수정 및 DetailBody에 적용 TodoBottomSheet를 바텀시트 내부 컨텐츠만 갖도록 수정 * feat: BottomSheetRenderer 히스토리 구조 적용 및 바텀시트 변경에 대해 리마운트 및 모바일 키보드 동작 * feat: 바텀시트 관련 훅 구조 히스토리로 변경 * feat: 바텀시트 훅 구조 변경에 따른 TodoBottomSheet 적용부분인 DetailBody, GoalCard수정 * feat: 바텀시트 훅 변경에 따른 TodoResultBottomSheet 수정 및 사용부 수정 ListCard에서 바텀시트 훅 사용하도록 수정 * feat: 바텀시트 훅 관련 ListCard 수정에서 타입 처리 * feat: 바텀시트 훅으로 인한 GoalDurationBottomSheet 관련 변경 GoalDurationBottomSheet 컴포넌트 변경 및 사용부분인 adding-goal페이지와 GoalEdit 변경 * feat: 메인 페이지 수정 * feat: 상세 페이지 ui 수정 및 ModalAddingTodo추가 * feat: GuestGroup 제작 게스트용 그룹 페이지 UI 제작 * feat: GuestGroup생성으로 인한 GroupChatItem 및 GroupChatRoom변경 채팅방과 width가 달라, GroupChatItem 너비 비율로 변경 및 기존 채팅장에도 이에 맞게 조정 * feat: 게스트 모드 진입과 탈출에서 상태 처리 isGuest상태를 통해 게스트모드 적용 * feat: 바텀시트 훅 추가에서 타입 에러 수정 * feat: 게스트 모드 위한 모킹 구조 제작 * feat: 게스트 모드 적용 httpClient에서 게스트모드에서도 format을 가져서 api 콜을 할 수 있도록 코드 수정 * feat: 빌드 에러 수정 * feat: 린트 에러 수정 * fix: DoneItemDetail 스토리북 관련 빌드 에러 수정 DoneItemDetail에서 useGoalDetail훅을 사용하는데, 이는 스토리북에서 사용하려면 따로 render에서 불러와야 함. 그러나 컴포넌트 내부에서 사용되지 않아 주석처리함. * feat: 스토리북(크로마틱) 빌드 에러 수정 * feat: 게스트모드 관련 마이페이시 처리 * feat: 목표 달성 관련 추가사항 반영 * feat: 상세페이지 TodoBottomSheet 제거 * fix: 목표 추가 버그 수정 새로고침 막고, mutate처리 및 뒤로가기 정상화 * fix: 목표 생성 후 todo가 없어도 목표 완성 모달 뜨는 버그 수정 todo 개수 0이 아닌 경우에 동작하도록 수정 * fix: 상세 페이지 남을 날짜 NaN(undefined경우)는 표기 안하도록 수정
1 parent dc4b7c7 commit 0242dbc

File tree

45 files changed

+3329
-712
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3329
-712
lines changed

.storybook/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const path = require("path");
44
const STORYBOOK_SCOPE = process.env.STORYBOOK_SCOPE;
55

66
const config = {
7+
managerHead: (head) => `
8+
${head}
9+
<link rel="icon" type="image/png" href="/app/icon.png" />
10+
`,
711
stories: [
812
"./Introduction.mdx",
913
"./CHANGELOG.mdx",
@@ -14,7 +18,7 @@ const config = {
1418
]
1519
: [
1620
"../components/**/*.stories.@(js|jsx|mjs|ts|tsx)",
17-
"../app/**/*.stories.@(js|jsx|mjs|ts|tsx)"
21+
"../app/**/*.stories.@(js|jsx|mjs|ts|tsx)",
1822
]),
1923
],
2024
addons: [

README.md

Lines changed: 229 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,246 @@
1-
# Motimo: FE
1+
<div align="center">
22

3-
## 임시 내용.. Token관련
3+
# 🚀 Motimo
44

5-
> 일단 수동으로 tailwind 토큰화한다.
5+
**목표를 효과적으로 달성하는 방법, 모티모**
66

7-
- upstream의 design 브랜치에 토큰 json이 업데이트 된다.
8-
- `npm run build-tokens`를 통해 app/tokens.css를 업데이트 한다
7+
<br/>
98

10-
## ✨ Motimo 프론트엔드 레포지토리에 오신 것을 환영합니다!
9+
<img width="394" height="567" alt="모티모 포스터" src="https://github.com/user-attachments/assets/d78bffcc-99cf-4367-8b54-71a82944eb20" />
1110

12-
> 디자인 시스템 배포 페이지
11+
[버그 신고](https://github.com/prography/10th-Motimo-FE/issues) · [기능 요청](https://github.com/prography/10th-Motimo-FE/issues)
1312

14-
<a href="10th-motimo-storybook.vercel.app">10th-motimo-storybook.vercel.app</a>
13+
**[데모 링크](https://motimo-fe-dev.netlify.app)**
14+
15+
</div>
16+
17+
<br/>
18+
19+
---
20+
21+
<br/>
22+
23+
## 📋 목차
24+
25+
- [📑 소개](#-소개)
26+
- [✨ 주요 기능](#-주요-기능)
27+
- [🛠️ 기술 스택](#️-기술-스택)
28+
- [⭐ 주요 페이지 동작](#-주요-페이지-동작)
29+
- [👥 팀](#-팀)
30+
- [🚀 Moiomo 디자인 시스템 둘러보기](#-motimo-디자인-시스템-둘러보기)
31+
- [🤝 기여하기](#-기여하기)
32+
- [📄 라이선스](#-라이선스)
33+
- [🙏 감사의 말](#-감사의-말)
34+
35+
<br/><br/>
36+
37+
## 📑 소개
38+
39+
<div>
40+
41+
- 혼자 꾸준히 지속하기 어려운 **기간이 긴 목표** 달성. 모티모에서 다른 사람들과 함께 동기부여를 주며 목표를 달성해보세요!
42+
- **그룹방**에서 여러 사람들이 투두를 달성하는 것을 보고 동기부여를 얻을 수 있어요!
43+
- 혼자가 아니라 함께하면 목표 달성률이 올라가요! 서로에게 동기부여를 주며 목표를 달성해봐요!
44+
</div>
45+
46+
<br/><br/>
47+
48+
## ✨ 주요 기능
49+
50+
#### 🌟 **중장기 목표 설정**
51+
52+
&nbsp; 목표 - 세부목표 - 투두 단계로 할 일을 세분화 할 수 있습니다.
53+
54+
#### 🔥 **기록 남기기**
55+
56+
&nbsp; 투두를 완료 후 감정과 사진 등 기록을 남겨 상세히 정리할 수 있습니다.
57+
58+
#### 💡 **그룹**
59+
60+
&nbsp; 그룹에 들어가 다른 사람들과 투두에 대해 상호작용하며 동기부여를 얻을 수 있습니다.
61+
62+
#### 🎯 **피드**
63+
64+
&nbsp; 보다 많은 사람들의 목표와 달성 과정을 확인하며 동기부여를 얻을 수 있습니다.
1565

16-
## 🚀 Motimo 프론트엔드의 핵심 목표
66+
<br/><br/>
1767

1868
## 🛠️ 기술 스택
1969

20-
## 🚧 현재 상태 및 기여
70+
<div align="center">
71+
72+
### Frontend
73+
74+
![React](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)
75+
![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)
76+
![Next.js](https://img.shields.io/badge/Next.js-000000?style=for-the-badge&logo=next.js&logoColor=white)
77+
![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-38B2AC?style=for-the-badge&logo=tailwind-css&logoColor=white)
78+
![SWR](https://img.shields.io/badge/SWR-000000?style=for-the-badge&logo=swr&logoColor=white)
79+
![Zustand](https://img.shields.io/badge/Zustand-443E38?style=for-the-badge&logo=zustand&logoColor=white)
80+
81+
### DevOps & Tools
82+
83+
![GitHub Actions](https://img.shields.io/badge/GitHub_Actions-2088FF?style=for-the-badge&logo=github-actions&logoColor=white)
84+
![Vercel](https://img.shields.io/badge/Vercel-000000?style=for-the-badge&logo=vercel&logoColor=white)
85+
![Chromatic](https://img.shields.io/badge/Chromatic-FC521F?style=for-the-badge&logo=chromatic&logoColor=white)
86+
![Netlify](https://img.shields.io/badge/Netlify-0BBFBC?style=for-the-badge&logo=netlify&logoColor=white)
87+
88+
</div>
89+
90+
<br/><br/>
91+
92+
## ⭐ 주요 페이지 동작
93+
94+
> ### 온보딩
95+
96+
- 회원가입 및 로그인
97+
- 목표 생성과정을 온보딩에 적용
98+
99+
[온보딩](https://github.com/user-attachments/assets/34f0ff79-a5f7-42ea-902d-c8d8deabb9de)
100+
101+
> ### 메인 페이지
102+
103+
- 목표 선택 및 세부 목표별 투두 작성
104+
- 투두 결과 제출
105+
- 투두 수정 및 삭제
106+
- 목표 추가
107+
108+
[메인페이지](https://github.com/user-attachments/assets/9901e0e8-49b8-4ece-83ff-5f5dfc25dfa0)
109+
110+
> ### 목표 상세 페이지
111+
112+
- 세부 목표 완료, 목표 달성 처리
113+
- 투두 결과 제출
114+
- 목표명, 기간, 세부 목표 위치와 이름 수정 및 삭제
115+
116+
[목표 상세 페이지](https://github.com/user-attachments/assets/8b9b888d-cc5d-4f27-b417-544165a8c1aa)
117+
118+
> ### 그룹 페이지
119+
120+
- 그룹 참여
121+
- 투두 완료, 결과 제출에 대한 리액션
122+
- 그룹 참여원 찌르기
123+
124+
[그룹페이지](https://github.com/user-attachments/assets/cc3c99a8-a7e9-4191-bd8d-ba7b2ae693e2)
21125

22-
### 시작하기
126+
> ### 마이 페이지
23127
24-
### 기여 방법
128+
- 개인정보 및 관심사 수정
129+
- 달성한 목표 확인
130+
- 알림 설정
131+
- 로그아웃
25132

26-
## 🔗 백엔드 레포지토리
133+
[마이페이지](https://github.com/user-attachments/assets/9d426c51-b341-40fc-a3c7-8d0ca14bf669)
27134

28-
## 📧 연락처
135+
<br/><br/>
136+
137+
## 👥 팀
138+
139+
<div align="center">
140+
141+
| 역할 | 이름 | GitHub |
142+
| :--------------------: | :----: | :--------------------------------------: |
143+
| **Frontend Developer** | 이상현 | [@Hys-Lee](https://github.com/Hys-Lee) |
144+
| **Frontend Developer** | 조형관 | [@devgony](https://github.com/devgony) |
145+
| **Backend Developer** | 고범석 | [@qjatjr29](https://github.com/qjatjr29) |
146+
| **Backend Developer** | 이종은 | [@jongeuni](https://github.com/jongeuni) |
147+
| **Project Owner** | 신동민 | - |
148+
| **Designer** | 전석희 | - |
149+
150+
</div>
151+
152+
> ### FE 역할 분담
153+
154+
#### 이상현
155+
156+
- UI
157+
- 페이지: 메인 페이지, 상세 페이지, 그룹 채팅방
158+
- 주요 공용 컴포넌트: 모달, 바텀시트
159+
- 기능
160+
- 모달, 바텀시트, 토스트 전역 커스텀 훅
161+
- 투두, 채팅 무한 스크롤
162+
- 개발
163+
- 스토리북 설정(plop.js) 및 공통 컴포넌트 디자인 시스템화(vercel), 패키지화.
164+
- 크로마틱 CI 적용
165+
- Figma 디자인 토큰 Tailwind 토큰화 (Token Studio, Style Dictionary)
166+
- 스테이징 배포 (netlify)
167+
168+
#### 조형관
169+
170+
- UI
171+
- 페이지: 온보딩, 마이 페이지, 그룹 페이지
172+
- 주요 공용 컴포넌트: 쿠퍼티노 피커, Lottie 로딩 애니메이션 컴포넌트
173+
- 기능
174+
- OAuth 로그인
175+
- 공통 api fetcher 제작
176+
- 개발
177+
- API 생성 (swagger-typescript-api)
178+
- Cursor 사용한 제작
179+
180+
<br/><br/>
181+
182+
## 🚀 Motimo 디자인 시스템 둘러보기
183+
184+
> ### **디자인 시스템 페이지**
185+
186+
<img width="1894" height="945" alt="image" src="https://github.com/user-attachments/assets/0154c0fc-1dcf-4f58-b415-591a75fd751e" />
187+
<a href="10th-motimo-storybook.vercel.app">10th-motimo-storybook.vercel.app</a>
188+
189+
<br/><br/>
190+
191+
> ### **Motimo 공통 컴포넌트 패키지**
192+
>
193+
> <img width="1476" height="937" alt="image" src="https://github.com/user-attachments/assets/ade5a4fc-e020-456a-bd8b-b3fc931cc3fe" />
194+
195+
<a href="https://www.npmjs.com/package/motimo-shared-ui">https://www.npmjs.com/package/motimo-shared-ui</a>
196+
197+
<br/><br/>
198+
199+
## 🤝 기여하기
200+
201+
### 🐛 버그 신고
202+
203+
버그를 발견하셨나요? [이슈](https://github.com/prography/10th-Motimo-FE/issues)를 생성해주세요!
204+
205+
### 💡 기능 제안
206+
207+
새로운 기능을 제안하고 싶으시다면 [토론](https://github.com/prography/10th-Motimo-FE/discussions)에서 의견을 나눠주세요!
208+
209+
<br/><br/>
210+
211+
<!-- ## 📊 통계
212+
213+
<div align="center">
214+
215+
![GitHub Stats](https://github-readme-stats.vercel.app/api?username=username&show_icons=true&theme=radical)
216+
217+
![Top Languages](https://github-readme-stats.vercel.app/api/top-langs/?username=username&layout=compact&theme=radical)
218+
219+
</div>
220+
221+
---
222+
-->
29223

30224
## 📄 라이선스
31225

32-
이 프로젝트는 [예: MIT License]에 따라 라이선스됩니다. 자세한 내용은 `LICENSE` 파일을 참조하세요.
226+
이 프로젝트는 **MIT License** 하에 배포됩니다. 자세한 내용은 [LICENSE](LICENSE) 파일을 참조하세요.
227+
228+
<br/><br/>
229+
230+
## 🙏 감사의 말
231+
232+
- [Vaul](https://github.com/emilkowalski/vaul) - 바텀 시트에 사용된 라이브러리
233+
- [Motion](https://github.com/motiondivision/motion) - 애니메이션에 사용된 라이브러리
234+
- [Contributors](https://github.com/prography/10th-Motimo-FE/contributors) - 모든 기여자분들께 감사드립니다
235+
- [Prography](https://prography.org/) - 활발한 개발 환경 지원
236+
- Motimo 팀원들과 Progarphy 10기 분들
237+
238+
<br/><br/>
239+
240+
<div align="center">
241+
242+
**⭐ 이 프로젝트가 도움이 되셨다면 스타를 눌러주세요! ⭐**
243+
244+
Made with ❤️
245+
246+
</div>

api/service.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Api, HttpClient } from "./generated/motimo/Api";
22
import useAuthStore from "../stores/useAuthStore";
3+
import useToastStore from "@/stores/useToastStore";
34

45
// HTTP 클라이언트 생성 시 인증 헤더를 자동으로 추가하는 securityWorker 설정
56
const httpClient = new HttpClient({
@@ -16,10 +17,52 @@ const httpClient = new HttpClient({
1617
};
1718
}
1819

20+
const isGuest = useAuthStore.getState().isGuest;
21+
if (isGuest) {
22+
return { format: "json" };
23+
}
24+
1925
return {};
2026
},
2127
});
2228

29+
// 비동기 에러 시 toast 띄우기
30+
const showToast = (content: string, createdAt: Date) => {
31+
useToastStore.getState().updateToastInfo({ content, createdAt });
32+
};
33+
34+
// Debouncer 감싸도 될 것 같은데?
35+
const debounceer = <T, E>(apiRequest: typeof httpClient.request<T, E>) => {
36+
const timeLimit = 1000;
37+
let timer: number;
38+
let rejectTimer: (reason?: any) => void;
39+
return (
40+
requestParams: Parameters<typeof httpClient.request<T, E>>[0],
41+
): ReturnType<typeof httpClient.request<T>> => {
42+
if (timer) {
43+
clearTimeout(timer);
44+
rejectTimer("debouncing");
45+
}
46+
const apiRes: Promise<T> = new Promise((resolve, reject) => {
47+
rejectTimer = reject;
48+
timer = Number(
49+
setTimeout(async () => {
50+
try {
51+
const res = apiRequest(requestParams);
52+
resolve(res);
53+
} catch (error) {
54+
console.error(error);
55+
showToast(`API ERROR`, new Date());
56+
}
57+
}, timeLimit),
58+
);
59+
});
60+
return apiRes;
61+
};
62+
};
63+
64+
httpClient.request = debounceer(httpClient.request);
65+
2366
// API 클라이언트 인스턴스 생성
2467
export const api = new Api(httpClient);
2568

0 commit comments

Comments
 (0)