Module 2: Initialize a Local Amplify App
In this module, you will install and configure the Amplify CLI
Now that we have initialized a new Amplify project in our account, we want to bring it down into our local environment so we can continue development and add new features.
In this module, you will install the Amplify CLI and initialize the Amplify project using the CLI.
What you will accomplish
- Install and configure the Amplify CLI
- Initialize the Amplify app
Amplify CLI – The Amplify CLI allows you to create, manage, and remove AWS services directly from your terminal.
Install the Amplify CLI
The Amplify command line interface (CLI) is a unified toolchain to create AWS Cloud services for your app, following a simple, guided workflow. Let’s go ahead and install the Amplify CLI using the command prompt (Windows) or the terminal (macOS). Note: This command can be run in any directory in your command prompt/terminal because the “-g” indicates the binary will be installed globally on your system.
npm install -g @aws-amplify/cli
Configure the Amplify CLI
AWS Identity and Access Management (IAM) enables you to manage users and user permissions in AWS. The CLI uses IAM to create and manage services programmatically on your behalf through the CLI.
To configure the CLI, run the configure command. To see a video walkthrough of the CLI configuration process, see Installing & Configuring the AWS Amplify CLI below.
Initialize the Amplify app
Next, we will deploy a backend and initialize the backend environment locally.
a. In the Amplify console, select Backend environments and choose Get started. Wait for the backend to be deployed.
b. On the Backend environments tab, choose Launch Studio.
c. Return to the Backend environments tab and expand the Local setup instructions section. Copy the command to your clipboard and open the terminal on your computer.
d. Paste the command into your terminal and follow the setup instructions.
You have initialized the Amplify project and are now ready to start adding features. In the next module, we will add an entire user authentication flow with just a few lines of code.
To view your Amplify project in the dashboard at any time, you can now run the following command:
amplify console ? Which site do you want to open? AWS console