Skip to content

Commit 0f5ae11

Browse files
committed
Readme, more env var cause we love them
1 parent 2be7ac5 commit 0f5ae11

File tree

3 files changed

+490
-4
lines changed

3 files changed

+490
-4
lines changed

README.md

+55-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,69 @@
11
# whatsapp-tracking
22

3+
Proof of concept about tracking contacts in WhatsApp.
4+
Check out my [blog entry](https://jorislacance.fr/blog/) for in-depth info.
5+
6+
## architecture
7+
8+
The POC is composed of:
9+
10+
* The Node.js WhatsApp scraper robot - Gather the data
11+
* The InfluxDB 2.0 service - Store the data
12+
* The Grafana 6.7 service - Visualize the data
13+
314
## setup
415

516
```bash
6-
npm install
17+
# run the InfluxDB and Grafana services
18+
docker-compose up -d
19+
```
20+
21+
### influxDB setup
22+
23+
* Go to [https://localhost:9999](https://localhost:9999), setup an admin account
24+
* Name the initial organization like you want, `initial-org` for instance
25+
* Name the initial bucket anything, like `yolo`, we won't use the initial one because there will be sample data in it
26+
* Create a new bucket `whatsapp-tracking`
27+
* Generate a token `whatsapp-tracking-scraper` with write permission to `whatsapp-tracking` bucket
28+
* Generate a token `grafana` with 'all access'
29+
30+
### grafana setup
31+
32+
* Go to [https://localhost:3000](https://localhost:3000), setup an admin account
33+
* Add the data source using the plugin `Flux (InfluxDB) [BETA]` (for InfluxDB 2.0)
34+
* URL: `http://influxdb:9999`
35+
* with credentials: `true`
36+
* Organization: `initial-org`
37+
* Default Bucket: `whatsapp-tracking`
38+
* Token: the grafana token
39+
* Import the dashboard (file `grafana-dashboard.json`)
40+
41+
### scraper setup
42+
43+
Create a file `.env` in the root directory to setup your environment.
44+
45+
```text
46+
CONTACT_TARGET=YourContactName
47+
INFLUXDB_TOKEN=The whatsapp-tracking-scraper token
48+
INFLUXDB_ORG=initial-org
49+
INFLUXDB_BUCKET=whatsapp-tracking
750
```
851

9-
## usage
52+
## scraper usage
1053

1154
```bash
55+
# init the robot
56+
npm install
57+
# run the robot
1258
node index.js
1359
```
1460

61+
## limitation
62+
63+
Not sure if the scraper runs on Linux...
64+
1565
## todo
1666

17-
* Dockerize the scraper too ? Hardly with the peering procedure that require to scan QR code.
67+
* Update the link to portfolio blog entry
68+
* Add an image in this readme
69+
* Dockerize the scraper too ? Hardly with the peering procedure that requires us to scan the QR code.

0 commit comments

Comments
 (0)