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

新規事業を支える技術 / Technology for new business

Sansan
December 15, 2018

新規事業を支える技術 / Technology for new business

■イベント
Developers Boost 2018
https://event.shoeisha.jp/devboost/20181215

■登壇概要
タイトル:新規事業を支える技術
登壇者:DSOC Development Group 木田悠一郎

▼Sansan Builders Box
https://buildersbox.corp-sansan.com/

Sansan

December 15, 2018
Tweet

More Decks by Sansan

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • ໦ా༔Ұ࿠ (mokuo) • Twitter : @mokuo_ • 92೥ੜ·Ε

    • ݸਓ։ൃͨ͠Γϒϩάॻ͍ͨΓ͠·͢ • ϙουΩϟετ΍ϥδΦΛΑ͘ௌ͖·͢
  2. ܦྺ • 2018೥2݄ : Sansanגࣜձࣾೖࣾ • Eight ͷϑϩϯτΤϯυɾαʔόʔαΠυͷ։ൃ • React

    + Redux, Ruby on Rails • 2018೥6݄ : DSOC ʹҟಈ • GEESʢ໊ࢗͷσʔλԽγεςϜʣͷ։ൃɾӡ༻ • Ruby on Rails • ৽نࣄۀ։ൃ <= ຊ೔ͷ͓࿩ʂʂ
  3. ΞδΣϯμ • ͸͡Ίʹ • ৽نࣄۀ։ൃΛࢧ͑Δٕज़ • ཁ݅ͷચ͍ग़͠ • ։ൃϓϩηεͷબఆ •

    ΞʔΩςΫνϟઃܭ • ٕज़બఆ • DBઃܭ • APIఆٛ • ը໘ઃܭ • ϑϩϯτΤϯυ࣮૷ • αʔόʔαΠυ࣮૷ • ·ͱΊ
  4. ͬ͘͟Γͨ͠ݟੵ΋Γ • தؒ͘Β͍ͷ೉қ౓ͷλεΫΛ 3 ϙ Πϯτͱ͢Δ • 1, 3, 5,

    8, 13 ͱϙΠϯτΛ෇͚ͯ૬ର ݟੵ΋ΓΛ࣮ࢪ • Πϝʔδ͠΍͍͢λεΫΛબͼɺԿ ͔͔࣌ؒΓͦ͏͔ݟੵ΋ͬͯΈΔ • શମͰ͔͔Δ೔਺Λܭࢉ
  5. ܗࣜʹͩ͜ΘΓա͗ͳ͍ • ઐ໳༻ޠΛ࢖Θͳ͍ • ϓϩμΫτόοάϩά => λεΫ • εϓϦϯτϓϥϯχϯά =>

    ܭը • ϨτϩεϖΫςΟϒ => ;Γ͔͑Γ • ϓϩμΫτόοΫϩά͸εϓϨουγʔτͰ؅ཧ • ϓϩμΫτΦʔφʔ͕࢖͍΍͍͢΋ͷΛ࠾༻ • υϥοά&υϩοϓͰॱ൪ΛೖΕସ͑ΒΕΔ͠ɺࠓͷͱ͜Ζ͸ࠔ͍ͬͯͳ͍
  6. SPA + Firebase • JavaScript ͷॲཧ͸ඞཁ • ϑϩϯτΤϯυͰҰఆҎ্ͷॲཧΛ͢ΔͳΒ SPA ʹͯ͠͠·ͬ

    ͨํ͕ྑ͍ʢͱࢥ͍ͬͯΔʣ • ͔͠͠ɺϑϩϯτΤϯυͱαʔόʔαΠυͷ྆ํΛ࣮૷͢Δ͜ͱ ͸޻਺͕͔͔Δ • Cloud Firestore ͳΒϑϩϯτΤϯυ͔Β௚઀ॻ͖ࠐΊΔ • ଟ͘ͷ API ͸࣮૷͢Δඞཁ͕ͳ͘ͳΔ…͸ͣɻ
  7. ۩ମతʹ͸ • Firebase Authentication Ͱೝূ • Cloud Firestore, Cloud Storage

    ΁ͷॻ͖ࠐΈ Λݕ஌ͯ͠ɺCloud Functions Λ૸ΒͤΔ͜ͱ ͕Ͱ͖Δ • όοΫΤϯυͷॲཧ͸τϦΨʔத৺ʹ͢Δ
  8. Google App Engine • GCP ͕ఏڙ͢Δ PaaS • ϦΫΤετʹԠͯࣗ͡ಈͰεέʔϧ •

    ίϚϯυҰൃͰσϓϩΠͨ͠Βಈ͘ • Function ୯ҐͰͳ͘ɺαʔϏε୯ҐͰσϓϩΠ • FaaS ʹൺ΂ͯɺෳࡶͳॲཧʹ΋ରԠ͠΍͍͢͸ͣ
  9. جຊͷߟ͑ํ • αʔϏεؒͷ΍ΓͱΓ͸جຊ Cloud Tasks Λܦ༝ • DB ͸Ҿ͖ଓ͖ Cloud

    Firestore Λ࠾༻ • ϑϩϯτΤϯυ͔Β௚઀ DB Λ৮Δ͜ͱ͸ͤͣɺAPIܦ༝Ͱ ΞΫηεͤ͞Δ • কདྷతʹ͸ɺ௚઀৮Δ͜ͱ΋͋Δ͔΋͠Εͳ͍ʢ؅ཧը໘ͱ ͔ʁʣ • ෳ਺αʔϏεͰίϨΫγϣϯ͸ڞ༗͠ͳ͍
  10. Cloud Firestore Λબ୒ ެࣜυΩϡϝϯτ ↓↓ • Cloud Firestore ͱ Cloud

    Datastore ͷબ୒ > Cloud Firestore ͸ɺCloud Datastore ͷϦϒϥϯσΟϯάͱͳΔ ࣍ظϝδϟʔ όʔδϣϯͰ͢ • Cloud Firestore ΁ͷࣗಈΞοϓάϨʔυ • Cloud Datastore ͸ Cloud Firestore ʹΞοϓάϨʔυ͞ΕΔ༧ఆ
  11. Cloud Firestore ͷϞʔυ • Cloud Firestore ͱ Cloud Datastore ͷબ୒

    • Cloud Firestore in Datastore mode • Cloud Firestore in Native mode • ͦΕͧΕͷಛੑΛݟͯ൑அ
  12. ࢖༻͢Δओͳ GCP ͷαʔϏε • App Engine • Cloud Storage •

    Cloud Pub/Sub • Cloud Tasks • Cloud Firestore
  13. React + Redux • Eight Ͱ React Λ࢖͍ͬͯΔ͜ͱ΋͋Γɺ׳Ε͍ͯΔɻ ݸਓతʹ Vue

    ΑΓ޷͖ • React ͳΒ Redux, Vue ͳΒ Vuex ͳͲɺFlux ΞʔΩς ΫνϟΛ࢖͏͜ͱ͸ɺ΄΅ඞਢͩͱࢥ͍ͬͯΔ • ΞϓϦέʔγϣϯશମͰ State Λڞ༗Ͱ͖Δ • ڊେͳ JSON Λ͍࣋ͬͯΔΠϝʔδ
  14. TypeScript • ࢓ࣄ΍ݸਓ։ൃͰ JS Λॻ͍͍ͯͯɺܕ͕ͳ͍ਏ͞Λײ͍ͯ͡ ͨ • Promise ͕ೖͬͯ͘Δͱɺ΋͸΍Կ͕ฦ͖͍ͬͯͯΔͷ͔Θ ͔Βͳ͘ͳͬͨΓ͢Δ

    • ࣮ߦ࣌ΤϥʔͰ௚͢ɺΛ܁Γฦ͢ • TypeScirpt ΛೖΕͯɺIDE తͳԸܙΛड͚ΒΕΔ • ΋ͪΖΜɺٯʹେมͳ͜ͱ΋͋Δ
  15. GAE ͷ2छྨͷ؀ڥʹ͍ͭͯ • Standard Environment • ݱ࣌఺Ͱ͸ Python, Java, PHP,

    Go, Node.js ͷΈ • Flexible Environment • ্هʹՃ͑ͯ .NET, Ruby, ΧελϜϥϯλΠϜ ͕࢖͑Δ
  16. ֤؀ڥͷൺֱʢൈਮʣ • https://cloud.google.com/appengine/docs/the-appengine-environments ػೳ 4UBOEBSE &OWJSPONFOU 'MFYJCMF &OWJSPONFOU Πϯελϯεىಈ࣌ؒ ϛϦඵ

    ෼ ϦΫΤετͷ࠷େλΠϜ Ξ΢τ ඵ ෼ εέʔϦϯά खಈɺجຊɺࣗಈ खಈɺࣗಈ ΧελϚΠζՄೳͳॲཧ ελοΫ º ˓ʢ%PDLFSpMFͷΧε λϚΠζͰߏஙʣ ྉۚ Πϯελϯε࣌ؒ ʹجͮ͘ W$16ɺϝϞϦɺӬଓσ ΟεΫͷ࢖༻ྔʹجͮ͘
  17. Node.js Λ࠾༻ • ݸਓతʹɺRuby ͷ࣍ʹಘҙͳݴޠ͸ JS • Node.js ΋ AWS

    Lambda, Google Cloud Functions Ͱ͸࢖ͬͨ͜ͱ͕͋Δ • ࠓޙδϣΠϯ͢Δϝϯόʔʹ͸ɺϑϩϯτΤϯ υ΋αʔόʔαΠυ΋ݟͯ΄͍͠ͱ͍͏ࢥ͍΋ ͋Δ
  18. swagger-node • Swagger Ͱ API ఆٛΛॻ͘ͱɺϧʔςΟϯά΍ϦΫΤε τͷόϦσʔγϣϯΛͯ͘͠ΕΔ • ࣮ଶ͸ swagger-express-mw

    • ϝϯς͕ߦ͖ಧ͍͍ͯͳ͍ײ͡΋͢ΔͷͰɺཁ஫ҙ • swagger editor ΋ೖ͍ͬͯΔ͕ɺόʔδϣϯ͕ݹ͍ • swagger project create ίϚϯυ͸ࢀߟఔ౓ʹ࢖༻͢Δ
  19. RESTful API • Rails ͷϧʔςΟϯάΛࢀߟ • Rails ͷϧʔςΟϯά͸ڧྗ • `resouces:

    photos` ͷΑ͏ʹॻ͚ͩ͘ͰɺϦ ιʔεϕʔεͷنଇతͳϧʔςΟϯά͕Ͱ͖Δ • Rails ͷϧʔςΟϯά | Rails ΨΠυ ࢀর
  20. GraphQL ͸ʁ • ϑϩϯτ <=> αʔόʔؒ͸ GraphQL Ͱ΋ྑͦ͞ ͏ •

    طʹɺࣗ෼ͱͯ͠΋෦ॺͱͯ͠΋͋·Γ࢖ͬͯ͜ͳ ͔ٕͬͨज़Λ੝ΓࠐΜͰ͍Δ • GCP, TypeScript, Node.js, SPA, Atomic Design… • ࠓճ͸ݟૹΓ
  21. Storybook • Storybook Λ࢖͏͜ͱͰɺίϯϙʔωϯτ͝ͱʹಈ࡞ ֬ೝ͠ͳ͕Β։ൃͰ͖Δ • Storyshot ͰεφοϓγϣοτΛऔΔ͜ͱ΋Ͱ͖Δ • Storyshot

    ʹؔͯ͠͸ɺTypeScript, Next.js ΋࢖༻͠ ͍ͯΔ͔Β͔ɺΤϥʔ͕ग़ͯղফͰ͖ͣ… • ଞͷํ๏Λݕ౼த
  22. Actions • Flux Standard Action (FSA) ʹै͏͜ͱ͕ਪ঑͞Εͯ ͍Δ • FSA

    ʹԊͬͨϥΠϒϥϦ͸͍͔ͭ͋͘Δ • redux-actions Λ࢖͓͏ͱ͕ͨ͠ɺTypeScript ͱ ૬ੑ͕ѱ͔ͬͨʢܕఆ͕ٛෆ׬શʣ • typescript-fsa Λ࠾༻
  23. Reducers • Immutable.js Λ࢖༻ • State ͕ωετͨ͠Γෳࡶʹͳͬͯ͘ΔͱɺReducer ͕ େมͳ͜ͱʹͳΔ •

    Object.assign() ΋ਏ͍ • Immutable.js ͷ Record Λ࢖͏͜ͱͰɺϞσϧʹϝ ιουΛੜ΍ͯ͠ Reducer ΛγϯϓϧʹͰ͖Δ
  24. ࣗಈςετ • Jest Λ࠾༻ • RSpec ϥΠΫͳͷͰɺRuby ग़਎ऀ͸ೃછΈ΍͍͢͸ͣ • ΦʔϧΠϯϫϯͳͷ΋ྑ͍

    • Actions ͱ Reducers ͷςετ͸ඞͣॻ͘ • ίϯϙʔωϯτ΋ɺϩδοΫΛॻ͍ͨϝιου͸ςετ͢Δ • ίϯϙʔωϯτࣗମͷςετ͸໛ࡧத
  25. جຊํ਑ • Swagger Ͱ API ఆٛ • ίϯτϩʔϥʔʹϝιουΛ࣮૷ • swagger-node

    ͰϧʔςΟϯάɺϦΫΤετͷόϦσʔγϣϯΛ͠ ͯ͘ΕΔ • DB ·ΘΓͷॲཧ͸ϞσϧͰߦ͏ • ෳࡶͳॲཧ͸Ϟδϡʔϧʹ੾Γग़͢ • ೝূɺΤϥʔϋϯυϦϯάͳͲ͸ middleware Ͱߦ͏
  26. ࣗಈςετ • ϑϩϯτΤϯυͱಉ͘͡ Jest • Jest ͸σϑΥϧτͰฒߦͰςετ͕૸ΔͷͰૣ͍͕… • CI ༻ͷϓϩδΣΫτΛ࡞ͬͯ͸͍Δ͕ɺFirestore

    ͸Ұͭ • ςετಉ͕࢜ׯবͯ͠ɺͨ·ʹམͪΔ => ྑ͘ͳ͍ • ରԠࡦ͸ݕ౼த • কདྷతʹ͸ E2E ςετ΋͋Δఔ౓ࣗಈԽ͍ͨ͠