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
技術的負債の正体を知って向き合う
irof
0
230
Cursorハンズオン実践!
eltociear
2
1.2k
「ちょっと古いから」って避けてた技術書、今だからこそ読もう
mottyzzz
12
7.1k
Six and a half ridiculous things to do with Quarkus
hollycummins
0
210
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
580
コードとあなたと私の距離 / The Distance Between Code, You, and I
hiro_y
0
190
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
420
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
250
CSC509 Lecture 06
javiergs
PRO
0
260
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
3
13k
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
6
4.1k
モテるデスク環境
mozumasu
3
1.1k
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Embracing the Ebb and Flow
colly
88
4.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Automating Front-end Workflow
addyosmani
1371
200k
Navigating Team Friction
lara
190
15k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
It's Worth the Effort
3n
187
28k
Writing Fast Ruby
sferik
629
62k
How to train your dragon (web standard)
notwaldorf
97
6.3k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
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