You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/fragments/start/getting-started/reactnative/setup.mdx
+46-1Lines changed: 46 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Amplify.configure(awsconfig)
24
24
<Blockname="React Native CLI">
25
25
26
26
```bash
27
-
npx react-native@latest init amplified_to_do
27
+
npx react-native@latest init amplified_todo
28
28
```
29
29
30
30
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
49
49
50
50
Now your project is set up and you can begin adding new features.
51
51
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
+
52
97
## Run your app
53
98
54
99
To run your React Native app, you can follow the below steps
0 commit comments