Upgrade to Pro — share decks privately, control downloads, hide ads and more …

NestJSがいい感じだった

 NestJSがいい感じだった

Gunmaweb#39のLT資料です。
なんとなく興味のあったNestJSを軽く触ってみてやっぱりいいなってなったのでいくつかのポイントをまとめています。

TsukasaSekiguchi

October 31, 2020
Tweet

More Decks by TsukasaSekiguchi

Other Decks in Technology

Transcript

  1. /FTU+4͕͍͍ײͩͬͨ͡
    2020/10/31
    Gunma.web #39
    ؔޱ ࢘

    View full-size slide

  2. ࣗݾ঺հ
    ໊લ:
    ؔޱ࢘
    SNS:
    GitHub: TsukasaGR
    Twitter: TsukasaGr
    NewsPicks: ؔޱ࢘
    ࠲ӈͷ໏
    ࣗ෼ͷͨΊʹɺଞਓʹਚ͘͢
    ࢓ࣄ:
    αϥϦʔϚϯ: SIerͰडୗ։ൃ
    ϑϦʔϥϯε: ελʔτΞοϓͷWebΤϯδχΞ
    ࠷ۙ৮ͬͯΔ΋ͷ:
    Javascript/Typescript(Vue.js/Nuxt.js/NestJS/React)ɺCordova

    View full-size slide

  3. /FTU+4ͱ͸ʁ

    View full-size slide

  4. /PEFKTͷ͍͍ײ͡ͷϑϨʔϜϫʔΫ
    w /PEFKT൛ͷ-BSBWFM΍3BJMTΈ͍ͨͳϑϧελοΫ'8
    w 5ZQF4DSJQU੡
    w "OHVMBSΛΠϯεύΠΞͯͭ͘͠ΒΕͨ΋ͷ
    w ͪ͜ΒͷεϥΠυʹ͔ͬ͠Γॻ͔Ε͍ͯ·͢
    https://speakerdeck.com/potato4d/what-is-nestjs-number-nestjs-meetup

    View full-size slide

  5. /PEFKT'8ͷݱঢ়

    View full-size slide

  6. ѹ౗తFYQSFTTҰڧ

    View full-size slide

  7. ͨͩ͠/FTU+4͕৳ͼ͖ͯͯΔ

    View full-size slide

  8. FYQSFTT͡Όμϝͳͷʁ

    View full-size slide

  9. FYQSFTTͷϓϩίϯ
    w 1SPT
    w ࠷௿ݶͷػೳ͚ͩͳͷͰ͍ܰ
    w αʔόʔϨεͰ౎౓ݺͼग़͢৔߹ͳΜ͔΋ศར
    w $POT
    w ࠷௿ݶͷػೳ͚ͩͰແ๏஍ଳͳͷͰɺͪΐͬͱෳࡶͳ͜ͱ΍Ζ
    ͏ͱ͢ΔͱͲΜͳॻ͖ํͰ΋Ͱ͖ͯ͠·͏
    w શ෦ࣗ෼Ͱॻ͔ͳ͍ͱ͍͚ͳ͍ '8Λ࢖ͬͯΔײ͕͋͡·Γͳ
    ͍

    View full-size slide

  10. FYQSFTTͷ࢖͍Ͳ͜Ζ
    w (PPE
    w ΤϯυϙΠϯτ͕͔ͭ͠ͳ͍"1* σϞ༻ͱ͔

    w αʔόʔϨεͷόοΫΤϯυ ىಈ͕͍ܰͷͰ

    w #BE
    w ΰϦΰϦʹ࣮૷͕ඞཁͳ"1*
    w ෳ਺ਓͰ։ൃ ͋Δఔ౓੍໿͕΄͍͠ͷͰ

    View full-size slide

  11. FYQSFTTͷ࢖͍Ͳ͜Ζ
    w (PPE
    w ΤϯυϙΠϯτ͕͔ͭ͠ͳ͍"1* σϞ༻ͱ͔

    w αʔόʔϨεͰར༻ ىಈ͕͍ܰͷͰ

    w #BE
    w ΰϦΰϦʹ࣮૷͕ඞཁͳ"1*
    w ෳ਺ਓͰ։ൃ ͋Δఔ౓੍໿͕΄͍͠ͷͰ

    ࠓ·Ͱͷ/PEFKT͸͕͜͜ऑ͔ͬͨ

    View full-size slide

  12. FYQSFTTͷ࢖͍Ͳ͜Ζ
    w (PPE
    w ΤϯυϙΠϯτ͕͔ͭ͠ͳ͍"1* σϞ༻ͱ͔

    w αʔόʔϨεͰར༻ ىಈ͕͍ܰͷͰ

    w #BE
    w ෳ਺ͷΤϯυϙΠϯτΛ࣋ͭ"1* ΄ͱΜͲͦ͏ͩΑͶ

    w ෳ਺ਓͰ։ൃ ͋Δఔ౓੍໿͕΄͍͠ͷͰ

    ࠓ·Ͱͷ/PEFKT͸͕͜͜ऑ͔ͬͨ

    /FTU+4͕͢΂ͯղܾͯ͘͠ΕΔʂ

    View full-size slide

  13. /FTU+4ͷ͍͍ײ͡ͳ
    ͱ͜Ζ
    ˞ͨ͘͞Μ͋ΔͷͰҰ෦͚ͩ

    View full-size slide

  14. %*ίϯςφ͕͍͍ײ͡
    w େ͖ͳొ৔ਓ෺͸.PEVMFT$POUSPMMFST4FSWJDFT 㲈1SPWJEFST

    w .PEVMFͰґଘؔ܎Λ·ͱΊɺඞཁͳ.PEVMFΛ౎౓ݺͼग़͢
    w ٯʹ.PEVMFʹͳ͍΋ͷΛ௚઀ݺͼग़ͤͳ͍ (MPCBMʹ͢Ε͹ผ

    View full-size slide

  15. %*ίϯςφ͕͍͍ײ͡
    w େ͖ͳొ৔ਓ෺͸.PEVMFT$POUSPMMFST4FSWJDFT 㲈1SPWJEFST

    w .PEVMFͰґଘؔ܎Λ·ͱΊɺඞཁͳ.PEVMFΛ౎౓ݺͼग़͢
    w ٯʹ.PEVMFʹͳ͍΋ͷΛ௚઀ݺͼग़ͤͳ͍ (MPCBMʹ͢Ε͹ผ

    3PPUϞδϡʔϧ 6TFSϞδϡʔϧ
    ͜ͷΞϓϦ͸6TFS$POUSPMMFSΛ
    ࢖͏͜ͱ͕Ͱ͖Δ
    w 6TFS$POUSPMMFS͸ҎԼΛ࢖͏͜ͱ͕Ͱ͖Δ
    w 6TFS4FSWJDF
    w 4VC.PEVMF഑Լͷ֤छαʔϏε
    w 6TFS4FSWJDF͸ҎԼΛ࢖͏͜ͱ͕Ͱ͖Δ
    w 4VC.PEVMF഑Լͷ֤छαʔϏε
    4VCϞδϡʔϧ

    View full-size slide

  16. %*ίϯςφ͕͍͍ײ͡
    w ґଘੑͷ஫ೖ͸ίϯετϥΫλͰఆٛͰ͖Δ
    w ্ॻ͖΋Ͱ͖ΔͷͰ͓࡞๏ʹଇͬͯॻ͚ͩ͘Ͱࣗવͱςελϒϧ
    ʹͳΔ

    View full-size slide

  17. %*ίϯςφ͕͍͍ײ͡
    w ґଘੑͷ஫ೖ͸ίϯετϥΫλͰఆٛͰ͖Δ
    w ্ॻ͖΋Ͱ͖ΔͷͰ͓࡞๏ʹଇͬͯॻ͚ͩ͘Ͱࣗવͱςελϒϧ
    ʹͳΔ
    6TFS$POUSPMMFS
    6TFS$POUSPMMFS಺Ͱ
    ͸zUIJTVTFS4FSWJDFzͱͯ͠ѻ͑Δ
    σϑΥϧτͰ͸6TFS4FSWJDFΛ஫ೖ͍ͯ͠Δ͕ɺ
    ςετ࣌ͷΈϞοΫʹ͢Γସ࣮͑ͯߦ͢Δ͜ͱ͕
    Ͱ͖Δ
    ςετ

    View full-size slide

  18. ϧʔςΟϯά͕͍͍ײ͡
    w Ξϊςʔγϣϯ σίϨʔλ
    ͰϧʔςΟϯάΛઃఆͰ͖Δ
    w ϑΝΠϧΛ։͘ͱ͙͢ʹύε͕Θ͔ΔͷͰՄಡੑ˕

    View full-size slide

  19. ϧʔςΟϯά͕͍͍ײ͡
    w Ξϊςʔγϣϯ σίϨʔλ
    ͰϧʔςΟϯάΛઃఆͰ͖Δ
    w ϑΝΠϧΛ։͘ͱ͙͢ʹύε͕Θ͔ΔͷͰՄಡੑ˕
    VTFSTΛࢦఆ͍ͯ͠ΔͷͰɺ͜ͷ
    $POUSPMMFS಺ͷύε͸
    IUUQTYYYDPNVTFSTYYY
    ʹͳΔ
    IUUQTYYYDPNVTFST
    IUUQTYYYDPNVTFST

    View full-size slide

  20. ϗοτϦϩʔυ͕͍͍ײ͡
    w lZBSOTUBSUEFWz͢Ε͹มߋΛ͙͢ʹ൓өͰ͖Δ
    w ϑϩϯτͷؾ࣋ͪΑ͞Λ"1*࣮૷Ͱ΋ମײͰ͖Δ

    View full-size slide

  21. ϗοτϦϩʔυ͕͍͍ײ͡
    w lZBSOTUBSUEFWz͢Ε͹มߋΛ͙͢ʹ൓өͰ͖Δ
    w ϑϩϯτͷؾ࣋ͪΑ͞Λ"1*࣮૷Ͱ΋ମײͰ͖Δ

    View full-size slide

  22. ϚΠάϨʔγϣϯ͕͍͍ײ͡
    w &OUJUZσίϨʔλΛॻ͍ͨϑΝΠϧΛ༻ҙ͓͚ͯͩ͘͠
    w ͋ͱ͸zZBSOTUBSUEFWz͢Ε͹ࣗಈͰ%#ʹ൓ө͞ΕΔ
    w ࣗಈखಈ੾ସ͸ઃఆͰมߋͰ͖Δ

    View full-size slide

  23. ϚΠάϨʔγϣϯ͕͍͍ײ͡
    w &OUJUZσίϨʔλΛॻ͍ͨϑΝΠϧΛ༻ҙ͓͚ͯͩ͘͠
    w ΋ͪΖΜVQEPXOͷΑ͏ͳϚΠάϨʔγϣϯ΋ֻ͚Δ
    w ͋ͱ͸zZBSOTUBSUEFWz͢Ε͹ࣗಈͰ%#ʹ൓ө͞ΕΔ
    w ࣗಈखಈ੾ସ͸ઃఆͰมߋͰ͖Δ

    View full-size slide

  24. 03.͕͍͍ײ͡
    w 3BJMTͰ͍͏"DUJWF3FDPSEɺ-BSBWFMͰ͍͏&MPRVFOUͷΑ͏ͳ
    03.Λॻ͚Δ

    View full-size slide

  25. 03.͕͍͍ײ͡
    w 3BJMTͰ͍͏"DUJWF3FDPSEɺ-BSBWFMͰ͍͏&MPRVFOUͷΑ͏ͳ
    03.Λॻ͚Δ

    View full-size slide

  26. όϦσʔγϣϯ͕͍͍ײ͡
    w σίϨʔλͰόϦσʔγϣϯఆٛͰ͖Δ
    w ࣗ࡞όϦσʔγϣϯ΋࣮૷Ͱ͖Δ

    View full-size slide

  27. όϦσʔγϣϯ͕͍͍ײ͡
    w σίϨʔλͰόϦσʔγϣϯఆٛͰ͖Δ
    w ࣗ࡞όϦσʔγϣϯ΋࣮૷Ͱ͖Δ

    View full-size slide

  28. 4XBHHFS6*͕͍͍ײ͡
    w l!OFTUKTTXBHHFSzͱ͍͏ެࣜύοέʔδ͕༻ҙ͞Ε͍ͯΔ
    w σίϨʔλΛॻ͚ͩ͘Ͱ4XBHHFS6*ʹࣗಈ൓ө͞ΕΔ

    View full-size slide

  29. 4XBHHFS6*͕͍͍ײ͡
    w l!OFTUKTTXBHHFSzͱ͍͏ެࣜύοέʔδ͕༻ҙ͞Ε͍ͯΔ
    w σίϨʔλΛॻ͚ͩ͘Ͱ4XBHHFS6*ʹࣗಈ൓ө͞ΕΔ
    Ϩεϙϯεఆٛ
    ϓϩύςΟఆٛ
    ͓ͳ͡Έͷ4XBHHFS6*

    View full-size slide

  30. ͦͷଞ΋͍͍ײ͡
    w ೝূ
    w ϛυϧ΢ΣΞ
    w /P42-
    w (SBQI2-
    w H31$
    w ͳͲͳͲ৭ʑͳ΋ͷΛެࣜύοέʔδܦ༝Ͱར༻Ͱ͖Δ

    View full-size slide

  31. όοΫΤϯυ΋+4 54
    ͷ࣌୅͕དྷ͔ͨ΋
    w αʔόʔϨεͰϥΠτͳόοΫΤϯυͰ͋Ε͹FYQSFTTͷར༻͕
    ଟ͍͕ɺຊ֨తͳ3FTU(SBQI2-"1*Λͭ͘Ζ͏ͱ͢Δͱ(P
    -BSBWFM3BJMTͳͲ͕·ͩ·ͩओྲྀͳΑ͏ʹײ͍ͯ͡Δ
    w /FTU+4ͷొ৔ͰҰؾʹόοΫΤϯυ΋+4 54
    ͷ࣌୅͕དྷΔ͔΋
    ͠Εͳ͍
    w ϑϩϯτΤϯδχΞ΋ڠྗ͠΍͍͢ ಛʹ"OHVMBSͩͱ
    ͷͰϚδ
    Ͱ͋Δ͔΋͠Εͳ͍
    w ࠓճͭͬͨ͘αϯϓϧ͸ͪ͜Βʹ্͛ͯ·͢
    https://github.com/TsukasaGR/nest-example

    View full-size slide

  32. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View full-size slide