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
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.3k
Namespace and Its Future
tagomoris
6
710
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
290
知っているようで知らない"rails new"の世界 / The World of "rails new" You Think You Know but Don't
luccafort
PRO
1
180
ProxyによるWindow間RPC機構の構築
syumai
3
1.2k
GitHubとGitLabとAWS CodePipelineでCI/CDを組み比べてみた
satoshi256kbyte
4
240
OSS開発者という働き方
andpad
5
1.7k
ぬるぬる動かせ! Riveでアニメーション実装🐾
kno3a87
1
230
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
440
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
310
個人開発で徳島大学生60%以上の心を掴んだアプリ、そして手放した話
akidon0000
1
130
Featured
See All Featured
Producing Creativity
orderedlist
PRO
347
40k
How to train your dragon (web standard)
notwaldorf
96
6.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Code Review Best Practice
trishagee
71
19k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
580
For a Future-Friendly Web
brad_frost
180
9.9k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Faster Mobile Websites
deanohume
309
31k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
4 Signs Your Business is Dying
shpigford
184
22k
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