Skip to content

Commit

Permalink
Merge pull request #67 from manymogo/manymogo
Browse files Browse the repository at this point in the history
โœจFEAT: ํ™˜์œจ ์†Œ์ˆซ์  ๋น„์ •์ƒ์ ์ธ ํ‘œ์‹œ ์ œ๊ฑฐ(Math.floor)
  • Loading branch information
manymogo authored Nov 2, 2023
2 parents fbc2082 + 3ad23be commit 52e7ad6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
41 changes: 35 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [์ฃผ์š” ๊ธฐ์ˆ  ์Šคํƒ ์„ ์ • ํฌ์ธํŠธ](#์ฃผ์š”-๊ธฐ์ˆ -์Šคํƒ-์„ ์ •-ํฌ์ธํŠธ)
- [์ฃผ์š” ๊ธฐ๋Šฅ](#์ฃผ์š”-๊ธฐ๋Šฅ-๐Ÿ“Œ)
- [๋ผ์šฐํŒ… & ์ปดํฌ๋„ŒํŠธ & ์ƒํƒœ๊ด€๋ฆฌ](#๋ผ์šฐํŒ…--์ปดํฌ๋„ŒํŠธ--์ƒํƒœ-๊ด€๋ฆฌ)
- [์ถ”๊ฐ€ ์š”๊ตฌ ์‚ฌํ•ญ](#์ถ”๊ฐ€-์š”๊ตฌ-์‚ฌํ•ญ)

## ๊ฐœ์š”

Expand Down Expand Up @@ -113,24 +114,45 @@ $ npm run preview // ๋นŒ๋“œ ํ›„ ๋ฐฐํฌ ํ™˜๊ฒฝ์—์„œ์˜ ์‹คํ–‰

## ์ฃผ์š” ๊ธฐ์ˆ  ์Šคํƒ ์„ ์ • ํฌ์ธํŠธ

- VITE
- VITE <br>
๊ธฐ์กด์˜ Create React App์˜ ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•˜๋ฉด Webpack ๋ฒˆ๋“ค๋Ÿฌ์™€ Babel ํŠธ๋žœ์ŠคํŒŒ์ผ๋Ÿฌ๋ฅผ ํ†ตํ•ด ๋นŒ๋“œํ•˜๋Š”๋ฐ, VITE๋ฅผ ์ด์šฉํ•œ ๋ฐฉ์‹์€ ESbuild ๋“ฑ์„ ํ™œ์šฉํ•˜์—ฌ ์†๋„๊ฐ€ ๋” ๋น ๋ฅด๊ณ  ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์—์„œ ๋นŒ๋“œ ๊ฒฐ๊ณผ๋ฌผ์„ ๋น ๋ฅด๊ฒŒ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด ์„ ํƒํ–ˆ์Šต๋‹ˆ๋‹ค.
- REACT
- FIREBASE
- NETLIFY
- FIREBASE <br>
๋ฐฑ์—”๋“œ ์„œ๋น„์Šค์˜ ๊ตฌ์ถ•์€ express ํ”„๋ ˆ์ž„์›Œํฌ์™€ mongoDB๋ฅผ ์ด์šฉํ•˜์—ฌ ์ง„ํ–‰ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ํ•ด๋‹น ๋ฐฉ์‹์„ ๋”ฐ๋ฅด๋ฉด ์ธ์ฆ์„ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด `passport` ๋ชจ๋“ˆ ๋“ฑ์„ ์ด์šฉํ•˜์—ฌ ์‹œ๊ฐ„์ด ์ƒ๋Œ€์ ์œผ๋กœ ๋” ์†Œ์š”๋œ๋‹ค๋Š” ์ , mongoDB์™€ firebase firestore๊ฐ€ ๋ชจ๋‘ noSQL ๊ธฐ๋ฐ˜์˜ document ๋ฐฉ์‹์ด๋ผ ํฐ ์ฐจ์ด๊ฐ€ ์—†๋‹ค๋Š” ์ ์„ ๊ณ ๋ คํ•˜์—ฌ firebase๋ฅผ ์ด์šฉํ•ด ๋ฐฑ์—”๋“œ๋ฅผ ๊ตฌ์ถ•ํ•˜๊ธฐ๋กœ ๊ฒฐ์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
- NETLIFY <br>
netlify ํ˜ธ์ŠคํŒ… ์„œ๋น„์Šค๋ฅผ ์ด์šฉํ•˜์—ฌ ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ๋ฐฐํฌ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด Github ๋ ˆํฌ์ง€ํ† ๋ฆฌ์˜ ํ”„๋กœ์ ํŠธ๋ฅผ ์ž๋™์œผ๋กœ ๋นŒ๋“œํ•ด์ค„ ์ˆ˜ ์žˆ์„ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ, ํ•ด๋‹น ๋ธŒ๋žœ์น˜์— ์ƒˆ๋กญ๊ฒŒ push๋œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ๊นŒ์ง€ ์ž๋™์œผ๋กœ ์ ์šฉ๋œ๋‹ค๋Š” ์ ์€ ๋งค์šฐ ๋งค๋ ฅ์ ์œผ๋กœ ๋‹ค๊ฐ€์™”์Šต๋‹ˆ๋‹ค.

## ์ฃผ์š” ๊ธฐ๋Šฅ ๐Ÿ“Œ

1. Login & Signup ๐Ÿ”
> ๋กœ๊ทธ์ธ์€ ํฌ๊ฒŒ ๋น„๋ฐ€๋ฒˆํ˜ธ ์ธ์ฆ ๋ฐฉ์‹๊ณผ ๊นƒํ—ˆ๋ธŒ ๊ณ„์ • ์—ฐ๋™ ๋ฐฉ์‹์œผ๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‘ ๋ฐฉ์‹ ๋ชจ๋‘ ๋กœ๊ทธ์ธ๋œ ์‚ฌ์šฉ์ž์˜ ์ •๋ณด๋ฅผ `localStorage`์— [๋„ฃ์–ด์ฃผ๊ณ ](https://github.com/2-guys-Javascript/travel-web-app/blob/d00d43cdb030e24b68f720e1db93925dc1192bc8/src/components/Login/Login.jsx#L19-L21), ๊ฐ ํŽ˜์ด์ง€์— ํ•ด๋‹นํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋งˆ์šดํŠธ ๋  ๋•Œ๋งˆ๋‹ค useEffect() ํ›…์„ ํ†ตํ•ด์„œ ์ด๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” [๋ฐฉ์‹](https://github.com/2-guys-Javascript/travel-web-app/blob/d00d43cdb030e24b68f720e1db93925dc1192bc8/src/components/Japan/Japan.jsx#L6-L16)์„ ํƒํ–ˆ์Šต๋‹ˆ๋‹ค => ์ง€๋„, ๋‚ ์”จ, ํ™˜์œจ, ๋งˆ์ด ํŽ˜์ด์ง€ ํƒญ ๋ชจ๋‘
> ํšŒ์› ๊ฐ€์ž…(Sign up)์€ html form์˜ input์œผ๋กœ๋ถ€ํ„ฐ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ด๋ฉ”์ผ, ๋น„๋ฐ€ ๋ฒˆํ˜ธ ๊ทธ๋ฆฌ๊ณ  ๋‹‰๋„ค์ž„์„ ์ž…๋ ฅ ๋ฐ›์•„ firebase authentication์— ๋“ฑ๋กํ•ด์ฃผ๋Š” [๋ฐฉ์‹](https://github.com/2-guys-Javascript/travel-web-app/blob/d00d43cdb030e24b68f720e1db93925dc1192bc8/src/components/SignUp/SignUpForm.jsx#L43-L48)์„ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด ๊ณผ์ •์—์„œ ๊ฐ ์ž…๋ ฅ ํ•„๋“œ๊ฐ€ ์ด๋ฉ”์ผ์ด ๋งž๋Š”์ง€, ๋น„๋ฐ€๋ฒˆํ˜ธ์˜ ๊ธธ์ด๊ฐ€ ์ ๋‹นํ•œ์ง€๋ฅผ ์ •๊ทœ ํ‘œํ˜„์‹ ๋“ฑ์„ ์ด์šฉํ•˜์—ฌ ๊ฒ€์ฆํ•ด์ฃผ์—ˆ๊ณ , ์ด๋ฏธ ์กด์žฌํ•˜๋Š” ๊ณ„์ •์ธ์ง€์— ๋Œ€ํ•œ ์ •๋ณด๋Š” firebase์˜ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๋ฅผ ํ†ตํ•ด ๋‚˜ํƒ€๋ƒˆ์Šต๋‹ˆ๋‹ค.
2. Map ๐Ÿ—บ๏ธ
2. Map ๐Ÿ—บ๏ธ <br>
์ง€๋„๋Š” ๋กœ๊ทธ์ธ๋œ ์‚ฌ์šฉ์ž์™€ ๊ทธ๋ ‡์ง€ ์•Š์€ ์‚ฌ์šฉ์ž์—๊ฒŒ ๊ฐ๊ฐ ๋‹ค๋ฅธ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ „์ž๋Š” ํ›„์ž์˜ ๊ธฐ๋Šฅ์— ์ถ”๊ฐ€์ ์œผ๋กœ ๋‚ ์งœ์— ๋งž๋Š” ๋ณธ์ธ์˜ ์ผ์ •์„ ์ƒ์„ฑํ•˜๊ณ  ์กฐํšŒํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ํ›„์ž๋Š” ํŠน์ • ์žฅ์†Œ์— ๋Œ€ํ•œ ๊ฒ€์ƒ‰๊ณผ ํ•ด๋‹น ์žฅ์†Œ ์ฃผ๋ณ€์˜ ๋ช…์†Œ(์‹๋‹น, ์นดํŽ˜)์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
> LoginMap <br>
๋กœ๊ทธ์ธ๋œ ์‚ฌ์šฉ์ž๋Š” ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ ์ž์‹ ์˜ ์œ„์น˜๋กœ ์ง€๋„๋ฅผ ์œ„์น˜์‹œํ‚ฌ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ํŠน์ • ์ง€์ ์„ ํด๋ฆญํ•ด ์ง€๋„ ํ•˜๋‹จ์˜ ํผ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ผ์ •์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ ์ž์‹ ์ด ์ƒ์„ฑํ•œ ์ผ์ •์— ๋Œ€ํ•œ ๋งˆ์ปค๋ฅผ ํด๋ฆญํ•˜์—ฌ ์ฃผ๋ณ€์˜ ๋ช…์†Œ ์ •๋ณด๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

3. Weather ๐ŸŒฆ๏ธ
> NonLoginMap <br>
๋น„๋กœ๊ทธ์ธ๋œ ์‚ฌ์šฉ์ž๋Š” ์ง€๋„์˜ ์ž๋™ ์™„์„ฑ ๊ฒ€์ƒ‰์ฐฝ์— ํŠน์ • ์žฅ์†Œ๋ฅผ ๊ฒ€์ƒ‰ํ•˜์—ฌ ์ด๋™ํ•˜๊ณ , ์ฃผ๋ณ€์˜ ๋ช…์†Œ ์ •๋ณด๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

4. Currency ๐Ÿ’ด
3. Weather ๐ŸŒฆ๏ธ <br>
> ์‚ฌ์šฉ์ž๋Š” ๋‚ ์”จ ํƒญ์—์„œ ํ•œ๊ตญ๊ณผ ์ผ๋ณธ์˜ ํŠน์ • ๋„์‹œ์— ๋Œ€ํ•œ ๋ฐ•์Šค๋ฅผ ํด๋ฆญํ•˜์—ฌ ์˜ค๋Š˜, ๋‚ด์ผ, ๋ชจ๋ ˆ์— ๋Œ€ํ•œ ๋‚ ์”จ ์ •๋ณด๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
5. Currency ๐Ÿ’ด <br>
> ์‚ฌ์šฉ์ž๋Š” ํ™˜์œจ ํƒญ์—์„œ ํด๋ฆญ์„ ํ†ตํ•ด ๋‹น์ผ์˜ ํ™˜์œจ ์ •๋ณด๋ฅผ ์›ํ™” ๊ธฐ์ค€, ์—”ํ™” ๊ธฐ์ค€์œผ๋กœ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
## ๋ผ์šฐํŒ… & ์ปดํฌ๋„ŒํŠธ & ์ƒํƒœ ๊ด€๋ฆฌ

### ๋ผ์šฐํŒ…
1. Home (url : `/`)
2. ํ•œ๊ตญ (url : `/korea`) <br>
> ์ตœ์™ธ๊ณฝ์—๋Š” KrDefaultLayout์ด ๊ฐ์‹ธ๊ณ  ์žˆ์–ด ์ƒ๋‹จ์—๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ—ค๋”๊ฐ€, ํ•˜๋‹จ์—๋Š” ๊ฐ ํƒญ์œผ๋กœ ์ด๋™ํ•  ์ˆ˜ ์žˆ๋Š” ๋„ค๋น„๊ฒŒ์ด์…˜ ๋ฐ”๊ฐ€ ์œ„์น˜ํ•˜๊ณ , ์„ธ๋ถ€ url path์— ๋”ฐ๋ผ์„œ Outlet ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋‹ฌ๋ผ์ง‘๋‹ˆ๋‹ค.
3. ์ผ๋ณธ (url : `/japan`) <br>
> ์ผ๋ณธ ํƒญ๋„ ํ•œ๊ตญ ํƒญ๊ณผ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ์ตœ์™ธ๊ณฝ์—๋Š” JpDefaultLayout์ด ๊ฐ์‹ธ๊ณ  ์žˆ์–ด ์ƒ๋‹จ๊ณผ ํ•˜๋‹จ์— ๊ฐ๊ฐ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ—ค๋”์™€ ๋„ค๋น„๊ฒŒ์ด์…˜ ๋ฐ”๊ฐ€ ์œ„์น˜ํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์„ธ๋ถ€ Outlet ์ปดํฌ๋„ŒํŠธ๊ฐ€ ํ™˜์œจ(`Exchange`)์ด ์ถ”๊ฐ€๋˜์—ˆ๋‹ค๋Š” ํŠน์ง•์ด ์žˆ์Šต๋‹ˆ๋‹ค.
4. ํšŒ์› ๊ฐ€์ž… (url : `/signup`) ๊ณผ ๋กœ๊ทธ์ธ (url : `/login`) <br>
> ํ•ด๋‹น url path๋งŒ ์˜ˆ์™ธ์ ์œผ๋กœ ApplicationHeader๋ฅผ ์ด์šฉํ•˜์ง€ ์•Š๊ณ , ๊ฐœ๋ณ„์ ์ธ ํ—ค๋”๋ฅผ ์ •์˜ํ•˜์—ฌ UI๋ฅผ ๋ Œ๋”๋งํ•ฉ๋‹ˆ๋‹ค.
5. ๋งˆ์ดํŽ˜์ด์ง€ (url : `/mypage`) <br>
> ๋กœ๊ทธ์ธ๋œ ์‚ฌ์šฉ์ž์˜ ๊ณ„์ • ์ •๋ณด๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ํƒญ์ด๋ฏ€๋กœ ApplicationHeader๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ๋‚˜๋จธ์ง€ ๋‚ด์šฉ์€ MyPage ์ปดํฌ๋„ŒํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ Œ๋”๋งํ•ฉ๋‹ˆ๋‹ค.
### ์ปดํฌ๋„ŒํŠธ

Expand All @@ -149,3 +171,10 @@ $ npm run preview // ๋นŒ๋“œ ํ›„ ๋ฐฐํฌ ํ™˜๊ฒฝ์—์„œ์˜ ์‹คํ–‰
- KrNavBar

### ์ƒํƒœ ๊ด€๋ฆฌ

## ์ถ”๊ฐ€ ์š”๊ตฌ ์‚ฌํ•ญ
1. ์‚ฌ์šฉ์ž์˜ ์ผ์ •์— ๋Œ€ํ•œ ์‚ญ์ œ๋ฅผ ๋„˜์–ด ์ˆ˜์ • ๊ธฐ๋Šฅ
2. ์ถ”๊ฐ€์ ์ธ ์†Œ์…œ ๋กœ๊ทธ์ธ(ํŽ˜์ด์Šค๋ถ, ๊ตฌ๊ธ€ ๋“ฑ) ๊ตฌํ˜„
3. localStorage๋ฅผ ์ด์šฉํ•œ ๋กœ๊ทธ์ธ ์ •๋ณด ์ €์žฅ์€ ๋ณด์•ˆ์ƒ ์•„์‰ฌ์šด ์ ์ด ์žˆ์œผ๋‹ˆ cookie๋ฅผ ์ด์šฉํ•œ ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„
4. ๋น„๋กœ๊ทธ์ธ๋œ ์‚ฌ์šฉ์ž๋„ ํŠน์ • ์ง€์ ์„ ํด๋ฆญํ•˜๊ณ , ํ•ด๋‹น ์žฅ์†Œ ์ฃผ๋ฉด์˜ ๋ช…์†Œ ์ •๋ณด๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์œผ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Œ
5. MyPage ์ปดํฌ๋„ŒํŠธ์—๋Š” ๋”ฐ๋กœ footer ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์ง„ ์•Š์„ ๊ฒƒ์ธ์ง€?
4 changes: 2 additions & 2 deletions src/components/Japan/Exchange.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ function Exchange({ onChangeIsLoggedIn, onChangeUserId, onChangeDisplayName }) {
</div>
<h2>
{isKrwToJpy === true
? `100์—”์— ${krwToJpy['conversion_rate'] * 100} ์›์ž…๋‹ˆ๋‹ค!`
: `1000์›์— ${jpyToKrw['conversion_rate'] * 1000} ์—”์ž…๋‹ˆ๋‹ค!`}
? `100์—”์— ${Math.floor(krwToJpy['conversion_rate'] * 100)} ์›์ž…๋‹ˆ๋‹ค!`
: `1000์›์— ${Math.floor(jpyToKrw['conversion_rate'] * 1000)} ์—”์ž…๋‹ˆ๋‹ค!`}
</h2>
</div>
</div>
Expand Down

0 comments on commit 52e7ad6

Please sign in to comment.