https://github.com/team-withme/withme_fe
๐ WithMe ํ๋ก ํธ์๋ ๋ ํฌ์งํ ๋ฆฌ
https://github.com/team-withme/withme_fe
emotion nextjs react redux redux-toolkit typescript
Last synced: 3 months ago
JSON representation
๐ WithMe ํ๋ก ํธ์๋ ๋ ํฌ์งํ ๋ฆฌ
- Host: GitHub
- URL: https://github.com/team-withme/withme_fe
- Owner: Team-WithMe
- Created: 2022-05-20T11:30:39.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T14:57:24.000Z (over 3 years ago)
- Last Synced: 2025-06-01T16:01:16.471Z (about 1 year ago)
- Topics: emotion, nextjs, react, redux, redux-toolkit, typescript
- Language: TypeScript
- Homepage:
- Size: 27.3 MB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
## ๐ With Me FE
**์๋๋ฏธ (With Me)** ์คํฐ๋ ๋งค์นญ ์๋น์ค ์
๋๋ค.
## ๐ Links
- WithMe ๋์์ธ ์์คํ
npm
- WithMe ์คํ ๋ฆฌ๋ถ ๋์์ธ ์์คํ
๊ฐ์ด๋
- WithMe ๋ฐฑ์๋ ๋ ํฌ์งํ ๋ฆฌ
## ๐ช eslint plugin
- eslint-plugin-sort-keys-custom-order: type๊ณผ object์ ํค๋ฅผ ์๋์ผ๋ก ์ ๋ ฌ ํด์ฃผ๋ ํ๋ฌ๊ทธ์ธ
- eslint-plugin-simple-import-sort: import/export๋ฅผ ์๋์ผ๋ก ์ ๋ ฌํด์ฃผ๋ ํ๋ฌ๊ทธ์ธ
- eslint-plugin-import: eslint-plugin-simple-import-sort์ ํจ๊ป ์ฌ์ฉํ์ฌ ๊ธฐ๋ฅ ํ์ฅ
- eslint-plugin-unused-imports: ์ฌ์ฉํ์ง ์๋ ๊ฒ์ ์ญ์ ํ๊ฑฐ๋ ๋๋ฝ ๋ ๊ฒ์ ์๋์ผ๋ก ์ถ๊ฐํ๋ ํ๋ฌ๊ทธ์ธ
## ๐จโ๐ป Member
| [LeeBonHoon](https://github.com/LeeBonHoon) | [changyuyeo](https://github.com/changyuyeo) | [KimTeaSick](https://github.com/KimTeaSick) |
| :-------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
|
|
|
|
- `Lee-bonhoon`: ๋ฉ์ธ ํ์ด์ง, ํ ๋ฆฌ์คํธ
- `changyuyeo`: ํธ์คํธ ํ์ด์ง, ์์ธ ํ์ด์ง
- `KimTeaSick`: ๋ง์ด ํ์ด์ง
ย ๐ Branches
## ๐ branches
๊ฐ์ ๋ธ๋์น์์ ์์
, ์์
์ด ์๋ฃ ๋์๋ค๋ฉด master๋ธ๋์น์ PR ํ merge ์์ฒญ
merge๊ฐ ์๋ฃ๋๋ฉด `๋ค๋ฅธ ๊ฐ๋ฐ์์๊ฒ pull ์์ฒญํ๊ธฐ`
master ๋ธ๋์น๊ฐ ์
๋ฐ์ดํธ ๋๋ฉด ํญ์ pull ๋ฐ์์ค์ผ ์ถฉ๋์ด ๋์ง ์์ต๋๋ค!
```
// ์ ๋ธ๋์น ๋ง๋ค๊ธฐ
git checkout -b "์ ๋ธ๋์น ์ด๋ฆ"
// ๋ธ๋์น ์ด๋
git checkout "๋ธ๋์น ์ด๋ฆ"
```
ย ๐ช Hooks
### ๐ช Hooks
### useModal ์ฌ์ฉ๋ฒ
```tsx
import { FC } from 'react';
import useModal from '@hooks/useModal';
//* ๋ชจ๋ฌ์ฐฝ ์์ ๋ค์ด๊ฐ ์ปจํ
์ธ
const TestModal: FC<{ onCloseModal: () => void }> = ({ onCloseModal }) => (
๋ชจ๋ฌ ๋ด์ฉ...
๋ชจ๋ฌ์ฐฝ ๋ซ๊ธฐ
);
const HostPage = () => {
//* useModal ์ฌ์ฉ
//* ModalPortal: root-modal ์ด๋ผ๋ id์ ๋ชจ๋ฌ ๋๋๋ง (children ์ผ๋ก ๋ชจ๋ฌ ์ปดํฌ๋ํธ ๋ง๋ค์ด์ ๋ฃ์ด์ฃผ๋ฉด ๋ฉ๋๋ค.)
//* onCloseModal: ๋ชจ๋ฌ์ฐฝ ์คํ ์ด๋ฒคํธ
//* onOpenModal: ๋ชจ๋ฌ์ฐฝ ๋ซ๋ ์ด๋ฒคํธ
const { ModalPortal, onCloseModal, onOpenModal } = useModal();
return (
<>
๋ชจ๋ฌ์ฐฝ ์ด๊ธฐ
>
);
};
export default HostPage;
```
- `useModal`์ ์ฌ์ฉํด ModalPortal, onCloseModal, onOpenModal์ ์ฌ์ฉํด์ ๋ชจ๋ฌ์ฐฝ์ ๊ด๋ฆฌํ๋ฉด ๋ฉ๋๋ค.
- `onOpenModal` ๋ฉ์๋๋ฅผ ์ฌ์ฉ ์ ๋ชจ๋ฌ์ฐฝ์ด ์คํ๋๋ฉฐ id๊ฐ root-modal ์ด๋ผ๋ ์์์ `ModalPortal` ์ปดํฌ๋ํธ๋ฅผ ๋๋๋ง ํ๊ฒ ๋ฉ๋๋ค. (react-portal ํ์ฉ)
- `onCloseModal` ์ด๋ฒคํธ ๋ฐ์ ์ ํด๋น ๋ชจ๋ฌ์ฐฝ์ ๋ซํ๊ฒ ๋ฉ๋๋ค.
- ์ค๋ณต๋๋ ๋ถ๋ถ์ ์ปค์คํ
ํ
์ผ๋ก ๋ง๋ค์์ผ๋ฉฐ react portal ๋ฅผ ํ์ฉํด root์ ๋ฐ๊นฅ์์ ๋๋๋ง ํ๊ธฐ ๋๋ฌธ์ ํจ์ฌ ํธ๋ฆฌํ๊ฒ ์ฌ์ฉ์ด ๊ฐ๋ฅํฉ๋๋ค.
### portal๋ฅผ ์ฌ์ฉํด์ ๊ตฌํํ ์ด์
> DOM Tree ์์์์ ๋ถ๋ชจ-์์ ๊ฐ์ ์ ์ฝ์์ ์์ ๋ก์์ง๊ธฐ ์ํด Portal ๊ธฐ๋ฅ์ ์ฌ์ฉํ๊ฒ ๋๋ ๊ฒ์
๋๋ค.
> ๋ํ, Portal์ ๋ ๋๋ง๋ ์์์์๋ ์ด๋ฒคํธ ๋ฒ๋ธ๋ง์ด ๋ฐ์๋๊ธฐ ๋๋ฌธ์ ๋ถ๋ชจ์์์์ ํต์ ์ธก๋ฉด์์๋ ์ ์ฉํฉ๋๋ค.
ย ๐ฅ Available URI
## ๐ฅ Available URI
- / : ๋ฉ์ธ ํ์ด์ง
- /host : ์๋ก์ด ํ ๋ง๋ค๊ธฐ ํ์ด์ง
- /...
ย ๐ Skeleton
## ๐ Skeleton
```
|-- /src
| |-- /assets
| | |-- ...
| |-- /components
| | |-- ...
| |-- /hooks
| | |-- useInput.ts
| | |-- useModal.tsx
| |-- /lib
| | |-- /api
| | | |-- ...
| |-- /pages
| | |-- \_app.tsx
| | |-- \_document.tsx
| | |-- ...
| |-- /store
| | |-- index.ts
| | |-- rootReducer.ts
| | |-- ...
| |-- /styles
| |-- /typings
| |-- ...
```
ย ๐ Conventional Commits
## ๐ Conventional Commits
[์ฌ์ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฐธ๊ณ ](https://www.conventionalcommits.org/ko/v1.0.0/)
| message | descripton |
| -------- | -------------------------------------------------------------------------------------------- |
| feat | ์๋ก์ด ๊ธฐ๋ฅ ์ถ๊ฐ |
| fix | ๋ฒ๊ทธ ์์ |
| test | Test ๊ด๋ จํ ์ฝ๋์ ์ถ๊ฐ, ์์ |
| refactor | ์ฝ๋๋ฅผ ๋ฆฌํํ ๋ง |
| chore | (์ฝ๋์ ์์ ์์ด) ์ค์ ์ ๋ณ๊ฒฝ |
| docs | ๋ฌธ์์ ์์ |
| style | (์ฝ๋์ ์์ ์์ด) ์คํ์ผ(style)๋ง ๋ณ๊ฒฝ
(๋ค์ฌ์ฐ๊ธฐ ๊ฐ์ ํฌ๋งท์ด๋ ์ธ๋ฏธ์ฝ๋ก ์ ๋นผ๋จน์ ๊ฒฝ์ฐ) |
~~commit example~~
```
git commit -m "feat: ์ ์ ๋ก๊ทธ์ธ ๊ธฐ๋ฅ ์ถ๊ฐ"
```
Commitizen ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ์ผ๋ก ์ ๋ฐฉ๋ฒ๋ณด๋ค๋ ์๋๋ฐฉ๋ฒ์ ์ถ์ฒํฉ๋๋ค.
```
yarn commit
```
`yarn commit` ์ ํด์ฃผ์๊ณ ์ปค๋ฐ์ ํ์
, ์ ๋ชฉ, ์ค๋ช
๋ฑ ๊ฐ์ด๋๋๋ก ์
๋ ฅํ ํ ๊ฐ๊ฐ ๋ธ๋์น์ push ํด์ฃผ์๋ฉด ๋ฉ๋๋ค!
> yarn commit ๋ช
๋ น์ด๋ ์ ์ผ ๋จผ์ git add๋ฅผ ํด์ฃผ๊ธฐ ๋๋ฌธ์ git add ๋ช
๋ น์ด๋ ๋ฐ๋ก ์
๋ ฅ์ํด์ฃผ์
๋ ๋ฉ๋๋ค!
ย โ Settings
## โ Settings
dev server
```
yarn dev
```
node -v
```
v16.14.2
```
.env
```
NEXT_PUBLIC_API_URL=...
```
etc...
```
// clone ํ git hook์ด ์ ์์ ์ผ๋ก ๋์ํ์ง ์๋๋ค๋ฉด ๋ค์ ๋ช
๋ น์ด ์คํ
chmod +x .husky/pre-commit
```