Skip to content
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

dev fe -> dev merge #172

Merged
merged 72 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
fc0e7fb
dev-fe update (#129)
swkim12345 Nov 6, 2024
77c24b6
🚚 chore: prettier-plugin-tailwindcss 설치
baegyeong Nov 6, 2024
b42e6ff
✨ feat: typography 변수 설정
baegyeong Nov 6, 2024
a21ca29
✨ feat: light mode의 color system 추가
baegyeong Nov 6, 2024
fec1d0a
Feat/#133 - 디자인 시스템 설정 (#135)
xjfcnfw3 Nov 7, 2024
098caa5
✨ feat: 네비게이션 바에 필요한 이미지, SVG 추가
xjfcnfw3 Nov 10, 2024
ab4c749
✨ feat: 네비게이션 바 버튼 컴포넌트 구현
xjfcnfw3 Nov 10, 2024
d3b84b1
✨ feat: 네비게이션 바 컴포넌트 구현
xjfcnfw3 Nov 10, 2024
0120383
🚚 chore: svg를 컴포넌트처럼 불러올 수 있게 세팅
baegyeong Nov 10, 2024
19ebfed
✨ feat: button 컴포넌트 구현
baegyeong Nov 10, 2024
70cd969
✨ feat: 채팅 구역 컴포넌트와 text area 컴포넌트 구현
baegyeong Nov 10, 2024
652d14a
✨ feat: white color config에 추가
baegyeong Nov 10, 2024
c33dd16
✨ feat: 알림, 알림추가에 대한 기본적인 UI 구현
baegyeong Nov 10, 2024
cc4b597
✨ feat: 주식 상세 페이지 정보에 대한 UI 구현
baegyeong Nov 10, 2024
c1efb86
✨ feat: svg 크기, 클래스 이름을 설정할 수 있도록 변경
xjfcnfw3 Nov 10, 2024
c0a29f4
✨ feat: utility class를 @layer로 감싸서 우선순위 부여
baegyeong Nov 11, 2024
1ec07f6
🐛 fix: 반복되는 컴포넌트 추출, mock data 추가
baegyeong Nov 11, 2024
e8ead16
✨ feat: 주가정보 메뉴 constants로 정의
baegyeong Nov 11, 2024
386c58f
🐛 fix: 시맨틱 태그 사용 및 반복되는 클래스 줄이기
baegyeong Nov 11, 2024
bb5c778
🐛 fix: 알림과 알림추가 비율 변경
baegyeong Nov 11, 2024
be27b67
🐛 fix: 주식 상세 페이지 그리드 비율 변경
baegyeong Nov 11, 2024
d021ecf
Feat/#136 - 주식 상세 페이지 기본 UI를 구현한다. (#147)
baegyeong Nov 12, 2024
5df7a4c
Merge branch 'feature/nav' of https://github.com/boostcampwm-2024/web…
baegyeong Nov 12, 2024
13ef77d
🐛 fix: tailwind config 겹치는 white 속성 제거
baegyeong Nov 12, 2024
41c2434
🚚 chore: tsx가 아닌 svg 파일 재업로드
baegyeong Nov 12, 2024
2e92541
🐛 fix: 폴더 이동 및 svg import 변경
baegyeong Nov 12, 2024
921eefb
🚚 chore: 로고 캐릭터 사진명 변경
baegyeong Nov 12, 2024
bcda754
🚚 chore: 타이포 로고를 배경 없는 이미지로 변경
baegyeong Nov 12, 2024
7fffeb5
🐛 fix: svg fill, stroke 값을 current로 변경
baegyeong Nov 12, 2024
fdf03b4
✨ feat: 사이드바 UI 구현
baegyeong Nov 12, 2024
ff1bc4a
🚚 chore: 카멜케이스로 파일명 변경
baegyeong Nov 12, 2024
6da01cb
🚚 chore: react-router 설치
baegyeong Nov 12, 2024
990f152
✨ feat: sidebar를 포함한 전체 레이아웃 컴포넌트 구현
baegyeong Nov 12, 2024
2dd3da2
✨ feat: 홈, 마이페이지, 주식 상세 라우터 연결
baegyeong Nov 12, 2024
67ce08f
Feature/#153 - 사이드바 UI 구현 (#155)
xjfcnfw3 Nov 12, 2024
b1d3a97
🚚 chore: lightweight-charts 라이브러리 설치
baegyeong Nov 12, 2024
1dbf06c
✨ feat: 그래프 라이트,다크 모드에 따른 테마 타입 정의
baegyeong Nov 12, 2024
cb8cefc
✨ feat: 차트 생성, 리사이즈 하는 커스텀 훅 구현
baegyeong Nov 12, 2024
8f3af35
✨ feat: mock data 추가
baegyeong Nov 12, 2024
b21ebd4
✨ feat: 상세 주식 페이지에 그래프 배치
baegyeong Nov 12, 2024
15131ba
🐛 fix: 그래프 캔들 스틱 색상 변경
baegyeong Nov 13, 2024
f2f23c1
🐛 fix: 캔들 차트와 히스토그램을 극명하게 분리
baegyeong Nov 13, 2024
61d908d
🐛 fix: red, blue 연하게 변경 및 colorConfig로 할당
baegyeong Nov 13, 2024
8500a2f
✨ feat: 히스토그램에서 이전 값과 비교하여 색상 설정
baegyeong Nov 13, 2024
87c4a94
🐛 fix: volume color 설정 삭제
baegyeong Nov 13, 2024
46e6a5c
🐛 fix: scaleMargins 범위 변경
baegyeong Nov 13, 2024
bbb2f8f
Feat/#127 - 차트 UI 구현 (#151)
baegyeong Nov 13, 2024
4101fe4
✨ feat: tooltip 컴포넌트 구현
baegyeong Nov 13, 2024
9d3536b
✨ feat: metric 관련 정보 객체를 새로 정의
baegyeong Nov 13, 2024
b4a1523
✨ feat: metric 정보에 hover 됐을 때 message 출력되도록 구조 변경
baegyeong Nov 13, 2024
948fee3
Feature/#160 - tooltip 컴포넌트 구현 (#161)
baegyeong Nov 14, 2024
609494d
🚚 chore: 스토리북 설치
baegyeong Nov 14, 2024
27f3611
🚚 chore: button, tooltip 컴포넌트 폴더 생성
baegyeong Nov 14, 2024
950adcc
✨ feat: button, tooltip 스토리북 코드 작성
baegyeong Nov 14, 2024
bb213a0
📦️ ci: storybook 배포 코드 작성
baegyeong Nov 14, 2024
ef72fd0
🚚 chore: favicon 아이콘 추가
baegyeong Nov 14, 2024
7a4fb9a
Feature/#165 - favicon 아이콘 추가 (#166)
xjfcnfw3 Nov 14, 2024
d19b4e7
Feature/#162 - 스토리북 설정 (#164)
baegyeong Nov 14, 2024
eaac39f
📦️ ci: yarn 명령어 변경
baegyeong Nov 14, 2024
1301ded
📦️ ci: build 명령어 변경
baegyeong Nov 14, 2024
1c4854d
🐛 fix: tailwind config 파일을 불러오지 못하는 문제 해결
baegyeong Nov 14, 2024
577a8b2
🐛 fix: 기본 레이아웃 css 변경
baegyeong Nov 14, 2024
9bbec33
✨ feat: trading chart 기본 테마 변경
baegyeong Nov 14, 2024
9495552
📦️ ci: build 테스트 위해 pr 시 돌아가도록 설정
baegyeong Nov 14, 2024
a5a0430
📦️ ci: build 폴더명 수정 -\> dist
baegyeong Nov 14, 2024
43f1461
📦️ ci: frontend deploy workflow 추가
baegyeong Nov 14, 2024
8363414
📦️ ci: workflow의 build dir 수정
baegyeong Nov 14, 2024
c24982c
📦️ ci: github pages 메인에 storybook을 배포하도록 수정
baegyeong Nov 14, 2024
2b98d57
📦️ ci: pr 날릴 때 workflow 돌아가는 코드 삭제
baegyeong Nov 14, 2024
74f4f92
Bug/#168 - 스토리북 빌드되지 않는 문제 수정 (#169)
baegyeong Nov 14, 2024
2339e5f
📦️ ci: dockerfile 추가
baegyeong Nov 14, 2024
b3ff70d
📦️ ci: docker image 경로 수정
baegyeong Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/deploy-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Deploy Frontend in Monorepo

on:
push:
branches:
- dev-fe

jobs:
build-and-deploy:
runs-on: ubuntu-latest

services:
docker:
image: docker:20.10.7
options: --privileged

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache Yarn dependencies
uses: actions/cache@v3
with:
path: |
**/node_modules
~/.yarn-cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build frontend
run: |
yarn workspace frontend build

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push frontend Docker image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/frontend:latest -f packages/frontend/Dockerfile .
docker push ${{ secrets.DOCKER_USERNAME }}/frontend:latest

- name: Deploy to server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY}}
port: ${{ secrets.SERVER_PORT }}
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/frontend:latest
docker-compose down
docker-compose up -d
53 changes: 53 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: storybook deploy

on:
push:
branches: ['dev-fe']

workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

steps:
- name: Use repository source
uses: actions/checkout@v3

- name: Use node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Cache node_modules
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: yarn install
if: steps.cache.outputs.cache-hit != 'true'

- name: Set PUBLIC_URL
run: |
PUBLIC_URL=$(echo $GITHUB_REPOSITORY | sed -r 's/^.+\/(.+)$/\/\1\//')
echo PUBLIC_URL=$PUBLIC_URL > .env

- name: Build storybook
run: |
yarn client build-storybook

- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/frontend/storybook-static
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"printWidth": 80,
"bracketSpacing": true,
"endOfLine": "lf",
"useTabs": false
"useTabs": false,
"plugins": ["prettier-plugin-tailwindcss"]
}
2 changes: 2 additions & 0 deletions packages/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?

*storybook.log
28 changes: 28 additions & 0 deletions packages/frontend/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { StorybookConfig } from '@storybook/react-vite';

import { join, dirname } from 'path';

/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value: string) {
return dirname(require.resolve(join(value, 'package.json')));
}
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
getAbsolutePath('@storybook/addon-onboarding'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@chromatic-com/storybook'),
getAbsolutePath('@storybook/addon-interactions'),
],
framework: {
name: getAbsolutePath('@storybook/react-vite'),
options: {},
},
core: {
builder: getAbsolutePath('@storybook/builder-vite'),
},
};
export default config;
11 changes: 11 additions & 0 deletions packages/frontend/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '@/index.css';

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};
11 changes: 11 additions & 0 deletions packages/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:20-alpine AS builder
WORKDIR /packages
COPY . .
RUN yarn install --frozen-lockfile
RUN yarn workspace frontend build

# Nginx 서버로 빌드된 파일 서빙
FROM nginx:alpine
COPY --from=builder /packages/packages/frontend/dist /usr/share/nginx/html
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]
2 changes: 1 addition & 1 deletion packages/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="ko">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>주춤주춤</title>
</head>
Expand Down
31 changes: 28 additions & 3 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,31 @@
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@tanstack/react-query": "^5.59.19",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"lightweight-charts": "^4.2.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"react-router-dom": "^6.28.0",
"tailwind-merge": "^2.5.4"
},
"devDependencies": {
"@chromatic-com/storybook": "3.2.2",
"@eslint/js": "^9.13.0",
"@storybook/addon-essentials": "8.4.3",
"@storybook/addon-interactions": "8.4.3",
"@storybook/addon-onboarding": "8.4.3",
"@storybook/blocks": "8.4.3",
"@storybook/builder-vite": "^8.4.3",
"@storybook/react": "8.4.3",
"@storybook/react-vite": "8.4.3",
"@storybook/test": "8.4.3",
"@types/node": "^22.8.7",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
Expand All @@ -25,11 +41,20 @@
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-storybook": "^0.11.0",
"globals": "^15.11.0",
"postcss": "^8.4.47",
"prettier-plugin-tailwindcss": "^0.6.8",
"storybook": "8.4.3",
"tailwindcss": "^3.4.14",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10"
"vite": "^5.4.10",
"vite-plugin-svgr": "^4.3.0"
},
"eslintConfig": {
"extends": [
"plugin:storybook/recommended"
]
}
}
Binary file added packages/frontend/public/favicon.ico
Binary file not shown.
Binary file added packages/frontend/public/logoCharacter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/frontend/public/logoTitle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion packages/frontend/public/vite.svg

This file was deleted.

24 changes: 8 additions & 16 deletions packages/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
import { useState } from 'react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { RouterProvider } from 'react-router-dom';
import { router } from './routes';

const App = () => {
const [count, setCount] = useState(0);
const queryClient = new QueryClient();

return (
<>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
</>
<QueryClientProvider client={queryClient}>
<RouterProvider router={router} />
{/* TODO:react query devtools 설치 */}
</QueryClientProvider>
);
};

Expand Down
4 changes: 4 additions & 0 deletions packages/frontend/src/assets/bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/frontend/src/assets/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/frontend/src/assets/plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/frontend/src/assets/search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/frontend/src/assets/send.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/frontend/src/assets/stock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/frontend/src/assets/theme.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/frontend/src/assets/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions packages/frontend/src/components/layouts/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Outlet } from 'react-router-dom';
import { Sidebar } from './Sidebar';

export const Layout = () => {
return (
<div className="flex">
<Sidebar />
<main className="ml-20 flex-1 px-48 py-16">
<Outlet />
</main>
</div>
);
};
59 changes: 59 additions & 0 deletions packages/frontend/src/components/layouts/MenuList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { type ReactNode } from 'react';
import { useNavigate } from 'react-router-dom';
import { type MenuItemData } from '@/constants/menuItems';
import { cn } from '@/utils/cn';

interface MenuListProps {
items: MenuItemData[];
isHovered: boolean;
}

interface MenuItemProps {
icon: ReactNode;
text: string;
isHovered: boolean;
onClick?: () => void;
}

export const MenuList = ({ items, isHovered }: MenuListProps) => {
const navigate = useNavigate();

return (
<ul className="flex flex-col justify-center gap-7">
{items.map((menu) => {
const { id, icon, text, url } = menu;
return (
<MenuItem
key={id}
icon={icon}
text={text}
isHovered={isHovered}
onClick={() => url && navigate(url)}
/>
);
})}
</ul>
);
};

const MenuItem = ({ icon, text, onClick, isHovered }: MenuItemProps) => {
return (
<li className="group flex items-center gap-10" onClick={onClick}>
<button
type="button"
className="fill-gray group-hover:fill-orange group-hover:stroke-orange stroke-gray transition-colors"
>
{icon}
</button>
<p
className={cn(
'text-gray display-medium16 whitespace-nowrap',
'group-hover:text-orange transition-all group-hover:font-bold',
isHovered ? 'display' : 'hidden',
)}
>
{text}
</p>
</li>
);
};
Loading
Loading