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

2022年に始めるPerlでWebサービス開発(趣味)

 2022年に始めるPerlでWebサービス開発(趣味)

120b74af626c2b23f954926ef68ac5d6?s=128

papix
PRO

June 09, 2022
Tweet

More Decks by papix

Other Decks in Technology

Transcript

  1. 2022೥ʹ࢝ΊΔ PerlͰWebαʔϏε։ൃ(झຯ) 2022/04/12 Kichijoji.pm #29 id:papix (@__papix__)

  2. ࣗݾ঺հ • papix (id:papix / @__papix__) • גࣜձࣾ͸ͯͳ WebΞϓϦέʔγϣϯΤϯδχΞ (2017೥ʙ)

    • ϒϩάMediaνʔϜ → ϚϯΨνʔϜ • Ұൠࣾஂ๏ਓJapan Perl Associationཧࣄ • ϒϩά: https://papix.hatena(blog.(com|jp)|diary.jp)
  3. ࢲࣄͰ͕͢...

  4. υϝΠϯΛങ͍·ͨ͠

  5. ԿΛ࡞Δ? • υϝΠϯʹैͬͯ(?), ٕज़Ͱཱྀߦͷ৴པੑΛߴΊ͍ͨ • ϫʔέʔγϣϯ(લճ࿩͠·ͨ͠Ͷ!)Ͱ͸, ॓ͷ௨৴؀ڥ͕େࣄ • ňWi-Fi͋Γ·͢ʼnͱॻ͔Ε͍ͯͯ΋, ͦͷ඼࣭·Ͱ͸Θ͔Βͳ͍

    • docker pullͰ͖ͳ͔ͬͨΓ, Online MTG͕Ͱ͖ͳ͍඼࣭ͩͱࠔΔ • օͰ॓ͷ৘ใ(௨৴଎౓౳)ΛूΊΔαʔϏε͕͋ΔͱศརͰ͸?
  6. ͱ͜ΖͰ, • υϝΠϯͷߪೖΛ͖͔͚ͬʹ։ൃΛ࢝ΊͨͷͰ...

  7. ͜Ε͕ͦ͜ ňυϝΠϯۦಈʼn ։ൃ΍ʂ

  8. ʘϫοϋοϋʗ

  9. ͸͍

  10. Ͳ͏࡞Δ? • ň΍͸ΓGoͰGraphQLΛ࣮૷ͯ͠... Next.jsͰ...ʼn • ͔͠͠, ࢒೦ͳ͕ΒͲͪΒ΋༨Γಘҙͳٕज़ཁૉͰ͸ͳ͍ • ֶश͠ͳ͕Β࣮૷͢Δͷ͸ָ͍͠͠, ֶͼʹ΋ͳΔ

    • ͔͠͠, ͜ͷ։ൃ଎౓Ͱ͸Ӭԕʹ׬੒͠ͳ͍ͷͰ͸...?
  11. Done is better than perfect ׬ᘳΛ໨ࢦ͢ΑΓ, ·ͣऴΘΒͤΖ

  12. ·ͣ͸ಘҙͳٕज़Ͱ! • ·ͣ͸Ұ௨Γ׬੒ͤͯ͞, ͔ͦ͜Βڵຯͷ͋Δٕज़Λ੝Γࠐ΋͏! • Ͱ͋ΔͳΒ͹, ΍͸ΓҰ൪ಘҙͰ࢖͍׳Εٕͨज़Ͱ࢝ΊΔ΂͖ • ͱ͍͏Θ͚Ͱ...

  13. Perl

  14. ຊ୊ • ͱ͍͏Θ͚Ͱ, झຯͰ! PerlͰ! WebApp։ൃ, ࢝Ί·ͨ͠ • ·ͩ·ͩ։ൃணखͨ͠͹͔ΓͰ͕͢, ͲͷΑ͏ͳߏ੒ʹ͔ͨ͠࿩ͦ

    ͏ͱࢥ͍·͢ • ߹ཧੑ͸օແͰ, ׬શʹझຯʹৼΓ੾͍ͬͯΔ఺ྃ͝ঝ͍ͩ͘͞ • ͪͳΈʹίʔυωʔϜ͸ňMoonsideʼnͰ͢
  15. cpan fi le requires 'Amon2', '== 6.15'; requires 'Aniki', '==

    1.06'; requires 'Cookie::Baker', '== 0.11'; requires 'Crypt::JWT', '== 0.034'; requires 'DBD::mysql', '== 4.050'; requires 'DBIx::Schema::DSL', '== 1.0000'; requires 'Digest::HMAC', '== 1.04'; requires 'Digest::SHA', '== 6.02'; requires 'Furl', '== 3.14'; requires 'Gazelle', '== 0.49'; requires 'HTML::FillInForm::Lite', '== 1.15'; requires 'JSON::XS', '== 4.03'; requires 'Module::Find', '== 0.15'; requires 'Module::Functions', '== 2.1.3'; requires 'Plack::Middleware::ReverseProxy', '== 0.16'; requires 'Plack::Middleware::Session', '== 0.33'; requires 'Plack::Session::Store::Redis', '== 0.05'; requires 'Redis', '== 1.999'; requires 'Router::Boom', '== 1.03'; requires 'Smart::Args', '== 0.14'; requires 'Text::Xslate', '== v3.5.9'; requires 'Time::Moment', '== 0.44'; on development => sub { requires 'Anego', '== 0.02'; }; on test => sub { requires 'Test2', '== 1.302188'; requires 'Test::WWW::Mechanize::PSGI', '== 0.39'; }; جຊతʹ࠷৽൛Λ࢖͏Α͏, όʔδϣϯݻఆ͍ͯ͠Δ
  16. Amon2 / Text::Xslate • WAF/Template Engine͸ͦΕͧΕAmon2/Text::XslateΛબఆ • Amon2͸࠷ۙ͝ແࠫଡͰ͕͢, લ͸݁ߏ࢖͍ͬͯͯ, ·ͩ·ͩهԱ͕

    ͋ΔͨΊ • Amon2Λ࠾༻͢ΔͳΒ౰વTemplate Engine͸Text::XslateͰ • Syntax͸Text::Xslate::Syntax::TTerseʹ͠·ͨ͠
  17. Aniki • ORM͸TengͱAnikiͰ೰Έ·͕ͨ͠, Anikiʹ͠·ͨ͠ • Tengͱࣅͨ࢖͍৺஍Ͱ, SchemaΛDBIx::Schema::DSLͰॻ͚ͨΓ, σϑΥϧτͰrelationshipʹରԠ͍ͯ͠Δͷ΋خ͍͠

  18. Anego • ຊ೔ͷझຯ࿮ • ňAniki͕͋ΔͳΒAnego͕͋ͬͯ΋͍͍͡Όͳ͍!ʼn • DBIx::Schema::DSLͰఆٛͯ͠, ͍͍ײ͡ʹmigrationͰ͖Δ • schemaมߋ࣌ͷALTER

    TABLEΛදࣔͨ͠ΓͰ͖Δ
  19. Authentication • Firebase Authentication • Ϣʔβʔ؅ཧपΓ͸ࣗલͰ؅ཧͨ͘͠ͳ͍ • Firebase AuthenticationͰ؅ཧͯ͠, PerlͷApp͔Βར༻͢Δ

    • ೝূ͸Firebase, ͦΕΛݩʹPerlͷAppͰηογϣϯΛ༻ҙ • ࢀߟจݙ: https://diary.ssig33.com/posts/535 • ͪ͜ΒͰ͸RailsͰͷࣄྫ͕ͩ, ಉ͡Α͏ͳ͜ͱ͸PerlͰ΋ग़དྷΔ
  20. CSRF Defender • Amon2ͷ৔߹, جຊ͸HTTP::Session2ʹ͓೚ͤ • ࣗಈͰ๷ޚ༻ͷtokenΛൃߦͯ͘͠ΕΔ • ͷͰ, ޙ͸ͦΕΛݩʹνΣοΫ͢Δ͚ͩ

    • ԿͳΒ, νΣοΫͷ࣮૷΋Amon2͕༻ҙͯ͘͠Ε͍ͯΔ
  21. CSRF Defender • ࠓճ͸ηογϣϯετΞʹRedisΛ࢖͏͜ͱʹͨ͠(झຯ) • ͕, HTTP::Session2::ServerStore͸Cache::Memcached::FastΛ૝ఆ ͍ͯ͠Δ • ݁ہ,

    Amon2ͷ࣮૷Λࢀߟʹͭͭ͠ಠࣗʹ࣮૷͢Δ͜ͱʹͨ͠ • RedisʹΑΔSession؅ཧ͸Plack::Session::Store::Redisʹ೚ͤΔ • ޙ͸ͦΕΛ࢖ͬͯtokenΛൃߦͨ͠Γ...
  22. ·ͱΊ

  23. ·ͱΊ • WebαʔϏεΛ࡞Δͷ͸΍ͬͺΓָ͍͠ • झຯͰ(1ਓͰ)։ൃ͢Δͱ༷ʑͳٕज़બఆΛ޷͖উखग़དྷΔ • ׂͱ׳Ε͍ͯΔݴޠ(?)Ͱ΋, ௐ΂ͯΈΔͱ৽͍͠ൃݟ΍ֶͼ͕͋Δ • ͪ·ͪ·։ൃΛਐΊͯ,

    ࣍͸ެ։, ӡ༻, վળͷϑϩʔ·Ͱճ͍ͨ͠
  24. ʘ WebαʔϏε։ൃ͕޷͖ͳ஥ؒΛืू͍ͯ͠·͢!!! ʗ https://hatenacorp.jp/recruit