๐Ÿƒ๐Ÿปโ€โ™‚๏ธํ”Œ๋žซ์•„์ด์–ธ ์Šค์ฟจ 2๋‹จ๊ณ„ ํ”„๋กœ์ ํŠธ

3935 ๋‹จ์–ด beginnersjavascriptreactwebdev

์†Œ๊ฐœ



๋ฐ˜์‘์— ๋Œ€ํ•œ ์ฐฌ๊ฐ€

React๋Š” ๋ฐ”๋‹๋ผ JavaScript์™€ ๋น„๊ตํ•  ๋•Œ ์‹ ์„ ํ•œ ๊ณต๊ธฐ์ž…๋‹ˆ๋‹ค.

React์˜ ๊ตฌ์„ฑ ์š”์†Œ ๊ธฐ๋ฐ˜ ๊ตฌ์กฐ์™€ ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ๋ฐฐ์šฐ๊ณ  ํ™œ์šฉํ•˜๋ฉด์„œ ์ €๋Š” Flatiron School ๋ถ€ํŠธ์บ ํ”„์—์„œ ๊ฐ€์žฅ ๊ฐ•๋ ฅํ•œ ํž˜์„ ์–ป์—ˆ๋‹ค๊ณ  ๋Š๊ผˆ์Šต๋‹ˆ๋‹ค. JavaScript๋กœ ๋‚ด๊ฐ€ ์•Œ๊ณ  ์žˆ๋Š” ๊ฒƒ(๋‚ด๊ฐ€ ๊ธฐ์–ตํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๋˜ ๊ฒƒ๋ณด๋‹ค ๋” ๋งŽ์ด!)์„ ํ™•์ธํ•˜๊ณ  React์˜ ํž˜์„ ํ™œ์šฉํ•˜์—ฌ ์ฝ”๋”ฉ์„ ๋” ๋ฐœ์ „์‹œํ‚ค๋Š” ๊ฒƒ์— ๊ฐ์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค.

๋ฐฐ๊ฒฝ



๋ฌธ์ œ ํ•ด๊ฒฐ

์ €๋Š” ์ด ํ”„๋กœ์ ํŠธ์—์„œ ๋ฌธ์ œ ํ•ด๊ฒฐ์— ์ดˆ์ ์„ ๋งž์ถ˜ ๋ฌด์–ธ๊ฐ€๋ฅผ ํ•˜๊ณ  ์‹ถ์—ˆ์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ ๊ทธ๋ฃน ๊ตฌ์„ฑ์›์€ ๋ชจ๋‘ ํ™œ๋™์ ์ด์—ˆ๊ณ  ์šฐ๋ฆฌ ์ค‘ ๋‘ ๋ช…์€ ์ฃผ์ž์˜€์Šต๋‹ˆ๋‹ค.

๋งŽ์€ API๋ฅผ ์‚ดํŽด๋ณธ ํ›„ ์šฐ๋ฆฌ๋Š” ๋„์‹œ์˜ ํ˜„์žฌ ๋‚ ์”จ๋ฅผ ๊ฐ€์ ธ์˜จ ๋‹ค์Œ ๋‚ ์”จ์™€ ๊ด€๋ จ๋œ ๋‹ค์–‘ํ•œ ์กฐ๊ฑด์— ๋Œ€ํ•ด ์˜ท์ด ๋‹ค ๋–จ์–ด์ง€๋Š” ๊ฒƒ์„ ์ œ์•ˆํ•˜๋Š” ์กฐ๊ฑด๋ถ€ ๋…ผ๋ฆฌ๋ฅผ ๋ Œ๋”๋งํ•˜๋Š” ์•ฑ์„ ๋งŒ๋“ค๊ธฐ๋กœ ๊ฒฐ์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ด ์˜๊ฐ์€ Runner's World ์žก์ง€์—์„œ ๋‚˜์˜จ ๋ช‡ ๋…„ ๋™์•ˆ ๋ƒ‰์žฅ๊ณ ์— ์žˆ๋˜ ์ข…์ด ํ•œ ์žฅ์—์„œ ๋‚˜์™”์Šต๋‹ˆ๋‹ค. ์–ด๋–ป๊ฒŒ ์•„๋‚ ๋กœ๊ทธ๋ฅผ ๋””์ง€ํ„ธ๋กœ ๋งŒ๋“ค ์ˆ˜ ์žˆ์„๊นŒ์š”?



ํ”„๋กœ์ ํŠธ



๋‚ด๊ฐ€ ๊ฐ€์žฅ ์ข‹์•„ํ•˜๋Š” ๊ธฐ์—ฌ

์ด ํ”„๋กœ์ ํŠธ์˜ ์ฃผ์š” ์ดˆ์  ์ค‘ ํ•˜๋‚˜๋Š” ์•ฑ์˜ ์กฐ๊ฑด๋ถ€ ๋…ผ๋ฆฌ ๋ฐ ์ถœ๋ ฅ์„ ๋ Œ๋”๋งํ•˜๊ณ  ๋””์ž์ธํ•˜๋Š” ๊ฒƒ์ด์—ˆ์Šต๋‹ˆ๋‹ค.

API ๋ฐ์ดํ„ฐ๋ฅผ ํ™œ์šฉํ•˜์—ฌ(๊ทธ๋ฆฌ๊ณ  ํŠนํžˆ "๋ง‘์Œ", "๊ฑฐ์˜ ํ๋ฆผ"๋“ฑ์˜ ๋‚ด๋Ÿฌํ‹ฐ๋ธŒ์— ๋Œ€ํ•ด ์ •ํ™•ํ•˜๊ฒŒ ๋ Œ๋”๋ง๋œ ๊ฒƒ์„ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด ์—ฌ๋Ÿฌ ๋„์‹œ๋ฅผ ํŒŒํ—ค์นœ ํ›„) ๋‚ด๊ฐ€ ์„ค์ •ํ•˜๋ ค๋Š” ์กฐ๊ฑด์„ ๋ชฉํ‘œ๋กœ ์‚ผ์•˜์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—๋Š” ๋‹ค์Œ ํ•ญ๋ชฉ์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.
  • ์Šต๋„
  • ์˜จ๋„
  • ๋ฐ”๋žŒ
  • ์กฐ๊ฑด/์„ค๋ช…(๊ฐ•์ˆ˜๋Ÿ‰, ํƒœ์–‘ ๋ฐ ์šด๋ฌด์™€ ๊ด€๋ จ๋จ)

  • ๋‹ค์Œ์€ ์Šต๋„์— ๋Œ€ํ•œ ์ฝ”๋“œ์˜ ์˜ˆ์ž…๋‹ˆ๋‹ค. ์™œ๋ƒํ•˜๋ฉด ์ค‘์„œ๋ถ€ ์ง€์—ญ์˜ ๋ชจ๋“  ์‚ฌ๋žŒ๋“ค์€ ์Šต๋„๊ฐ€ ์™ธ๋ถ€์—์„œ ์‹ค์ œ๋กœ ๋Š๋ผ๋Š” ๋”์œ„๋ฅผ ๋ง์นœ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค!

    function humidityCard () {
        if (humidity <= 50 && humidity >= 64 && temp >= 60 && temp <= 79) {
                return "It's humid today. Consider wearing lighter, breathable clothing.";
            } else if (humidity <= 65 && humidity >= 74 && temp >= 80 && temp <= 89) {
                return "The humidity could affect your run today, making it feel much hotter. Drink lots of water and wear lighter, breathable clothing.";
            } else if (humidity <= 75 && temp >= 90) {
                return "It's going to be a really hot one today with additional humidity! Drink lots of water, wear breathable clothing, and consider even running on the treadmill inside today."
            } else {
                return
            }
    }
    


    ์ด ๋ Œ๋”๋ง์„ ์‚ฌ์šฉํ•˜์—ฌ ์ฑ„์›Œ์งˆ ์˜ท๋„ ๋””์ž์ธํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ๋‚ ์”จ/์˜์ƒ ์นด๋“œ ์ค‘ ํ•˜๋‚˜์˜ ์•ž๋ฉด๊ณผ ๋’ท๋ฉด์˜ ์˜ˆ์ž…๋‹ˆ๋‹ค.




    ํ˜‘์—… ๋ฐ ํ”„๋กœ์ ํŠธ ๊ด€๋ฆฌ

    ์ˆ˜๋งŽ์€ ํ”„๋กœ์ ํŠธ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ์ง์—… ๊ฒฝ๋ ฅ์„ ๊ฐ–๊ฒŒ ๋œ ๊ฒƒ์€ ๋งค์šฐ ์šด์ด ์ข‹์•˜์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ์ด์— ๋Œ€ํ•œ ๋ช‡ ๊ฐ€์ง€ ๋„๊ตฌ์™€ ์ƒ๊ฐ์ž…๋‹ˆ๋‹ค. ๊ฒฝํ—˜์ด ํŒ€์—์„œ ์ž‘๋™ํ•˜๋Š” ๋ฐฉ์‹์— ๋ชจ๋“  ์ฐจ์ด๋ฅผ ๋งŒ๋“ค ๊ฒƒ์ž…๋‹ˆ๋‹ค.

    - ํŠธ๋ ๋กœ
    ๋ชจ๋“  ๊ฒƒ์— ๋Œ€ํ•œ ์‚ฌ๋ž‘์„ ์œ„ํ•ด ํ•˜๋ฃจ๋ฅผ ์‹œ์ž‘ํ•  ๋•Œ ๋ชฉํ‘œ๋ฅผ ์„ค์ •ํ•˜๊ณ , ํ•˜๋ฃจ ์ค‘๋ฐ˜์— ์žฌํ‰๊ฐ€ํ•˜๊ณ , ํ•˜๋ฃจ๊ฐ€ ๋๋‚  ๋•Œ ๋…ผ์˜ํ•˜์‹ญ์‹œ์˜ค.

    ์šฐ๋ฆฌ๋Š” ์ด๋Ÿฌํ•œ ๋ชฉํ‘œ๊ฐ€ ์ •์˜๋œ ์žฅ์†Œ๋ฅผ ๊ณต์œ ํ•˜๊ณ  ๋‹น๋ฉดํ•œ ๋” ํฐ ์ž‘์—…์„ ๋‹ฌ์„ฑํ•˜๋Š” ๋ฐ ๋ชจ๋‘ ๊ธฐ์—ฌํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•จ์œผ๋กœ์จ ๋งŽ์€ ์‹œ๊ฐ„๊ณผ ์ŠคํŠธ๋ ˆ์Šค๋ฅผ ์ ˆ์•ฝํ–ˆ์Šต๋‹ˆ๋‹ค. ์˜์‚ฌ ์†Œํ†ต์ด ์ „๋ถ€์ด๋ฉฐ Trello๋Š” ๊ท€ํ•˜๊ฐ€ ์˜์‚ฌ ์†Œํ†ต์„ ํ•˜๊ณ  ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ํ›Œ๋ฅญํ•œ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.



    - ๊ทธ๋ฃน ์ฝ”๋”ฉ
    ๋ง‰ํžˆ๋ฉด ์‚ฐ์ฑ…์„ ํ•˜๊ณ  ์ž ์‹œ ๋ฉˆ์ถ˜ ๋‹ค์Œ ์ „์ฒด ํŒ€์œผ๋กœ ๋Œ์•„์™€ ํฐ ํ™”๋ฉด์—์„œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜์‹ญ์‹œ์˜ค. ์šฐ๋ฆฌ๋Š” ์ด๊ฒƒ์„ ์—ฌ๋Ÿฌ ๋ฒˆ ํ–ˆ๊ณ  ์ ˆ๋ฐ˜์˜ ์‹œ๊ฐ„ ์•ˆ์— ๋ฌด์–ธ๊ฐ€๋ฅผ ์•Œ์•„๋‚ด๋Š” ๋ฐ ํฐ ์ฐจ์ด๋ฅผ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค.

    - ํž˜๋‚ด
    ๊ฐ€๋Šฅํ•œ ํ•œ ์ž์ฃผ git pull origin main์„ ์‚ฌ์šฉํ•˜๊ณ , ๋ฐ€๊ณ  ์žˆ์„ ๋•Œ ํŒ€๊ณผ ์†Œํ†ตํ•˜์„ธ์š”.

    ๋ณ‘ํ•ฉ ๋ฐ ์ถฉ๋Œ์„ ํ•จ๊ป˜ ์ˆ˜ํ–‰ํ•˜์—ฌ ๋™์ผํ•œ ์ฝ”๋“œ๋กœ ์ž‘์—…ํ•˜๊ณ  ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๊ฒฐ๊ตญ ์‹œ๊ฐ„๊ณผ ์ขŒ์ ˆ์„ ์ค„์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    ์‚ฌ์ด๋“œ ๋…ธํŠธ



    ์•Œ๋‹ค์‹œํ”ผ, ์šฐ๋ฆฌ๋Š” ๋กœ๊ทธ์ธ์„ ๊ฐ€์ง€๊ณ  ๋†€๋ฉด์„œ ๋ฐ์ดํ„ฐ์— ์—ฐ๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด ๋ฐ์ดํ„ฐ๊ฐ€ db.json ํŒŒ์ผ๋กœ ์ด๋™ํ•˜๋Š” ๋™์•ˆ ์ž์ฒด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๊ตฌ์ถ•ํ•˜๊ณ  3๋‹จ๊ณ„ ๋ฐ 4๋‹จ๊ณ„์—์„œ ๋กœ๊ทธ์ธ์œผ๋กœ ๋” ๋งŽ์€ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ๊ฒŒ ๋˜์–ด ๊ธฐ์ฉ๋‹ˆ๋‹ค.

    ๊ฒฐ๋ก 



    ์ €๋Š” ์ด ํ”„๋กœ์ ํŠธ, ์ œ ํŒ€, ์ œ๊ฐ€ ๋งŒ๋“  ๊ฒƒ์„ ์ž๋ž‘์Šค๋Ÿฝ๊ฒŒ ์ƒ๊ฐํ•˜๋Š” ์ œ ๊ฒฝํ—˜์„ ์ข‹์•„ํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ณ„์†ํ•ด์„œ ์•ฑ์„ ๊ฐœ์„ ํ•˜๊ธฐ๋ฅผ ๊ธฐ๋Œ€ํ•ฉ๋‹ˆ๋‹ค.

    ์ด ํ”„๋กœ์ ํŠธ๋ฅผ ํ†ตํ•ด ๋‚˜์—๊ฒŒ๋„ ๋ช‡ ๊ฐ€์ง€ ๋ฏธ๋ž˜ ๋ชฉํ‘œ๊ฐ€ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ๊นจ๋‹ซ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋ถ€ํŠธ์ŠคํŠธ๋žฉ์„ ๋ฐฐ์šฐ๊ณ  ์–ด์ฉŒ๋ฉด ์ตœ์ข… ํ”„๋กœ์ ํŠธ๋ฅผ ์„ค๊ณ„ํ•˜๊ธฐ ์‹œ์ž‘ํ•˜์—ฌ Ruby๋กœ ์ „ํ™˜ํ•  ๋•Œ React์— ๋Œ€ํ•ด ์•Œ๊ณ  ์žˆ๋Š” ๊ฒƒ์„ ์žƒ์ง€ ์•Š๋„๋ก ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

    ์ž์›



    ์ €์žฅ์†Œ๋ฅผ ๋ณต์ œํ•˜๊ณ  ํ”„๋กœ์ ํŠธhere๋ฅผ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค!

    ์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ