Skip to content

Commit

Permalink
Merge pull request #115 from boostcampwm-2022/dev
Browse files Browse the repository at this point in the history
3주차 릴리즈 v0.2
  • Loading branch information
qmdl980 authored Nov 24, 2022
2 parents 9530c23 + 74a8fe9 commit e7da5f7
Show file tree
Hide file tree
Showing 158 changed files with 4,002 additions and 559 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/fe-dev-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Frontend dev cd

on:
push:
branches: ['dev']
paths:
- 'packages/client/**'
- '.github/workflows/fe-dev-cd.yml'

jobs:
cd:
runs-on: ubuntu-latest
defaults:
run:
working-directory: './packages/client'

steps:
- name: checkout to the branch
uses: actions/checkout@v3

- name: node set-up
uses: actions/setup-node@v3
with:
node-version: 18.6.0

- name: Install dependencies
run: npm install

- name: Inject Environment Variables
env:
FE_ENV: ${{ secrets.FE_ENV }}
run: echo "$FE_ENV" > .env

- name: Build
run: npm run build
env:
CI: false

- name: Deploy to Remote Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_SSH_HOST }}
username: ${{ secrets.REMOTE_SSH_USERNAME }}
password: ${{ secrets.REMOTE_SSH_PASSWORD }}
port: ${{ secrets.REMOTE_SSH_PORT }}
source: 'packages/client/build/*'
target: '~/client/build'
strip_components: 3
36 changes: 36 additions & 0 deletions .github/workflows/fe-dev-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Frontend dev ci

on:
pull_request:
branches: [dev]
paths:
- 'packages/client'
# - 'packages/client/**'
# - '.github/workflows/fe-dev-ci.yml'

jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: './packages/client'

steps:
- name: checkout to the branch
uses: actions/checkout@v3

- name: node set-up
uses: actions/setup-node@v3
with:
node-version: 18.6.0

- name: Install dependencies
run: npm install

- name: Inject Environment Variables
env:
FE_ENV: ${{ secrets.FE_ENV }}
run: echo "$FE_ENV" > .env

- name: Test
run: npm run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ dist

node_modules
package-lock.json
build

*.sublime*

Expand Down
14 changes: 12 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
- ./packages/server/.prod.env
ports:
- 8080:8080
environment:
MYSQL_HOST: mysql
depends_on:
- mysql

Expand All @@ -24,8 +26,16 @@ services:
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
nginx:
container_name: 'nginx'
build: ./packages/nginx
ports:
- 3000:3000
volumes:
- ./packages/nginx/configs:/etc/nginx
- ./packages/client/build:/usr/share/buddah-client

volumes:
mysql-volume:
external:
name: mysql-volume
external: true
name: mysql-volume
2 changes: 2 additions & 0 deletions packages/client/craco.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
'pages': path.resolve(__dirname, 'src/pages/'),
'types': path.resolve(__dirname, 'src/types/'),
'utils': path.resolve(__dirname, 'src/utils/'),
'icons': path.resolve(__dirname, 'src/assets/icons/'),
},
},
// jest alias 추가
Expand All @@ -24,6 +25,7 @@ module.exports = {
'^pages/(.*)$': '<rootDir>/src/pages/$1',
'^types/(.*)$': '<rootDir>/src/types/$1',
'^utils/(.*)$': '<rootDir>/src/utils/$1',
'^icons/(.*)$': '<rootDir>/src/assets/icons/$1',
'^axios$': require.resolve('axios'),
},
},
Expand Down
1 change: 1 addition & 0 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.3",
"react-scripts": "5.0.1",
"recoil": "^0.7.6",
"typescript": "^4.8.4",
"web-vitals": "^2.1.4"
},
Expand Down
13 changes: 8 additions & 5 deletions packages/client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { BrowserRouter } from 'react-router-dom';
import { RecoilRoot } from 'recoil';
import Router from '@/Router';
import Layout from '@/Layout';

function App() {
return (
<div className="App">
<Layout>
<BrowserRouter>
<Router></Router>
</BrowserRouter>
</Layout>
<RecoilRoot>
<Layout>
<BrowserRouter>
<Router></Router>
</BrowserRouter>
</Layout>
</RecoilRoot>
</div>
);
}
Expand Down
17 changes: 11 additions & 6 deletions packages/client/src/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { Route, Routes } from 'react-router-dom';
import Signup from './pages/Signup';
import Signin from './pages/Signin';
import OrderList from './pages/customer/OrderList';

import Signup from 'pages/Signup';
import Signin from 'pages/Signin';
import OrderList from 'pages/customer/OrderList';
import MenuList from '@/pages/customer/MenuList';
import MenuDetail from 'pages/customer/MenuDetail';
import Cart from 'pages/customer/Cart';

function Router() {
return (
Expand All @@ -10,10 +14,11 @@ function Router() {
<Route path={'/signup'} element={<Signup />}></Route> {/* 회원가입 */}
<Route path={'/mypage'} element={<></>}></Route> {/* 마이페이지 */}
<Route path={'/home'} element={<OrderList />}></Route> {/* 고객 메인 */}
<Route path={'/menu'} element={<></>}></Route> {/* 고객 메뉴 목록 */}
<Route path={'/menu/:menuId'} element={<></>}></Route>{' '}
<Route path={'/menu'} element={<MenuList />}></Route>{' '}
{/* 고객 메뉴 목록 */}
<Route path={'/menu/:menuId'} element={<MenuDetail />}></Route>{' '}
{/* 고객 메뉴 상세 */}
<Route path={'/cart'} element={<></>}></Route> {/* 고객 장바구니 */}
<Route path={'/cart'} element={<Cart />}></Route> {/* 고객 장바구니 */}
{/* 업주 (전역 상태 관리로 고객과 함께 사용 가능) */}
<Route path={'/owner/home'} element={<></>}></Route>
<Route path={'/owner/order'} element={<></>}></Route>
Expand Down
3 changes: 3 additions & 0 deletions packages/client/src/assets/icons/cart.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/client/src/assets/icons/change.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/client/src/assets/icons/down_arrow.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/client/src/assets/icons/edit_nickname.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/client/src/assets/icons/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/client/src/assets/icons/left_arrow.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/client/src/assets/icons/logout.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/client/src/assets/icons/minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions packages/client/src/assets/icons/mypage.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/client/src/assets/icons/order.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/client/src/assets/icons/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/client/src/assets/icons/receipt.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/client/src/assets/icons/signout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e7da5f7

Please sign in to comment.