-
Notifications
You must be signed in to change notification settings - Fork 0
배포 v2 #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
배포 v2 #143
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Git | ||
| .git/ | ||
| .gitignore | ||
| .gitattributes | ||
|
|
||
| # Documentation | ||
| README.md | ||
| *.md | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Testing | ||
| coverage/ | ||
| .nyc_output/ | ||
|
|
||
| # Temporary files | ||
| *.tmp | ||
| *.temp | ||
| .cache/ | ||
|
|
||
| # Expo | ||
| .expo/ | ||
| .expo-shared/ | ||
| dist/ | ||
| web-build/ | ||
|
|
||
| # Build artifacts | ||
| build/ | ||
| *.apk | ||
| *.aab | ||
| *.ipa | ||
|
|
||
| # Environment files (keep .env.example if needed) | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
|
|
||
| # Misc | ||
| *.jks | ||
| *.p8 | ||
| *.p12 | ||
| *.key | ||
| *.mobileprovision | ||
| *.orig.* | ||
|
|
||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,17 +8,26 @@ | |
| "distribution": "internal", | ||
| "android": { | ||
| "buildType": "apk" | ||
| }, | ||
| "cache": { | ||
| "disabled": false | ||
| } | ||
| }, | ||
| "preview": { | ||
| "distribution": "internal", | ||
| "android": { | ||
| "buildType": "apk" | ||
| }, | ||
| "cache": { | ||
| "disabled": false | ||
| } | ||
| }, | ||
| "production": { | ||
| "android": { | ||
| "buildType": "app-bundle" | ||
| }, | ||
| "cache": { | ||
| "disabled": false | ||
| } | ||
| } | ||
| }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 제공된 코드 패치는 일부 섹션에 'cache' 키를 추가하고 'disabled' 속성을 false로 설정합니다. 다음과 같은 몇 가지 우려사항이 있습니다:
이러한 점을 고려하면, 중복 코드의 문제와 문서화 부족이 심각한 문제로 이어질 수 있으므로 개선이 필요합니다. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,17 +246,17 @@ const styles = StyleSheet.create({ | |
| justifyContent: "flex-end", | ||
| backgroundColor: "#F8F8F8", | ||
| borderRadius: 10, | ||
| paddingHorizontal: 12, | ||
| paddingVertical: 10, | ||
| paddingHorizontal: 8, | ||
| paddingVertical: 8, | ||
| borderWidth: 1, | ||
| borderColor: "#E0E0E0", | ||
| width: "100%", | ||
| }, | ||
| valueInput: { | ||
| fontSize: 16, | ||
| fontSize: 15, | ||
| fontWeight: "600", | ||
| textAlign: "right", | ||
| width: 50, | ||
| width: 40, | ||
| padding: 0, | ||
| color: "#000000", | ||
| }, | ||
|
|
@@ -267,11 +267,10 @@ const styles = StyleSheet.create({ | |
| color: "#4CAF50", | ||
| }, | ||
| unit: { | ||
| fontSize: 14, | ||
| fontSize: 13, | ||
| fontWeight: "600", | ||
| marginLeft: 6, | ||
| marginLeft: 4, | ||
| color: "#666666", | ||
| width: 24, | ||
| }, | ||
| textDefault: { | ||
| color: "#000000", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 다음은 코드 변경 사항에 대한 리뷰입니다:
결론적으로, 기능과 UI에 대한 영향을 충분히 검토한 후에야 이 변경사항을 머지하는 것이 바람직합니다. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -388,89 +388,7 @@ const LoginScreen = ({ navigation }: any) => { | |
| return; | ||
| } | ||
|
|
||
| // ✅ 방법 1: @react-native-seoul/kakao-login 사용 (네이티브 빌드에서만 작동) | ||
| if (KakaoLogin && typeof KakaoLogin.login === "function") { | ||
| try { | ||
| console.log("🔵 [카카오 로그인] 네이티브 모듈 사용"); | ||
| const token = await KakaoLogin.login(); | ||
| console.log("✅ [카카오 로그인] 토큰 받음:", token); | ||
|
|
||
| // 카카오 액세스 토큰을 백엔드로 전송하여 JWT 토큰 발급받기 | ||
| // 또는 카카오 프로필 정보를 가져와서 백엔드에 전송 | ||
| const profile = await KakaoLogin.getProfile(); | ||
| console.log("✅ [카카오 로그인] 프로필:", profile); | ||
|
|
||
| // 백엔드 API 호출 (카카오 ID로 로그인/회원가입) | ||
| console.log("🔵 [카카오 로그인] 백엔드 API 호출 시작"); | ||
| const res = await fetch( | ||
| "https://www.intelfits.com/api/auth/kakao/login", | ||
| { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify({ | ||
| kakaoAccessToken: token.accessToken, | ||
| kakaoId: profile.id, | ||
| nickname: profile.nickname, | ||
| profileImage: profile.profileImageUrl, | ||
| }), | ||
| } | ||
| ); | ||
|
|
||
| console.log("🔵 [카카오 로그인] 백엔드 응답 상태:", res.status); | ||
| const data = await res.json(); | ||
| console.log("🔵 [카카오 로그인] 백엔드 응답 데이터:", data); | ||
|
|
||
| if (!res.ok) { | ||
| console.error("❌ [카카오 로그인] 백엔드 응답 실패:", { | ||
| status: res.status, | ||
| statusText: res.statusText, | ||
| data: data, | ||
| }); | ||
| throw new Error( | ||
| data.message || `카카오 로그인에 실패했습니다 (${res.status})` | ||
| ); | ||
| } | ||
|
|
||
| // 토큰 저장 | ||
| if (data.accessToken) { | ||
| await AsyncStorage.setItem(ACCESS_TOKEN_KEY, data.accessToken); | ||
| } | ||
| if (data.refreshToken) { | ||
| await AsyncStorage.setItem(REFRESH_TOKEN_KEY, data.refreshToken); | ||
| } | ||
| if (data.userId) { | ||
| await AsyncStorage.setItem("userId", String(data.userId)); | ||
| } | ||
| if (data.membershipType) { | ||
| await AsyncStorage.setItem("membershipType", data.membershipType); | ||
| } else { | ||
| await AsyncStorage.setItem("membershipType", "FREE"); | ||
| } | ||
|
|
||
| // 온보딩 여부 확인 (isOnboarded 우선 확인) | ||
| const isOnboarded = | ||
| data.isOnboarded !== undefined ? data.isOnboarded : data.onboarded; | ||
| const shouldOnboard = isOnboarded === false; | ||
|
|
||
| // 신규 유저 확인 (온보딩이 완료된 경우에만) | ||
| const isNewUser = data.newUser === true; | ||
|
|
||
| if (shouldOnboard || isNewUser) { | ||
| navigation.replace("KakaoOnboarding"); | ||
| } else { | ||
| navigation.replace("Main"); | ||
| } | ||
| return; | ||
| } catch (nativeError: any) { | ||
| console.error("❌ [카카오 로그인] 네이티브 모듈 실패:", nativeError); | ||
| console.log( | ||
| "⚠️ [카카오 로그인] 네이티브 모듈 실패, WebBrowser 방식으로 전환:", | ||
| nativeError.message | ||
| ); | ||
| // 네이티브 모듈 실패 시 WebBrowser 방식으로 폴백 | ||
| setLoading(false); // 로딩 상태 해제 | ||
| } | ||
| } | ||
| // ✅ APK에서도 Web OAuth 방식만 사용하도록 네이티브 SDK 로그인은 비활성화 | ||
|
|
||
| // ✅ 방법 2: openAuthSessionAsync 사용 (Expo Go에서도 작동, 딥링크 리다이렉트 감지 가능) | ||
| const KAKAO_CLIENT_ID = "99baee411cc547822f138712b19b032c"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 코드는 카카오 로그인을 위한 함수에서 네이티브 SDK 사용을 제거하고 Web OAuth 방식으로만 전환하는 내용을 포함하고 있습니다. 몇 가지 우려 사항이 있습니다:
결론적으로, 이 코드는 개선의 여지가 있으며, 특히 사용자 경험, 보안 및 가독성을 위해 검토해야 할 사항이 있습니다. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4219,26 +4219,43 @@ const ExerciseScreen = ({ navigation }: any) => { | |
| <View | ||
| style={{ flexDirection: "row", alignItems: "center", gap: 8 }} | ||
| > | ||
| {hasIncompleteActivities && workoutActivities.length > 0 && ( | ||
| <TouchableOpacity | ||
| style={[ | ||
| styles.startWorkoutButton, | ||
| { backgroundColor: "#4a9eff", padding: 15 }, | ||
| ]} | ||
| onPress={() => { | ||
| handleStartWorkoutSequence(); | ||
| }} | ||
| > | ||
| <Text | ||
| {(() => { | ||
| // 선택된 날짜가 오늘인지 확인 | ||
| const today = new Date(); | ||
| today.setHours(0, 0, 0, 0); | ||
| const baseDate = selectedDate ? new Date(selectedDate) : today; | ||
| baseDate.setHours(0, 0, 0, 0); | ||
| const isToday = baseDate.getTime() === today.getTime(); | ||
|
|
||
| if ( | ||
| !isToday || | ||
| !hasIncompleteActivities || | ||
| workoutActivities.length === 0 | ||
| ) { | ||
| return null; | ||
| } | ||
|
|
||
| return ( | ||
| <TouchableOpacity | ||
| style={[ | ||
| styles.startWorkoutButtonText, | ||
| { color: "white", fontSize: 16 }, | ||
| styles.startWorkoutButton, | ||
| { backgroundColor: "#4a9eff", padding: 15 }, | ||
| ]} | ||
| onPress={() => { | ||
| handleStartWorkoutSequence(); | ||
| }} | ||
| > | ||
| 시작 | ||
| </Text> | ||
| </TouchableOpacity> | ||
| )} | ||
| <Text | ||
| style={[ | ||
| styles.startWorkoutButtonText, | ||
| { color: "white", fontSize: 16 }, | ||
| ]} | ||
| > | ||
| 시작 | ||
| </Text> | ||
| </TouchableOpacity> | ||
| ); | ||
| })()} | ||
| </View> | ||
| </View> | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 코드 리뷰 코멘트잠재적 버그 및 리스크
개선 제안
결론현재 코드에서 몇 가지 잠재적인 버그와 개선할 포인트가 있습니다. 위의 사항들을 반영하여 수정한 후 다시 검토하는 것이 좋겠습니다. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 리뷰 코멘트
버전 업데이트:
version을1.0.0에서2.0.0으로 올리는 것은 좋은 접근이지만, 변경 사항이 무엇인지에 대한 문서화가 필요합니다.기타 추가 설정:
config섹션에googleMaps와 관련된 빈apiKey가 추가되었습니다. 이는 사용하지 않으면 삭제하는 것이 좋습니다.apiKey가 나중에 필요할 경우, 적절한 곳에서 값을 설정할 수 있도록 주석이나 설명을 추가하면 좋습니다.중복 코드 최적화:
category배열이 있습니다. 이를 하나의 변수를 설정하여 재사용하면 코드가 더 간결해질 것입니다.추가 키 관리:
kakaoAppKey가extra에 있네요. 이 키는 비공식적으로 코드에 넣는 것보다 환경 변수나 안전한 외부 구성 파일에 저장하는 것이 좋습니다.소유자 업데이트:
owner값을 특정 ID로 변경했습니다. 이 변경이 시스템 운영에 실제 영향을 미치지 않는지 확인할 필요가 있습니다.결론