Skip to content

Commit 47fc56a

Browse files
authored
Merge pull request #5 from DguFarmSystem/feat/#4
Feat: 파밍로그 회원 가입 로직 구현 (ui 제외)
2 parents 47852c8 + 3da10c3 commit 47fc56a

22 files changed

+369
-101
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!doctype html>
22
<html lang="en">
33
<head>
4+
<script src="https://developers.kakao.com/sdk/js/kakao.js"></script>
45
<meta charset="UTF-8" />
56
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
67
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

package-lock.json

Lines changed: 37 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@tanstack/react-query": "^5.66.9",
13+
"@react-oauth/google": "^0.12.1",
14+
"@tanstack/react-query": "^5.66.11",
1415
"axios": "^1.7.9",
16+
"js-cookie": "^3.0.5",
1517
"react": "^19.0.0",
1618
"react-dom": "^19.0.0",
1719
"react-router-dom": "^7.2.0",
1820
"zustand": "^5.0.3"
1921
},
2022
"devDependencies": {
2123
"@eslint/js": "^9.19.0",
24+
"@types/js-cookie": "^3.0.6",
2225
"@types/react": "^19.0.8",
2326
"@types/react-dom": "^19.0.3",
2427
"@vitejs/plugin-react": "^4.3.4",

src/Router.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import React from 'react';
21
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
32
import MainPage from './pages/Main/MainPage';
43
import LoginPage from './pages/Login/LoginPage';
5-
import RegisterPage from'./pages/Register/RegisterPage';
4+
import RegisterPage from './pages/Register/RegisterPage';
5+
import AuthCallback from './pages/Auth/AuthCallback';
6+
import ApplyListPage from './pages/Admin/ApplyListPage';
67

78
const AppRouter = () => {
89
return (
@@ -11,6 +12,8 @@ const AppRouter = () => {
1112
<Route path="/" element={<MainPage />} />
1213
<Route path="/login" element={<LoginPage />} />
1314
<Route path="/register" element={<RegisterPage />} />
15+
<Route path="/api/auth/login" element={<AuthCallback />} />
16+
<Route path="/applylist" element={<ApplyListPage />} />
1417
</Routes>
1518
</Router>
1619
);

src/components/ExampleComponent.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/components/SocialLogin.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { useSocialLogin } from "../hooks/useSocialLogin";
2+
3+
const SocialLogin = () => {
4+
const { handleLogin } = useSocialLogin();
5+
6+
return (
7+
<div>
8+
<button onClick={() => handleLogin("KAKAO")}>카카오 로그인</button>
9+
<button onClick={() => handleLogin("GOOGLE")}>구글 로그인</button>
10+
</div>
11+
);
12+
};
13+
14+
export default SocialLogin;

src/config/apiConfig.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import axios from 'axios';
2+
3+
const getApiBaseUrl = () => {
4+
const baseUrl = import.meta.env.VITE_BASE_DEV_URL; // 개발 서버 URL
5+
6+
// URL이 '/'로 끝나면 'api/', 아니면 '/api/'
7+
return baseUrl.endsWith('/') ? `${baseUrl}api/` : `${baseUrl}/api/`;
8+
};
9+
10+
const API_BASE_URL = getApiBaseUrl();
11+
12+
const apiConfig = axios.create({
13+
baseURL: API_BASE_URL,
14+
timeout: 5000, // 요청 타임아웃 5초
15+
headers: {
16+
'Content-Type': 'application/json',
17+
},
18+
});
19+
20+
export default apiConfig;

src/config/axiosConfig.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/config/queryClient.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { QueryClient } from "@tanstack/react-query";
2+
3+
export const queryClient = new QueryClient({
4+
defaultOptions: {
5+
queries: {
6+
retry: 1, // 기본적으로 모든 요청을 한 번만 재시도
7+
refetchOnWindowFocus: false, // 창을 다시 활성화할 때 재요청 방지
8+
},
9+
},
10+
});

src/hooks/useExampleData.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)