Skip to content

Commit ebdd558

Browse files
committed
docs: List InfluxDB credential prereqs
- Add prereqs. We overlooked creating buckets or intended to use the example app to create them. That's a nice-to-have.
1 parent 0b34bef commit ebdd558

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,21 @@ To learn how to create the app from scratch, follow the IoT Starter tutorial.
2020
To run the app, do the following:
2121

2222
1. If you haven't already, [create an InfluxDB Cloud account](https://www.influxdata.com/products/influxdb-cloud/) or [install InfluxDB OSS](https://www.influxdata.com/products/influxdb/).
23-
2. Clone this repository to your machine.
24-
3. Change to the directory--for example, enter the following code into the terminal:
23+
2. Set up InfluxDB--the example app assumes you have the following:
24+
25+
- An InfluxDB [org ID](https://docs.influxdata.com/influxdb/v2/admin/organizations/view-orgs/)
26+
- A [bucket](https://docs.influxdata.com/influxdb/v2/admin/buckets/create-bucket/#create-a-bucket-using-the-influxdb-api) named `iot_center` for storing measurement data collected from devices
27+
- A [bucket](https://docs.influxdata.com/influxdb/v2/admin/buckets/create-bucket/#create-a-bucket-using-the-influxdb-api) named `iot_center_devices` for storing device metadata and API token IDs
28+
- An [API token](https://docs.influxdata.com/influxdb/v2/admin/tokens/create-token/) (for example, an **All Access token**) that has read and write permissions for the buckets
29+
30+
3. Clone this repository to your machine.
31+
4. Change to the directory--for example, enter the following code into the terminal:
2532

2633
```bash
2734
cd ./iot-api-python
2835
```
2936

30-
4. Set environment variables for `INFLUX_TOKEN` and `INFLUX_ORG`--for example, enter the following commands into your terminal:
37+
5. Set environment variables for `INFLUX_TOKEN` and `INFLUX_ORG`--for example, enter the following commands into your terminal:
3138

3239
```bash
3340
export INFLUX_TOKEN=<INFLUX_TOKEN>
@@ -39,7 +46,7 @@ To run the app, do the following:
3946
- **`<INFLUX_TOKEN>`**: your InfluxDB [API token](#authorization) with permission to query (_read_) buckets and create (_write_) authorizations for devices.
4047
- **`<INFLUX_ORG_ID>`**: your InfluxDB organization ID.
4148

42-
5. If you need to adjust the defaults to match your InfluxDB instance, edit the settings in`./config.ini`:
49+
6. If you need to adjust the defaults to match your InfluxDB instance, edit the settings in`./config.ini`:
4350

4451
```ini
4552
[APP]
@@ -52,7 +59,7 @@ To run the app, do the following:
5259

5360
- **`<INFLUX_URL>`**: your InfluxDB instance URL--for example, the default OSS URL `http://localhost:8086`.
5461

55-
6. Create and activate a Python virtual environment for the project.
62+
7. Create and activate a Python virtual environment for the project.
5663
Enter the following commands into your terminal:
5764

5865
```bash
@@ -64,7 +71,7 @@ To run the app, do the following:
6471
source virtualenv/bin/activate
6572
```
6673

67-
7. Install `pdm` package manager for your system.
74+
8. Install `pdm` package manager for your system.
6875
On Linux or macOS, enter the following command into your terminal:
6976

7077
```bash
@@ -77,27 +84,27 @@ On Linux or macOS, enter the following command into your terminal:
7784
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py -UseBasicParsing).Content | python -
7885
```
7986

80-
8. Use `pdm` to install dependencies.
87+
1. Use `pdm` to install dependencies.
8188
Enter the following command into your terminal:
8289

8390
```bash
8491
pdm install
8592
```
8693

87-
9. If you use a bash terminal, you can set an environment variable to use dependencies in `pdm.lock` when you run your application scripts.
94+
2. If you use a bash terminal, you can set an environment variable to use dependencies in `pdm.lock` when you run your application scripts.
8895
Enter the following command into your bash terminal:
8996

9097
```bash
9198
eval "$(pdm --pep582)"
9299
```
93100

94-
10. To start the Flask application, enter the following command into your terminal:
101+
3. To start the Flask application, enter the following command into your terminal:
95102

96103
```bash
97104
flask run -h localhost -p 3001
98105
```
99106

100107
To view the application, visit <http://localhost:3001> in your browser.
101108

102-
11. Next, you can use the example [iot-api-ui](https://github.com/influxdata/iot-api-ui) React frontend to interact with the API.
109+
4. Next, you can use the example [iot-api-ui](https://github.com/influxdata/iot-api-ui) React frontend to interact with the API.
103110

0 commit comments

Comments
 (0)