Skip to content

Commit

Permalink
Merge pull request #246 from boostcampwm-2024/frontend
Browse files Browse the repository at this point in the history
ํ”„๋ก ํŠธ์—”๋“œ 4์ฃผ์ฐจ ๋ฐฐํฌ ์ฝ”๋“œ
  • Loading branch information
happyhyep authored Nov 21, 2024
2 parents 7c58107 + 66099e0 commit 3f00ff0
Show file tree
Hide file tree
Showing 96 changed files with 3,320 additions and 1,103 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/auto-assign-reviewers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Auto Assign Reviewers'

on:
pull_request:
types: [opened, labeled]
types: [opened]

jobs:
assign_reviewers:
Expand Down Expand Up @@ -43,12 +43,13 @@ jobs:
with:
script: |
const targetBranch = context.payload.pull_request.base.ref;
const reviewers = targetBranch === 'main' ? 3 : 2;
core.setOutput('number_of_reviewers', reviewers);
const reviewers = (targetBranch === 'main' || targetBranch === 'development') ? 3 : 2;
return { number_of_reviewers: reviewers };
- name: 'Assign Reviewers'
uses: kentaro-m/[email protected]
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
configuration-path: '.github/auto_assign_config.yml'
numberOfReviewers: ${{ steps.determine_reviewers.outputs.number_of_reviewers }}

69 changes: 0 additions & 69 deletions .github/workflows/auto-merge.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
## ๐Ÿ— ๋งํฌ ์•ˆ๋‚ด

<p>
<a href="https://www.notion.so/127b1b2b649180e88f70d6a4648924a0?pvs=4">ํŒ€ ๋…ธ์…˜</a> |
<a href="https://ddara-docs.vercel.app/">ํŒ€ ์œ„ํ‚ค</a> |
<a href="https://www.notion.so/127b1b2b649180e88f70d6a4648924a0?pvs=4">ํŒ€ ๋…ธ์…˜</a> |
<a href="https://www.figma.com/design/r9nl4Jcz9VXIMbrpf50wY6/PickMeUp?node-id=90-1897">๊ธฐํš์„œ</a> |
<a href="https://www.figma.com/design/r9nl4Jcz9VXIMbrpf50wY6/PickMeUp?node-id=87-929">๋””์ž์ธ</a>
<!-- <br />
Expand Down
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ export default [
'no-underscore-dangle': 'warn',
'no-undef': 'off',
'arrow-body-style': 'off',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
},
},

Expand Down
6 changes: 3 additions & 3 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!doctype html>
<html lang="en">
<html lang="ko">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" href="/assets/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>์„ ๋”ฐ๋ผ ๊ธธ๋”ฐ๋ผ - DDara</title>
</head>
<body>
<div id="root"></div>
Expand Down
134 changes: 67 additions & 67 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
{
"name": "ddara-frontend",
"private": true,
"workspaces": [
"frontend",
"backend"
],
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage",
"lint": "pnpm lint-staged",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@fontsource/pretendard": "^5.1.0",
"axios": "^1.7.7",
"lz-string": "^1.5.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-router-dom": "^6.28.0",
"uuid": "^11.0.3"
},
"devDependencies": {
"@chromatic-com/storybook": "^3.2.2",
"@eslint/js": "^9.13.0",
"@storybook/addon-essentials": "^8.4.2",
"@storybook/addon-interactions": "^8.4.2",
"@storybook/addon-onboarding": "^8.4.2",
"@storybook/blocks": "^8.4.2",
"@storybook/react": "^8.4.2",
"@storybook/react-vite": "^8.4.2",
"@storybook/test": "^8.4.2",
"@types/navermaps": "^3.7.8",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.20",
"classnames": "^2.5.1",
"eslint": "^9.13.0",
"eslint-import-resolver-typescript": "^3.6.3",
"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",
"storybook": "^8.4.2",
"tailwindcss": "^3.4.14",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10",
"vite-tsconfig-paths": "^5.1.1"
},
"eslintConfig": {
"extends": [
"plugin:storybook/recommended"
]
}
}
{
"name": "ddara-frontend",
"private": true,
"workspaces": [
"frontend",
"backend"
],
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage",
"lint": "pnpm lint-staged",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@fontsource/pretendard": "^5.1.0",
"axios": "^1.7.7",
"lz-string": "^1.5.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-router-dom": "^6.28.0",
"uuid": "^11.0.3"
},
"devDependencies": {
"@chromatic-com/storybook": "^3.2.2",
"@eslint/js": "^9.13.0",
"@storybook/addon-essentials": "^8.4.2",
"@storybook/addon-interactions": "^8.4.2",
"@storybook/addon-onboarding": "^8.4.2",
"@storybook/blocks": "^8.4.2",
"@storybook/react": "^8.4.2",
"@storybook/react-vite": "^8.4.2",
"@storybook/test": "^8.4.2",
"@types/navermaps": "^3.7.8",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.20",
"classnames": "^2.5.1",
"eslint": "^9.13.0",
"eslint-import-resolver-typescript": "^3.6.3",
"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",
"storybook": "^8.4.2",
"tailwindcss": "^3.4.14",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10",
"vite-tsconfig-paths": "^5.1.1"
},
"eslintConfig": {
"extends": [
"plugin:storybook/recommended"
]
}
}
9 changes: 9 additions & 0 deletions frontend/public/assets/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions frontend/src/api/auth.api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { getApiClient } from '@/api/client.api.ts';
import { ResponseDto } from '@/api/dto/response.dto.ts';
import { LoginResEntity, RegisterResEntity } from '@/api/dto/auth.dto.ts';

export const doLogin = (id: string, password: string): Promise<ResponseDto<LoginResEntity>> => {
const promiseFn = (
fnResolve: (value: ResponseDto<LoginResEntity>) => void,
fnReject: (reason?: any) => void,
) => {
const apiClient = getApiClient();
apiClient
.post('/auth/login', { id, password })
.then(res => {
if (res.status !== 200) {
console.error(res);
fnReject(`msg.${res}`);
} else {
fnResolve(new ResponseDto<LoginResEntity>(res));
}
})
.catch(err => {
console.error(err);
fnReject('msg.RESULT_FAILED');
});
};
return new Promise(promiseFn);
};

export const doRegister = (
id: string,
name: string,
password: string,
email: string,
): Promise<ResponseDto<RegisterResEntity>> => {
const promiseFn = (
fnResolve: (value: ResponseDto<RegisterResEntity>) => void,
fnReject: (reason?: any) => void,
) => {
const apiClient = getApiClient();
apiClient
.post('/auth/register', { id, name, password, email })
.then(res => {
if (res.status !== 200) {
console.error(res);
fnReject(`msg.${res}`);
} else {
fnResolve(new ResponseDto<RegisterResEntity>(res));
}
})
.catch(err => {
console.error(err);
fnReject('msg.RESULT_FAILED');
});
};
return new Promise(promiseFn);
};
57 changes: 57 additions & 0 deletions frontend/src/api/channel.api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { ResponseDto } from '@/api/dto/response.dto.ts';
import {
createChannelReqEntity,
createChannelResEntity,
getUserChannelsResEntity,
} from '@/api/dto/channel.dto.ts';
import { getApiClient } from '@/api/client.api.ts';

export const createChannel = (
data: createChannelReqEntity,
): Promise<ResponseDto<createChannelResEntity>> => {
const promiseFn = (
fnResolve: (value: ResponseDto<createChannelResEntity>) => void,
fnReject: (reason?: any) => void,
) => {
const apiClient = getApiClient();
apiClient
.post('/channel', data)
.then(res => {
if (res.status !== 200) {
console.error(res);
fnReject(`msg.${res}`);
} else {
fnResolve(new ResponseDto<createChannelResEntity>(res));
}
})
.catch(err => {
console.error(err);
fnReject('msg.RESULT_FAILED');
});
};
return new Promise(promiseFn);
};

export const getUserChannels = (userId: string): Promise<ResponseDto<getUserChannelsResEntity>> => {
const promiseFn = (
fnResolve: (value: ResponseDto<getUserChannelsResEntity>) => void,
fnReject: (reason?: any) => void,
) => {
const apiClient = getApiClient();
apiClient
.get(`/channel/user/${userId}`)
.then(res => {
if (res.status !== 200) {
console.error(res);
fnReject(`msg.${res}`);
} else {
fnResolve(new ResponseDto<getUserChannelsResEntity>(res));
}
})
.catch(err => {
console.error(err);
fnReject('msg.RESULT_FAILED');
});
};
return new Promise(promiseFn);
};
Loading

0 comments on commit 3f00ff0

Please sign in to comment.