Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Amplify FW で爆速フロント開発
Search
yKicchan
June 23, 2020
Programming
0
120
Amplify FW で爆速フロント開発
LT資料
yKicchan
June 23, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
220
Benchmark
sysong
0
280
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
1
410
5つのアンチパターンから学ぶLT設計
narihara
1
140
童醫院敏捷轉型的實踐經驗
cclai999
0
210
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.5k
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
690
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
1
140
PipeCDのプラグイン化で目指すところ
warashi
1
240
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
1.8k
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
220
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
50
32k
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
Unsuck your backbone
ammeep
671
58k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.4k
Speed Design
sergeychernyshev
32
1k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Transcript
Amplify FW で爆速フロント開発 yKicchan 1 1
Who am I interface Me extends Person { name: "Yukiya
Murata"; twitter: "@yKicchan"; company: "Fenrir Inc."; job: "Web engineer"; favorite: " 花澤⾹菜" | "P5R" | " ピカチュウ"; skills: "React" | "Vue.js" | "Angular" | "PHP" | "Go"; } 2 2
Amplify ってなんぞ コマンド叩くだけで AWS の各種サービス作成をやってくれ る ライブラリ⼊れるだけで簡単に各種 AWS とフロントを接続 AWS
あんま触れないけどフロントは分かるって⼈は使える 逆にネイティヴや Web わからんけど AWS 分かる⼈は微妙 3 3
Amplify でできること⼀例 Cognito を利⽤した認証システム // ← 今⽇はこれする S3 + CloudFront
を利⽤した静的サイトホスティング API Gateway + Lambda で API 作成 REST, GraphQL 両対応 GitHub や CodeCommit と連携し CI/CD 4 4
とりあえず作ってみる 5 5
Required AWS Account Node.js v10.x or later npm v5.x or
later git v2.14.1 or later 6 6
Getting started $ npm install -g @aws-amplify/cli $ amplify configure
region と username 聞かれるので⼊⼒ ブラウザで IAM ユーザーの作成が求められるので作る 7 7
8 8
アクセスキー ID とシークレットアクセスキーを CLI に⼊⼒ 機密情報なので慎重に扱おう 9 9
Set up fullstack project $ npx create-react-app react-amplified --typescript $
cd react-amplified 今回は React の例 TypeScript は義務(過激派) 他にも Angular や iOS など主要なものは対応されてる 10 10
Initialize a new backend $ amplify init 質問がいくつか出てくるので答える Enter 連打で基本
OK 11 11
Install Amplify libraries $ yarn add aws-amplify @aws-amplify/ui-react aws-amplify AWS
との通信などが簡単にできるライブラリ @aws-amplify/ui-react ログイン画⾯などの UI 部品群 公式 には npm 使われてるけど yarn で追加してる create-react-app のデフォは yarn なので 12 12
Set up frontend // src/index.tsx import Amplify from "aws-amplify"; import
awsExports from "./aws-exports"; Amplify.configure(awsExports); Amplify に設定を⾷わせる 実態は AWS の各種サービスの ID などの設定 13 13
Amplify 準備完了! \イクゾー/ \デッデッデデデデ/ \カーン/ 14 14
Cognito 認証してみる $ amplify add auth $ amplify push 質問出てくるので答えると
Cognito のセットアップが完了す る push すると AWS に反映され Cognito が出来上がる ⼀部項⽬以外は amplify update auth で後から更新可能 15 15
動かしてみる サンプルコード $ yarn start 16 16
認証画⾯が出たら成功 17 17
⼀瞬でできた! サインアップ・サインイン・サインアウト パスワードリセット MFA 他にもカスタム認証だったり、 認証ログ取ったりといろいろできるゾ 18 18
実は... 発表資料作成 約 2h サンプル作成 約 10min 19 19
20 20
卍 Amplify is 爆速. 卍 21 21