Skip to content

Commit 88aca02

Browse files
authored
Merge pull request #247 from boostcampwm-2024/dev-fe
[MERGE] dev-fe -> dev 로 병합
2 parents 7dc2428 + e32bfe5 commit 88aca02

File tree

163 files changed

+6170
-14675
lines changed

Some content is hidden

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

163 files changed

+6170
-14675
lines changed

.github/workflows/prod-fe-docker.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- prod-fe
7+
8+
jobs:
9+
build:
10+
name: Build, Test, and Push Docker Image
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '20'
21+
22+
- name: Install dependencies with Yarn
23+
run: yarn install
24+
25+
- name: Build only backend package with Yarn
26+
run: yarn build:fe
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v2
30+
31+
- name: Log in to Docker Hub
32+
uses: docker/login-action@v2
33+
with:
34+
username: ${{ secrets.DOCKER_USERNAME }}
35+
password: ${{ secrets.DOCKER_PASSWORD }}
36+
37+
- name: Build and push Docker image
38+
run: |
39+
docker compose -f fe.build.yaml build --no-cache
40+
docker compose -f fe.build.yaml push
41+
env:
42+
DOCKER_BUILDKIT: 1
43+
44+
- name: Execute deployment script on remote server
45+
env:
46+
SSH_PEM_KEY: ${{ secrets.SSH_PEM_KEY }}
47+
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
48+
SSH_PORT: ${{ secrets.SSH_PORT }}
49+
50+
run: |
51+
mkdir -p ~/.ssh
52+
echo "$SSH_PEM_KEY" > ~/.ssh/SSH_PEM_KEY.pem
53+
chmod 600 ~/.ssh/SSH_PEM_KEY.pem
54+
ssh -p $SSH_PORT -i ~/.ssh/SSH_PEM_KEY.pem -o StrictHostKeyChecking=no [email protected] 'cd prod && bash prod_fe.sh'
55+
56+

fe.build.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# docker-compose.yml
2+
version: '3.8'
3+
4+
services:
5+
nginx:
6+
build:
7+
context: nginx
8+
dockerfile: dockerfile
9+
image: liboost/nginx:latest
10+
ports:
11+
- "80:80"
12+
- "443:443"
13+
- "8000:8000"
14+
- "1935:1935"

frontend/eslint.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ export default tseslint.config({ ignores: ['.*'] }, js.configs.recommended, ...t
3636
],
3737
'react/react-in-jsx-scope': 'off',
3838
eqeqeq: ['error', 'always'],
39-
indent: ['error', 2],
39+
indent: ['error', 2, { SwitchCase: 1 }],
4040
quotes: ['error', 'single'],
4141
semi: ['error', 'always'],
42-
'@typescript-eslint/no-unused-vars': ['error']
42+
'@typescript-eslint/no-unused-vars': ['error'],
43+
'@typescript-eslint/no-explicit-any': 'off',
44+
'react/prop-types': 'off'
4345
},
4446
settings: {
4547
...reactRecommended.settings

frontend/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html lang="ko">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/svg+xml" href="/pabicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>LiBoo 🚀</title>
88
</head>

frontend/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@
2020
"@vitejs/plugin-react": "^4.3.3",
2121
"axios": "^1.7.7",
2222
"eslint-plugin-react": "^7.37.2",
23+
"framer-motion": "^11.11.17",
2324
"hls.js": "^1.5.17",
25+
"lucide-react": "^0.461.0",
2426
"nanoid": "^5.0.8",
2527
"react": "^18.3.1",
28+
"react-content-loader": "^7.0.2",
2629
"react-dom": "^18.3.1",
30+
"react-error-boundary": "^4.1.2",
31+
"react-hook-form": "^7.53.2",
2732
"react-router-dom": "^6.27.0",
33+
"socket.io-client": "^4.8.1",
2834
"styled-components": "^6.1.13",
35+
"ts-pattern": "^5.5.0",
2936
"vite": "^5.4.10",
3037
"vite-plugin-svgr": "^4.3.0",
3138
"vite-tsconfig-paths": "^5.1.0"

frontend/public/pabicon.ico

211 KB
Binary file not shown.

frontend/src/App.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
22
import { ThemeProvider } from 'styled-components';
3-
43
import { theme } from './styles/theme';
54
import { MainPage, ClientPage, HostPage } from './pages';
65
import { QueryClientProvider } from '@tanstack/react-query';
76
import { queryClient } from '@apis/index';
7+
import withUserId from '@hocs/withUserId';
8+
import ReplayPage from '@pages/ReplayPage';
89

9-
function App() {
10+
function AppComponent() {
1011
return (
1112
<QueryClientProvider client={queryClient}>
1213
<ThemeProvider theme={theme}>
13-
<Router>
14+
<Router
15+
future={{
16+
v7_startTransition: true,
17+
v7_relativeSplatPath: true
18+
}}
19+
>
1420
<Routes>
1521
<Route path="/" element={<MainPage />} />
16-
1722
<Route path="/live" element={<ClientPage />} />
1823
<Route path="/live/:id" element={<ClientPage />} />
19-
24+
<Route path="/replay" element={<ReplayPage />} />
25+
<Route path="/replay/:id" element={<ReplayPage />} />
2026
<Route path="/host" element={<HostPage />} />
2127
<Route path="/host/:id" element={<HostPage />} />
2228
</Routes>
@@ -26,4 +32,6 @@ function App() {
2632
);
2733
}
2834

35+
const App = withUserId(AppComponent);
36+
2937
export default App;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { fetchInstance } from '.';
2+
3+
export type BroadcastStatusResponse = {
4+
state: boolean;
5+
};
6+
7+
export const fetchBroadcastStatus = async (sessionKey: string): Promise<BroadcastStatusResponse> => {
8+
const response = await fetchInstance().get<BroadcastStatusResponse>('/host/state', {
9+
params: {
10+
sessionKey
11+
}
12+
});
13+
14+
return {
15+
state: response.data.state
16+
};
17+
};

frontend/src/apis/fetchLive.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { AxiosResponse } from 'axios';
2+
import { fetchInstance } from '.';
3+
import { ClientLive } from '@type/live';
4+
5+
type ClientLiveResponse = {
6+
info: ClientLive;
7+
};
8+
9+
export const fetchLive = async ({ liveId }: { liveId: string }): Promise<ClientLive> => {
10+
const response: AxiosResponse<ClientLiveResponse> = await fetchInstance().get('/streams/live', {
11+
params: {
12+
liveId
13+
}
14+
});
15+
16+
return response.data.info;
17+
};

frontend/src/apis/fetchMainLive.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { AxiosResponse } from 'axios';
2+
import { fetchInstance } from '.';
3+
import { MainLive } from '@type/live';
4+
5+
type MainLiveResponse = {
6+
info: MainLive[];
7+
};
8+
9+
export const fetchMainLive = async (): Promise<MainLive[]> => {
10+
const response: AxiosResponse<MainLiveResponse> = await fetchInstance().get('/streams/random');
11+
12+
return response.data.info;
13+
};

0 commit comments

Comments
 (0)