Skip to content

Commit 4fdc9bd

Browse files
Bannon Tannerjimblanc
authored andcommitted
added amplify init instructions for RN project setup (#5170)
* added amplify init instructions for RN project setup and entry into cspell * Update src/fragments/start/getting-started/reactnative/setup.mdx Co-authored-by: Jim Blanchard <[email protected]> * Update src/fragments/start/getting-started/reactnative/setup.mdx Co-authored-by: Jim Blanchard <[email protected]> * Update src/fragments/start/getting-started/reactnative/setup.mdx Co-authored-by: Jim Blanchard <[email protected]> * Update src/fragments/start/getting-started/reactnative/setup.mdx Co-authored-by: Jim Blanchard <[email protected]> * Update src/fragments/start/getting-started/reactnative/setup.mdx Co-authored-by: Jim Blanchard <[email protected]> --------- Co-authored-by: Jim Blanchard <[email protected]>
1 parent 389a5cc commit 4fdc9bd

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"AmazonPersonalizeProvider",
7171
"AmazonS3Client",
7272
"Amplif",
73+
"amplifiedtodo",
7374
"AMPLIFYCLI",
7475
"amplify-CLI",
7576
"amplifymapview",

src/fragments/start/getting-started/reactnative/setup.mdx

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Amplify.configure(awsconfig)
2424
<Block name="React Native CLI">
2525

2626
```bash
27-
npx react-native@latest init amplified_to_do
27+
npx react-native@latest init amplified_todo
2828
```
2929

3030
Finally, open __index.js__ and add the following lines of code at the top of the file below the last import:
@@ -49,6 +49,51 @@ import all0 from "/src/fragments/start/getting-started/reactnative/getting-start
4949

5050
Now your project is set up and you can begin adding new features.
5151

52+
## Initialize a new backend
53+
54+
With the app running, it's time to set up Amplify and create the backend resources to support the app.
55+
56+
Open a new terminal. From the **amplified_todo** directory, run:
57+
58+
```bash
59+
amplify init
60+
```
61+
62+
When you initialize Amplify you'll be prompted for some information about the app, with the option to accept recommended values:
63+
64+
```console
65+
? Enter a name for the project amplifiedtodo
66+
The following configuration will be applied:
67+
68+
Project information
69+
| Name: amplifiedtodo
70+
| Environment: dev
71+
| Default editor: Visual Studio Code
72+
| App type: javascript
73+
| Javascript framework: react-native
74+
| Source Directory Path: /
75+
| Distribution Directory Path: /
76+
| Build Command: npm run-script build
77+
| Start Command: npm run-script start
78+
79+
? Initialize the project with the above configuration? Yes
80+
Using default provider awscloudformation
81+
? Select the authentication method you want to use: AWS profile
82+
83+
...
84+
85+
? Please choose the profile you want to use default
86+
```
87+
88+
> Amplify CLI will infer the proper configuration based on the type of project Amplify is being initialized in where possible. Adjust if needed.
89+
90+
When you initialize a new Amplify project, a few things happen:
91+
92+
- It creates a top level directory called **amplify** that stores your backend definition. As you add features, the **amplify** folder will grow with CloudFormation templates that define your backend stack. Infrastructure-as-code via CloudFormation is a best practice way to create a replicable backend stack.
93+
- It creates a file called **aws-exports.js** in the **src** directory that holds all the configuration for the resources you create with Amplify. This is how the Amplify client is able to get the necessary information about your backend services.
94+
- It modifies the **.gitignore** file, adding some generated files to the ignore list.
95+
- A cloud project is created for you in the AWS Amplify Console that can be accessed by running `amplify console`. The Console provides a list of backend environments, deep links to provisioned resources per Amplify category, status of recent deployments, and instructions on how to promote, clone, pull, and delete backend resources.
96+
5297
## Run your app
5398

5499
To run your React Native app, you can follow the below steps

0 commit comments

Comments
 (0)