Skip to content

Commit 0a619f3

Browse files
authored
Merge pull request #57 from ibm-watson-data-lab/i16
I16
2 parents cb7f931 + 8563268 commit 0a619f3

File tree

4 files changed

+27
-33
lines changed

4 files changed

+27
-33
lines changed

README.md

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ When the reader has completed this Code Pattern, they will understand how to:
2828

2929
* [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.
3030

31-
3231
## Featured technologies
3332

3433
* [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:
4039

4140
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.
4241

43-
# Steps (UPDATE AS NEEDED)
42+
# Steps
4443

4544
* [Deploy to IBM Cloud](#deploy-to-bluemix) **OR** [Run locally](#run-locally)
4645
* [Database and replication setup](#database-and-replication-setup)
4746

48-
## Deploy to IBM Cloud (UPDATE AS NEEDED)
47+
## Deploy to IBM Cloud
4948

50-
[![Deploy to IBM Cloud](https://metrics-tracker.mybluemix.net/stats/5c5df69e10058d49cdc1f4d2fc63ce31/button.svg)](https://bluemix.net/deploy?repository=https://github.com/ibm-watson-data-lab/shopping-list-react-pouchdb)
49+
[![Deploy to IBM Cloud](https://metrics-tracker.mybluemix.net/stats/3490d3ff2913824363808c07a6645ab5/button.svg)](https://bluemix.net/deploy?repository=https://github.com/ibm-watson-data-lab/shopping-list-react-pouchdb)
5150

5251
1. Press the above ``Deploy to IBM Cloud`` button and then click on ``Deploy``.
5352

5453
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`.
5554

5655
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
6057

6158
## Run locally
6259

@@ -73,27 +70,20 @@ Clone the `shopping-list-react-pouchdb` locally. In a terminal, run:
7370

7471
```
7572
$ git clone https://github.com/ibm-watson-data-lab/shopping-list-react-pouchdb
73+
$ cd shopping-list-react-pouchdb
7674
```
7775

78-
79-
### 3. Run the server
80-
81-
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-
=======
8676
### 2. Install the dependencies
8777

8878
To install the dependencies, run the command:
8979

90-
npm install
80+
$ npm install
9181

9282
### 3. Run the app
9383

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:
9585

96-
npm start
86+
$ npm start
9787

9888
### 4. Create a Cloudant or CouchDB service
9989

@@ -119,36 +109,42 @@ To provision a managed Cloudant NoSQL DB
119109

120110
Tip: Select the **Manage** tab and click **Launch** to open the Cloudant dashboard and manage the service instance.
121111

122-
## Database and replication setup (UPDATE AS NEEDED)
112+
## Database and replication setup
123113
1. [Create the remote database](#1-create-the-remote-database)
124114
1. [Enable CORS](#2-enable-cors)
125115
1. [Set the replication target](#3-set-the-replication-target)
126116

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.
128120

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.
130122
The Shopping List app can be used locally before the database exists, but cannot sync
131123
until the remote database is completed.
132124

133-
![](doc/source/images/create_db.png)
125+
![Create shopping-list database](doc/source/images/create_db.png)
134126

135-
### 2. Enable CORS (UPDATE AS NEEDED)
127+
### 2. Enable CORS
136128

137-
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).
138130

139-
![](doc/source/images/enable_cors.png)
131+
* Select the Account Settings (or config) tab and open the **CORS** tab.
140132

141-
### 3. Set the replication target (UPDATE AS NEEDED)
133+
* Enable CORS and restrict the domain as needed for security.
142134

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+
![Enable CORS](doc/source/images/enable_cors.png)
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.
145141

146142
Add `/shopping-list` to the URL to connect to the database that you created.
147143

148-
![](doc/source/images/replicator.png)
144+
![Configure replication in app](doc/source/images/replicator.png)
149145

150146
<!--Edit as appropriate, update screenshot-->
151-
# Using the app (UPDATE AS NEEDED)
147+
# Using the app
152148

153149
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.
154150

@@ -158,8 +154,6 @@ When you go online and have the database and CORS enabled and the Replication Ta
158154

159155
![](doc/source/images/shopping_lists.png)
160156

161-
## Running the app (UPDATE AS NEEDED)
162-
163157
## Running the tests (UPDATE AS NEEDED)
164158

165159
## Deploying to GitHub Pages (UPDATE AS NEEDED)
@@ -188,4 +182,4 @@ To disable tracking, simply remove `node log &&` from the `package.json` file.
188182
* [Material UI](http://www.material-ui.com/)
189183

190184
# License
191-
[Apache 2.0](LICENSE)
185+
[Apache 2.0](LICENSE)

doc/source/images/create_db.png

29.2 KB
Loading

doc/source/images/enable_cors.png

49.6 KB
Loading

doc/source/images/replicator.png

45.9 KB
Loading

0 commit comments

Comments
 (0)