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: README.md
+27-33Lines changed: 27 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,6 @@ When the reader has completed this Code Pattern, they will understand how to:
28
28
29
29
*[Cloudant NoSQL DB](https://console.ng.bluemix.net/catalog/services/cloudant-nosql-db): A fully managed data layer designed for modern web and mobile applications that leverages a flexible JSON schema.
30
30
31
-
32
31
## Featured technologies
33
32
34
33
*[PouchDB](https://pouchdb.com/) - an in-browser database that can replicate to and from a remote Apache CouchDB or IBM Cloudant database.
@@ -40,23 +39,21 @@ When the reader has completed this Code Pattern, they will understand how to:
40
39
41
40
To see this app in action without installing anything, simply visit https://ibm-watson-data-lab.github.io/shopping-list-react-pouchdb in a web browser or on a mobile device.
42
41
43
-
# Steps (UPDATE AS NEEDED)
42
+
# Steps
44
43
45
44
*[Deploy to IBM Cloud](#deploy-to-bluemix)**OR**[Run locally](#run-locally)
46
45
*[Database and replication setup](#database-and-replication-setup)
47
46
48
-
## Deploy to IBM Cloud (UPDATE AS NEEDED)
47
+
## Deploy to IBM Cloud
49
48
50
-
[](https://bluemix.net/deploy?repository=https://github.com/ibm-watson-data-lab/shopping-list-react-pouchdb)
49
+
[](https://bluemix.net/deploy?repository=https://github.com/ibm-watson-data-lab/shopping-list-react-pouchdb)
51
50
52
51
1. Press the above ``Deploy to IBM Cloud`` button and then click on ``Deploy``.
53
52
54
53
1. In Toolchains, click on Delivery Pipeline to watch while the app is deployed. Once deployed, the app can be viewed by clicking `View app`.
55
54
56
55
1. To see the app and services created and configured for this code pattern, use the IBM Cloud dashboard. The app is named `shopping-list-react-pouchdb` with a unique suffix. The following services are created and easily identified by the `sljsp` prefix:
57
-
58
-
59
-
* sljsp-CloudantNoSQLDB
56
+
* sljsp-CloudantNoSQLDB
60
57
61
58
## Run locally
62
59
@@ -73,27 +70,20 @@ Clone the `shopping-list-react-pouchdb` locally. In a terminal, run:
This command serves the app at `http://127.0.0.1:3000` and provides basic URL routing for the app:
82
-
83
-
npm start
84
-
85
-
=======
86
76
### 2. Install the dependencies
87
77
88
78
To install the dependencies, run the command:
89
79
90
-
npm install
80
+
$ npm install
91
81
92
82
### 3. Run the app
93
83
94
-
This command starts the app:
84
+
This command serves the app at `http://127.0.0.1:3000` and provides basic URL routing for the app:
95
85
96
-
npm start
86
+
$ npm start
97
87
98
88
### 4. Create a Cloudant or CouchDB service
99
89
@@ -119,36 +109,42 @@ To provision a managed Cloudant NoSQL DB
119
109
120
110
Tip: Select the **Manage** tab and click **Launch** to open the Cloudant dashboard and manage the service instance.
121
111
122
-
## Database and replication setup (UPDATE AS NEEDED)
112
+
## Database and replication setup
123
113
1.[Create the remote database](#1-create-the-remote-database)
124
114
1.[Enable CORS](#2-enable-cors)
125
115
1.[Set the replication target](#3-set-the-replication-target)
126
116
127
-
### 1. Create the remote database (UPDATE AS NEEDED)
117
+
### 1. Create the remote database
118
+
119
+
* Use the Cloudant or CouchDB dashboard to create a database.
128
120
129
-
Use your Cloudant or CouchDB dashboard to create a database. Select the Databases icon on the left and then use the `Create Database` button to create the "shopping-list" database.
121
+
*Select the Databases tab on the left and then use the `Create Database` button to create the "shopping-list" database.
130
122
The Shopping List app can be used locally before the database exists, but cannot sync
Cross-Origin Resource Sharing (CORS) needs to be enabled. Use your Cloudant or CouchDB dashboard to enable it. The CORS options are under the account settings or config depending on your version. Enable CORS and restrict the domain as needed for security.
129
+
* Open the Cloudant or CouchDB dashboard to enable Cross-Origin Resource Sharing (CORS).
138
130
139
-

131
+
* Select the Account Settings (or config) tab and open the **CORS** tab.
140
132
141
-
### 3. Set the replication target (UPDATE AS NEEDED)
133
+
* Enable CORS and restrict the domain as needed for security.
142
134
143
-
Run the Shopping List app and use the `Replicator` form to enter your Database URL.
144
-
If you use the IBM Cloud Cloudant URL taken from the service credentials as described above, the URL includes user and password GUIDs.
135
+

136
+
137
+
### 3. Set the replication target
138
+
139
+
Run the Shopping List app and use the *Settings* form to enter your database URL.
140
+
If you use the IBM Cloud Cloudant URL taken from the service credentials as described above, the URL includes user name and password.
145
141
146
142
Add `/shopping-list` to the URL to connect to the database that you created.
147
143
148
-

144
+

149
145
150
146
<!--Edit as appropriate, update screenshot-->
151
-
# Using the app (UPDATE AS NEEDED)
147
+
# Using the app
152
148
153
149
The app allows you to create a shopping list by clicking on the plus sign. Click on the list to see its items. Then, you can add items to the list by clicking the plus sign. There is a checkbox to allow you to mark the items complete as you buy load up your cart.
154
150
@@ -158,8 +154,6 @@ When you go online and have the database and CORS enabled and the Replication Ta
158
154
159
155

160
156
161
-
## Running the app (UPDATE AS NEEDED)
162
-
163
157
## Running the tests (UPDATE AS NEEDED)
164
158
165
159
## Deploying to GitHub Pages (UPDATE AS NEEDED)
@@ -188,4 +182,4 @@ To disable tracking, simply remove `node log &&` from the `package.json` file.
0 commit comments