Skip to content

Commit

Permalink
Merge branch 'development' into backend
Browse files Browse the repository at this point in the history
  • Loading branch information
happyhyep committed Nov 26, 2024
2 parents 117e1b4 + 6326386 commit 5e3b581
Show file tree
Hide file tree
Showing 117 changed files with 6,026 additions and 1,466 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://ddara-docs.vercel.app/">팀 위키</a> |
<a href="https://www.notion.so/127b1b2b649180e88f70d6a4648924a0?pvs=4">팀 노션</a> |
<a href="https://github.com/boostcampwm-2024/web28-DDara/wiki">팀 위키</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
12 changes: 11 additions & 1 deletion backend/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import express from 'express';
import swaggerUi from 'swagger-ui-express';
import http from 'http';
import cors from 'cors';
import { specs } from '../swaggerConfig.js';
import { PORT } from './constants/constants.js';
import { initializeWebSocketServer } from './websocketServer.js';
Expand All @@ -10,6 +11,15 @@ import { channelRouter } from './routes/channelRouter.js';
const app = express();
app.use(express.json());

// TODO: 프론트 배포 후 origin url 변경
app.use(
cors({
origin: ['http://localhost:5173', 'http://223.130.151.43', 'https://ddara.kro.kr'],
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
credentials: true,
}),
);

app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(specs));

app.use('/api/auth', authRouter);
Expand All @@ -27,5 +37,5 @@ try {
}

server.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
console.log(`Server is running`);
});
2 changes: 1 addition & 1 deletion docs/docusaurus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<p>
<a href="https://www.notion.so/127b1b2b649180e88f70d6a4648924a0?pvs=4">팀 노션</a> |
<a href="https://github.com/boostcampwm-2024/web28-DDara/wiki">팀 위키</a> |
<a href="https://ddara-docs.vercel.app/">팀 위키</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
3 changes: 2 additions & 1 deletion docs/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"clsx": "^2.0.0",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react-dom": "^18.0.0",
"react-player": "^2.16.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.6.1",
Expand Down
8 changes: 7 additions & 1 deletion docs/docusaurus/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": "."
"baseUrl": ".",
"paths": {
"@site/*": ["src/*"],
"@theme/*": ["src/theme/*"],
"@component/*": ["src/components/*"],
"@markdown/*": ["src/components/markdown/*"],
}
}
}
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export default [
'prettier/prettier': 'error',
'no-underscore-dangle': 'warn',
'no-undef': 'off',
'max-classes-per-file': 'off',
'no-bitwise': 'off',
'no-plusplus': 'off',
'import/extensions': [
'error',
'always',
Expand Down Expand Up @@ -189,6 +192,9 @@ export default [
'prettier/prettier': 'error',
'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
11 changes: 11 additions & 0 deletions frontend/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import type { Preview } from '@storybook/react';
import '../src/index.css';
// 우선은 폰트 다 포함시켰는데, 나중에 사용할 것들만 따로 뺴자.
import '@fontsource/pretendard/100.css';
import '@fontsource/pretendard/200.css';
import '@fontsource/pretendard/300.css';
import '@fontsource/pretendard/400.css';
import '@fontsource/pretendard/500.css';
import '@fontsource/pretendard/600.css';
import '@fontsource/pretendard/700.css';
import '@fontsource/pretendard/800.css';
import '@fontsource/pretendard/900.css';

const preview: Preview = {
parameters: {
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
8 changes: 7 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@
},
"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-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",
Expand All @@ -36,6 +41,7 @@
"@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",
Expand Down
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.
1 change: 0 additions & 1 deletion frontend/public/vite.svg

This file was deleted.

4 changes: 3 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export const App = () => <div>Hello</div>;
import { IndexRoutes } from '@/routes/IndexRoutes.tsx';

export const App = () => <IndexRoutes />;
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);
};
31 changes: 31 additions & 0 deletions frontend/src/api/client.api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { AppConfig } from '@/constants';
import { loadLocalData } from '@/utils/common/manageLocalData.ts';
import axios from 'axios';

let apiClient = axios.create({
baseURL: AppConfig.API_SERVER,
headers: {
'Content-type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': true,
},
});

export function setApiToken(token: string): void {
if (apiClient) apiClient.defaults.headers.common.Authorization = `Bearer ${token}`;
}

export const getApiClient = () => {
const token = loadLocalData(AppConfig.KEYS.LOGIN_TOKEN);
if (token) setApiToken(token);
if (!apiClient) {
apiClient = axios.create({
baseURL: AppConfig.API_SERVER,
headers: {
'Content-type': 'application/json',
'Access-Control-Allow-Origin': '*',
},
});
}
return apiClient;
};
Loading

0 comments on commit 5e3b581

Please sign in to comment.