Skip to content

Commit a88f04e

Browse files
committed
update local development section && provide how to build apk
1 parent 0a93f71 commit a88f04e

File tree

3 files changed

+51
-28
lines changed

3 files changed

+51
-28
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
Threefold Connect is a mobile app that serves as your main gateway to the Threefold Grid and various other Threefold products and services.
66

7+
## App
8+
79
## Local development
810

11+
- check [frontend/README.md](frontend/README.md)
12+
- check [backend/README.md](backend/README.md)
913
- check [app/README.md](app/README.md)
1014

11-
## App
12-
1315
### Setup and Run the Mobile App
1416

1517
1. **Prerequisites**

app/README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,35 @@ When you are using the secure 2FA authentication, some third party apps require
9494

9595
If you have Threefold related questions, we provide a support chat where we will answer your questions as soon as possible!
9696

97+
## How to build an APK
9798

98-
## Local development
99+
To build an APK for distribution or testing:
99100

100-
### Frontend
101+
1. Initialize the environment if you haven't already:
101102

102-
Make sure the correct configuration is inside config.js. After that start the frontend by doing:
103+
```bash
104+
./build.sh --init
105+
```
103106

104-
`yarn && yarn serve`
107+
2. Choose your target environment:
105108

106-
### Backend
109+
```bash
110+
./build.sh --switch --[local|testing|staging|production]
111+
```
107112

108-
Go inside virtual environment:
113+
3. Build the APK:
109114

110-
`source ./venv/bin/activate`
115+
```bash
116+
# For debug build
117+
./build.sh --build --[local|testing|staging|production] --debug
111118

112-
Start UWSGI backend:
119+
# For release build
120+
./build.sh --build --[local|testing|staging|production] --release
121+
```
113122

114-
```bash
115-
uwsgi --http :5000 --gevent 1000 --http-websockets --master --wsgi-file __main__.py --callable app -s 0.0.0.0:3030
116-
: 1643024584:0;uwsgi --http :5000 --gevent 1000 --http-websockets --master --wsgi-file __main__.py --callable app -s 0.0.0.0:3030
117-
```
123+
4. The generated APK will be available at:
124+
- Debug APK: `build/app/outputs/flutter-apk/app-debug.apk`
125+
- Release APK: `build/app/outputs/flutter-apk/app-release.apk`
118126

119127
## How to run the app on Android
120128

backend/README.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,44 @@
22

33
The (temporary) backend for 3Bot login.
44

5+
## Run service
6+
7+
Go inside virtual environment:
8+
9+
`source ./venv/bin/activate`
10+
11+
Start UWSGI backend:
12+
13+
```bash
14+
uwsgi --http :5000 --gevent 1000 --http-websockets --master --wsgi-file __main__.py --callable app -s 0.0.0.0:3030
15+
: 1643024584:0;uwsgi --http :5000 --gevent 1000 --http-websockets --master --wsgi-file __main__.py --callable app -s 0.0.0.0:3030
16+
```
17+
518
## Data to save
619

720
### User
821

922
A user is someone that authenticates using 3botlogin.
1023

11-
| Key | Type | Example | Description |
12-
| --- | --- | --- | --- |
13-
| double_name | String | ivan.coene | The name of the user (case insensitive) |
14-
| sid | String | EWFWEGFWGWGWDS | Socket ID |
15-
| email | String | <ivan.coene@gmail.com> | The email of the user (case insensitive) |
16-
| public_key | string | G1gcbyeTnR2i...H8_3yV3cuF | The public key of the user to verify access |
17-
| device_id | String | abc | The ID of the device where we can send notifications to |
24+
| Key | Type |  Example | Description |
25+
| ----------- | ------- | ------------------------- | ------------------------------------------------------- |
26+
| double_name |  String | ivan.coene | The name of the user (case insensitive) |
27+
| sid |  String | EWFWEGFWGWGWDS | Socket ID |
28+
| email |  String | <ivan.coene@gmail.com> | The email of the user (case insensitive) |
29+
| public_key |  string | G1gcbyeTnR2i...H8_3yV3cuF | The public key of the user to verify access |
30+
| device_id |  String | abc | The ID of the device where we can send notifications to |
1831

1932
### Login attempt
2033

2134
When a user tries to log in, an entry is added
2235

23-
| Key | Type | Example | Description |
24-
| --- | --- | --- | --- |
25-
| double_name | String | ivan.coene | The name of the user (case insensitive) |
26-
| state_hash | String | 1gcbyeTnR2iZSfx6r2qIuvhH8 | The "identifier" of a login-attempt |
27-
| timestamp | Datetime | 2002-12-25 00:00:00-06:39 | The time when this satehash came in |
28-
| scanned | Boolean | false | Flag to keep the QR-scanned state |
29-
| singed_statehash | String | 1gcbyeTnR2iZSfx6r2qIuvhH8 | The signed version of the state hash|
36+
| Key | Type |  Example | Description |
37+
| ---------------- | -------- | -------------------------- | --------------------------------------- |
38+
| double_name |  String | ivan.coene | The name of the user (case insensitive) |
39+
| state_hash | String | 1gcbyeTnR2iZSfx6r2qIuvhH8 |  The "identifier" of a login-attempt |
40+
|  timestamp | Datetime |  2002-12-25 00:00:00-06:39 | The time when this satehash came in |
41+
| scanned | Boolean | false | Flag to keep the QR-scanned state |
42+
| singed_statehash | String | 1gcbyeTnR2iZSfx6r2qIuvhH8 |  The signed version of the state hash |
3043

3144
## Run in dev mode
3245

0 commit comments

Comments
 (0)