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
94
Amplify FW で爆速フロント開発
LT資料
yKicchan
June 23, 2020
Tweet
Share
More Decks by yKicchan
See All by yKicchan
Atomic Design とは?
ykicchan
0
110
Other Decks in Programming
See All in Programming
TypeScriptから始める VR生活
tamagokakeg
2
110
The Cutting Edge Of Versioning (LambdaConf 2024)
chriskrycho
0
250
The grand strategy of Ruby Parser
yui_knk
5
280
TSKaigi 2024 - 新サービス Progate Path の演習で TypeScript を採用して見えた教材観点からの利点と課題
makotoshimazu
1
220
Exploring the Implementation of “t.Run”, “t.Parallel”, and “t.Cleanup”
akarin
1
160
Implementing Design Systems in Swift
seyfoyun
2
530
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
2
140
slog登場に伴うloggerの取り回し手法の見直し / kamakura.go #6
arthur1
0
120
RustでAWS Lambda functionをいい感じに書く
taiki45
2
150
哲学史とモデリング
tanakahisateru
2
420
An adventure of Happy Eyeballs
coe401_
1
140
Using "modern" Ruby to build a better, faster Homebrew
mikemcquaid
2
240
Featured
See All Featured
Designing for Performance
lara
601
67k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
Code Review Best Practice
trishagee
56
15k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.5k
Embracing the Ebb and Flow
colly
80
4.2k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
YesSQL, Process and Tooling at Scale
rocio
165
13k
Happy Clients
brianwarren
92
6.4k
Fireside Chat
paigeccino
22
2.7k
Designing on Purpose - Digital PM Summit 2013
jponch
111
6.5k
Become a Pro
speakerdeck
PRO
13
4.6k
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