๐ฑ ๊นํ๋ธ ๋ธ๋์น ์ ๋ต์ ๋ํ ๊ณ ์ฐฐ
๐ค Intro
์ด๋ฒ์ 2์ฐจ ํ๋ก์ ํธ๋ฅผ ์งํํ๋ฉด์, 1์ฐจ ํ๋ก์ ํธ๋ ์ค์ค๋ก ์์ฌ์ ๋ ๋ถ๋ถ์ ๋ฉ๊ฟ๋ณด๊ณ ์ ์ฌ๋ฌ ๋ฐฉ์์ ์๊ฐํ์๋ค.
์์ฌ์ ๋ ๊ฒ ์ค ํ๋๋, ๋ด ์ด๋ฆ์ ๋ด ๋ธ๋์น์์๋ง ์์ ํ๋ค๋ณด๋ ๋จผ์ ์์ฑ๋ ์์ ๊ธฐ๋ฅ๋ณ๋ก pr์ ์ฌ๋ ค์ ํตํฉํ ์ ์์๋๊ฒ!
๊ทธ๋์ ์ด๋ฒ์๋ ์ข ๋ ๊นํ๋ธ ์ ๋ต์ ์ธ๋ถ์ ์ผ๋ก ๊ฐ์ ธ๊ฐ๊ธฐ๋กํ๋ค.
์ด๋ฏธ BE, ML์ ์ด๋ฐ ๋ฐฉ์์ผ๋ก ์งํํ๊ณ ์๋ ์ํฉ์ด๋ผ, FE ์์๋ฅผ ํตํด ์ด๋ฒ ํ๋ก์ ํธ์์ ๊นํ๋ธ ์ ๋ต์ ์ด๋ป๊ฒ ๊ฐ์ ธ๊ฐ๊ณ ์ ํ๋์ง๋ฅผ ์์๋ณด์.
๐ฉถ Start
ForkโฆUpstreamโฆ๋ธ๋์น ๋ค์ด๋ฐโฆ
์ด๋ฒ์ ์ฌ์ฉํ๊ณ ์ ํ๋ ์ ๋ต์, ์ฐ๋ฆฌ ๋ ํฌ๋ฅผ forkํด์จ ๋ค์์, fork ๋ ํฌ๋ฅผ origin์ผ๋ก ๋๊ณ ์ฐ๋ฆฌ ์๋ณธ ๋ ํฌ๋ฅผ upstream์ผ๋ก ๋ฌ์ ๊ด๋ฆฌํ๋ ์ ๋ต์ด๋ค
์ด์ ํ๋ก์ ํธ๋๋ ๊ทธ๋ฅ ์๋ณธ ๋ ํฌ ํ๋๋ง ๋๊ณ ์์ ํ์๋๋ฐ, ์ด๋ฒ์ ์ด ๋ฐฉ์์ ํํ๊ฒ ๋ ๊ฒฐ์ ์ ์ด์ ์ค ํ๋๋ ์ฐ๋ฆฌ ํ์๋ค ์ค ๋๋ง ๋ธ๋์น ๋ค์ด๋ฐ ์ ๋ต์ ๋ค๋ฅด๊ฒ ๊ฐ์ ธ๊ฐ๊ธฐ๋ก ํ๊ธฐ ๋๋ฌธ์ด๋ค.
๋ ํผ์ ๋ธ๋์น ๋ช ์ด ๋ค๋ฅด๋ฉด ๋ค๋ฅธ ํ์๋ค์ด ๋ธ๋์น ๋ก๊ฒจ์์๋ ํท๊ฐ๋ฆด ๊ฒ์ด ๋ถ๋ช ํ๊ธฐ์โฆ๊ธฐ๋ฅ๋ณ ์ธ๋ถ ๋ธ๋์น๋ช ์ ๋ด fork์๋ง ๋๊ณ , ๊ณตํต ๊ท์น์ธ ์ฐ๋ฆฌ โ์ด๋ฆโ ๋ธ๋์น๋ง ์๋ณธ ๋ ํฌ์ ๋จ๊ฒจ๋๊ธฐ๋ก ํ ๊ฒ์ด๋ค.
์ด๊ฒ ์ธ์๋ ์ด fork-upstream ์ ๋ต์ ์ฌ์ฉํ๋ฉด ๋ค์๊ณผ ๊ฐ์ ์ด์ ์ด ์๋ค.
1. ์ฝ๋ ํ์ง ๊ด๋ฆฌ ์ธก๋ฉด
- ๋ชจ๋ ์ฝ๋๊ฐ PR์ ํตํด์๋ง ์๋ณธ์ ์ง์ ํ ์ ์๊ธฐ์ ๊ฐ์ ๋ฆฌ๋ทฐ ๊ธฐ๋ฅ์ ๊ฐ์ง๋ค.
- ์ง์ ํธ์๋ก ์ธํ ์ค์๋ฅผ ๋ฐฉ์งํ ์ ์๋ค.
- CI/CD ํ์ดํ๋ผ์ธ์ ๋ ์์ ํ๊ฒ ์ด์ํ ์ ์๋ค.
- ๋ํ, ์คํ์์ค ๊ธฐ์ฌ ๋ฐฉ์์ ๋ฏธ๋ฆฌ ํ์ตํ ์ ์๋ค๋ ์ฅ์ ๋ ์๋ค.
2. ๊ฐ์ธ ์์ ๋ฐฑ์ ๊ฐ๋ฅ
- ํนํ fork๋ณธ์ด ์กด์ฌํ๊ธฐ ๋๋ฌธ์, ์๋ณธ ๋ ํฌ์ ๋ฌธ์ ๊ฐ ์๊ฒจ๋ ๋ฐฑ์
์ด ๊ฐ๋ฅํ๋ค.
- ๋ํ, ๋ฉํฐ ๋ ํฌ ๊ด๋ฆฌ ๊ฒฝํ์ด ์๊ฒจ ๋์ค์ MSA์ ์ ์ฉํ๋ค.
๊ทธ๋ ๋ค๋ฉด ๋ธ๋์น ๋ค์ด๋ฐ์ ์ด๋ค ์์ผ๋ก ํ๋๋ฐ?
์ฒ์ ์ด ๋ฐฉ์์ ์ฌ์ฉํ๊ธฐ๋ก ํ๋ฉด์, ๊ฐ์ฅ ํท๊ฐ๋ ธ๋ ๋ถ๋ถ์ด ๋ฐ๋ก ๋ธ๋์น ๋ค์ด๋ฐ์ ํ๋ ๋ฐฉ์์ด์๋ค.
์ฒ์ ์๋ํ๋ BE, ML ๋ ํฌ์์๋ ์ด๊ฑธ ์ ๋๋ก ํ์ง ๋ชปํ์๋๋ฐโฆ FE๋ ํฌ์์๋ ์ ๋๋ก ์ก๊ณ ๋ค์ด๊ฐ๋ ค๊ณ ํ๋ค.
โค๏ธโ๐ฅ ๋ธ๋์น ๋ค์ด๋ฐ์ ๋ณดํต โpr ๊ท์น/๊ฐ๋ฐ์ค์ธ ๊ธฐ๋ฅโ ์ด๋ ๊ฒ ๊ตฌ์ฑํ๋ค.
๋๋ ์ฒ์์ ๋ด ๊ฐ์ธ ์ด๋ฆ ๋ธ๋์น์์ ๋ถ๊ธฐํ๊ฑฐ๋๊น ์ด๋ฆ์ ๋ฃ์ด์ผ ํ๋? ์ถ์๋๋ฐ, ์ด์ฐจํผ ์ฐ๋ฆฌ ํ ๋ธ๋์น ๊ท์น์ ์๋ณธ ์ด๋ฆ ๋ธ๋์น > ๋ค์์ด ๊ฐ๊ฐ ํ ๋ธ๋์น ์ด๊ธฐ๋ ํ๊ณ , ์ด๋ ๊ฒ ๋๋ฉด ์ด์ฐจํผ ์๋ณธ ์ด๋ฆ ๋ธ๋์น ์๋์์ ๋ถ๊ธฐํ๊ฑฐ๋ผ๋ ๊ฒ์ด ๋ณด์ฅ๋๊ธฐ ๋๋ฌธ์ ๊ตณ์ด ์ด๋ฆ์ ๋ฃ์ ํ์๋ ์๋ค๊ณ ํ๋ค.
๊ทธ๋์ ์ด๋ฒ์ ๋ด๊ฐ FE ๋ ํฌ์์ ๊ฐ์ ธ๊ฐ ๋ธ๋์น ๋ฆฌ์คํธ๋ ๋ค์๊ณผ ๊ฐ๋ค.
1
2
3
4
5
6
7
8
9
10
11
12
1. feat/chat-ui
โ ๊ธฐ๋ณธ ๋ ์ด์์, ์ฑํ
์ฐฝ ํ
2. feat/message-component
โ ๋ฉ์์ง ๋งํ์ , ์ฌ์ฉ์/๋ด ๊ตฌ๋ถ
3. feat/input-handler
โ ํ
์คํธ ์
๋ ฅ, ์ ์ก ๊ธฐ๋ฅ
4. feat/api-integration
โ ๋ฐฑ์๋ API ์ฐ๋
5. feat/chat-history
โ ์ด์ ๋ํ ๋ก๋, ์คํฌ๋กค ๊ด๋ฆฌ
6. feat/typing-indicator
โ ํ์ดํ ์ค ํ์, UX ๊ฐ์
์ด๋ฅผ ํ๋ก์ฐ๋ก ๋ณด๋ฉด, ๋ค์๊ณผ ๊ฐ๋ค.
๊ฐ๋ฐ ํ๊ฒฝ ๋ง์ถ๊ธฐ
1. GitHub์์ ์๋ณธ ๋ ํฌ๋ฅผ Fork > Forkํ ๋ ํฌ๋ฅผ ๋ก์ปฌ์ ํด๋ก
1
2
3
4
5
6
7
8
9
sspur@sunj-PC MINGW64 /c/developer/GitHub
$ git clone https://github.com/sunJ0120/OhgoodpayFE.git
Cloning into 'OhgoodpayFE'...
remote: Enumerating objects: 809, done.
remote: Counting objects: 100% (131/131), done.
remote: Compressing objects: 100% (103/103), done.
remote: Total 809 (delta 30), reused 78 (delta 16), pack-reused 678 (from 1)
Receiving objects: 100% (809/809), 7.21 MiB | 9.51 MiB/s, done.
Resolving deltas: 100% (386/386), done.
2. upstream์ผ๋ก ์๋ณธ ๋ ํฌ๋ฅผ ๋ฑ๋ก
1
2
3
4
5
6
7
8
9
10
sspur@sunj-PC MINGW64 /c/developer/GitHub/OhGoodpayFE (main)
$ git remote add upstream https://github.com/OhGoodTeam/OhgoodpayFE.git
sspur@sunj-PC MINGW64 /c/developer/GitHub/OhGoodpayFE (main)
$ git remote -v
origin https://github.com/sunJ0120/OhgoodpayFE.git (fetch)
origin https://github.com/sunJ0120/OhgoodpayFE.git (push)
upstream https://github.com/OhGoodTeam/OhgoodpayFE.git (fetch)
upstream https://github.com/OhGoodTeam/OhgoodpayFE.git (push)
3. ์ด๊ธฐ ๋ธ๋์น ๋ฑ๋ก
1
2
3
sspur@sunj-PC MINGW64 /c/developer/GitHub/OhGoodpayFE (sunjung)
$ git branch -d feat/sunjung/chat-ui
Deleted branch feat/sunjung/chat-ui (was b4c54c3).
๋์ ๊ฒฝ์ฐ๋, chat-ui๋ฅผ ์ง๋ ๊ฒ๋ถํฐ ์์ํ ๊ณํ์ด๋ผ ๋ค์๊ณผ ๊ฐ์ด ๊ตฌ์ฑํ์๋ค.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sspur@sunj-PC MINGW64 /c/developer/GitHub/OhgoodpayFE (feat/chat-ui)
$ git fetch upstream
From https://github.com/OhGoodTeam/OhgoodpayFE
* [new branch] dev -> upstream/dev
* [new branch] eunhyo -> upstream/eunhyo
* [new branch] gaeun -> upstream/gaeun
* [new branch] gahee -> upstream/gahee
* [new branch] hwajun -> upstream/hwajun
* [new branch] login -> upstream/login
* [new branch] main -> upstream/main
* [new branch] minjung -> upstream/minjung
* [new branch] mypage -> upstream/mypage
* [new branch] pay -> upstream/pay
* [new branch] recodash -> upstream/recodash
* [new branch] shorts -> upstream/shorts
* [new branch] sunjung -> upstream/sunjung
์ผ๋จ ํ์ฌ ๋ฐ์ดํฐํ ๋ธ๋์น์ ์ฌ๋ผ๊ฐ ์๋ commit๋ค์ ๋ก๊ฒจ์ค๊ธฐ ์ํด upstream์ ์๋ ํ ๋ธ๋์น๋ฅผ ์ ๋ถ ๊ฐ์ ธ์๋ค.
1
2
3
sspur@sunj-PC MINGW64 /c/developer/GitHub/OhgoodpayFE (feat/chat-ui)
$ git rebase upstream/recodash
Current branch feat/chat-ui is up to date.
์ด์ ์์ ๋ฌผ ์์ ์๋ ์์ผ๋ ๋ก๊ฒจ์ค๊ธฐ~
1
2
3
sspur@sunj-PC MINGW64 /c/developer/GitHub/OhgoodpayFE (feat/chat-ui)
$ git rebase upstream/dev
Current branch feat/chat-ui is up to date.
ํน์ ๋ชฐ๋ผ์ dev์ ์๋๊ฒ๋ ๋ก๊ฒผ๋๋ฐ ์์ง dev์๋ ์๋ฌด๊ฒ๋ ์์๋ค.
4. ์์ ํ PUSH
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
sspur@sunj-PC MINGW64 /c/developer/GitHub/OhGoodpayFE (feat/chat-ui)
$ git commit -m "[sunjung] feat: ์ฑ๋ด 1์ฐจ ui ๊ตฌ์ฑ ์๋ฃ ๋ฐ ์ปดํฌ๋ํธ ๋ถ๋ฆฌ ์๋ฃ"
[feat/chat-ui 246668f] [sunjung] feat: ์ฑ๋ด 1์ฐจ ui ๊ตฌ์ฑ ์๋ฃ ๋ฐ ์ปดํฌ๋ํธ ๋ถ๋ฆฌ ์๋ฃ
16 files changed, 455 insertions(+), 10 deletions(-)
delete mode 100644 src/features/recommend/.gitkeep
delete mode 100644 src/features/recommend/component/.gitkeep
create mode 100644 src/features/recommend/component/chat/ChatInput.css
create mode 100644 src/features/recommend/component/chat/ChatInput.jsx
create mode 100644 src/features/recommend/component/chat/ChatToggle.css
create mode 100644 src/features/recommend/component/chat/ChatToggle.jsx
create mode 100644 src/features/recommend/component/chat/MessageBubble.css
create mode 100644 src/features/recommend/component/chat/MessageBubble.jsx
create mode 100644 src/features/recommend/component/chat/ProfileAvatar.css
create mode 100644 src/features/recommend/component/chat/ProfileAvatar.jsx
create mode 100644 src/features/recommend/layout/chat/ChatLayout.css
create mode 100644 src/features/recommend/layout/chat/ChatLayout.jsx
create mode 100644 src/pages/recommend/chat/Chat.css
create mode 100644 src/pages/recommend/chat/Chat.jsx
create mode 100644 src/shared/assets/img/chat_profile.png
๊ทธ๋ ๋ค๋ฉด ์ด์ ์์ ํ์ push๋ฅผ ์ด๋ป๊ฒ ํด์ผ ํ๋์ง๋ฅผ ์์๋ณด์. ์ฐ์ add commit์ ๋๋ฌด ๋น์ฐํ๋๊นโฆ์ผ๋จ commit์ผ๋ก ์ฌ๋ ค์ค๋ค.
1
2
3
4
5
6
sspur@sunj-PC MINGW64 /c/developer/GitHub/OhGoodpayFE (feat/chat-ui)
$ git remote -v
origin https://github.com/sunJ0120/OhgoodpayFE.git (fetch)
origin https://github.com/sunJ0120/OhgoodpayFE.git (push)
upstream https://github.com/OhGoodTeam/OhgoodpayFE.git (fetch)
upstream https://github.com/OhGoodTeam/OhgoodpayFE.git (push)
๊ทธ ๋ค์์ remote๋ฅผ ํ์ธํด๋ณด๋ฉด, origin์ด ๋ด fork ๋ ํฌ๋ก ๋์ด ์๊ณ upstream์ด ์๋ณธ ๋ ํฌ๋ก ๋์ด ์๋ ๊ฒ์ ๋ณผ ์ ์๋ค.
์ด ์ํฉ์์ ์ฐ์ ์ฐ๋ฆฌ fork ๋ ํฌ์ push๋ฅผ ํด์ค์ผ ํ๋ค.
1
git push origin feat/chat-ui
์ด๋ ๊ฒ ํด์ค ๋ค์์ ์ด์ ์๋ณธ ๋ ํฌ์ PR์ ๋ ๋ ค์ฃผ๋ฉด ๋๋ค.
์ด๋ ๊ฒ ํด์ฃผ๋ฉด ์์ฝ๊ฒ ์์ ๋จ์ ๊ธฐ๋ฅ๋ณ ๋ฆฌ๋ทฐ ๋ฐ ํตํฉ์ด ๊ฐ๋ฅ~