Skip to content

update readme docs #1007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 4 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,11 @@

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

It contains an ultra secure 2FA authenticator for authenticating through third party applications.

Inside the app, you can manage your Threefold Tokens(TFT).

## Features

### Threefold news

Inside the app, there is a "News" section where you can find all the latest Threefold news!

### Wallet

In the Threefold Connect app, it is possible to manage your TFT and view your transaction history on the TF chain.

### Farmers

If you own a Threefold node, you can manage your farm here.

### Support

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


### Identity

When you are using the secure 2FA authentication, some third party apps require certain information (eg. phone number). In this tab you can verify your email, phone number and identity to provide this data to the third party application. This allows you total granular control over which data you choose to share or not share.

## New codebase

In June 2022, a new codebase has been written for this project. It is built on turborepository. This codebase is still in development and not ready yet, you can find this under v2 branch.

## Local development

### External repositories

Threefold News: <https://github.com/threefoldtech/threefold_connect_news>

Wallet v3: <https://github.com/threefoldtech/wallet-next>

Farmer: <https://github.com/threefoldtech/wallet-next>

Support: <https://github.com/threefoldtech/test_feedback>

## Frontend

Make sure the correct configuration is inside config.js. After that start the frontend by doing:

`yarn && yarn serve`

## Backend

Go inside virtual environment:

`source ./venv/bin/activate`

Start UWSGI backend:

```bash
uwsgi --http :5000 --gevent 1000 --http-websockets --master --wsgi-file __main__.py --callable app -s 0.0.0.0:3030
: 1643024584:0;uwsgi --http :5000 --gevent 1000 --http-websockets --master --wsgi-file __main__.py --callable app -s 0.0.0.0:3030
```

## App

Make sure you have at least Flutter 2.8.1 installed. If everything is installed properly, execute the following commands:

Copy the file in /lib/app_config_local.template into /lib/app_config_local.dart and change the configuration to your local IP's

After that, use the build.sh script to set up the right environment
## Local development

`./build.sh --init && ./build.sh --switch --local`
- check [frontend/README.md](frontend/README.md)
- check [backend/README.md](backend/README.md)
- check [app/README.md](app/README.md)

Connect your phone / start an emulator and everything should work properly.
137 changes: 125 additions & 12 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# threebotlogin
# Threefold Connect

A decentralized login application
Decentralized login application for Threefold grid.

It contains an ultra secure 2FA authenticator for authenticating through third party applications.

Inside the app, you can manage your Threefold Tokens(TFT).

## Getting Started

Expand All @@ -15,11 +19,128 @@ For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

## Features ✨

### Wallet

In the ThreeFold Connect app, you can:

- Manage your ThreeFold Tokens (TFT) across multiple wallets
- Import existing wallets using seed phrases or secret keys
- Send and receive tokens on both TFChain and the Stellar network
- Bridge tokens between TFChain, Stellar and Solana networks
- Verify your identity for KYC requirements
- Monitor your balance in real-time
- Manage contacts for easy transfers

### Farm

In the ThreeFold Connect app, you can:

- Create and manage both v3 and v4 farms
- View farm details and configurations
- Track node status (online/offline) in real-time

### Node Monitoring

- Receive proactive notifications when nodes go offline
- Smart notification system that categorizes offline nodes:
- Recent outages (0-1 hour): Notifications every 15 minutes
- Short outages (1-4 hours): Notifications every hour
- Medium outages (4-24 hours): Notifications every 4 hours
- Extended outages (1-3 days): Notifications every 12 hours
- Long outages (3-7 days): Notifications once daily
- Very long outages (beyond 7 days): Notifications suppressed

### DAO

Inside the app, you can vote on TFChain proposals and view the results of your votes.

### Signing

Inside the app you can sign content with one of your wallets.

The content is hashed using md5 and signed using the private key of the wallet.

There are 3 ways to sign:

- **Sign with text**
- Enter custom text directly in the app
- Select which wallet to sign with
- Optionally specify a destination URL to send the signed data
- **Sign with QR Code**
- Scan a QR code containing content to be signed
- The app decodes the QR code and displays the content for review
- Choose which wallet to use for signing
- The QR code may contain:
- Direct content to sign
- A source URL to fetch content from
- An optional destination URL for the signed data
- **Sign with link**
- Click on a specially formatted link
- The app automatically fetches content from the link
- Review the content before signing
- Select a wallet to sign with

### Threefold News

Inside the app, there is a "News" section where you can find all the latest Threefold news!

### Identity

When you are using the secure 2FA authentication, some third party apps require certain information (eg. phone number). In this tab you can verify your email, phone number and identity to provide this data to the third party application. This allows you total granular control over which data you choose to share or not share.

### Support

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

## How to build an APK

### Prerequisites

- Flutter 3.27.2

To build an APK for distribution or testing:

1. Initialize the environment if you haven't already:

```bash
./build.sh --init
```

2. Choose your target environment:

```bash
./build.sh --switch --[local|testing|staging|production]
```

3. Build the APK:

```bash
# For debug build
./build.sh --build --[local|testing|staging|production] --debug

# For release build
./build.sh --build --[local|testing|staging|production] --release
```

4. The generated APK will be available at:
- Debug APK: `build/app/outputs/flutter-apk/app-debug.apk`
- Release APK: `build/app/outputs/flutter-apk/app-release.apk`

## How to run the app on Android

1. Connect your android device (make sure you have a new android version)
2. Choose your environment `testing|staging|production`
3. Run `./build.sh --run --testing|staging|production`
2. Choose your environment `local|testing|staging|production`
3. Run `./build.sh --run --local|testing|staging|production`

## How to run the app on IOS

1. Connect your ios device (make sure you have a new ios version) or start an emulator
2. Choose your environment `local|testing|staging|production`
3. Run `./build.sh --run --local|testing|staging|production`
4. Run `pod install` in the `ios` folder
5. Open the app in XCode and run it from there

### Local run

Expand All @@ -29,11 +150,3 @@ samples, guidance on mobile development, and a full API reference.
4. Run [openkyc](https://github.com/threefoldtech/threefold_connect_openkyc/blob/master/readme.md.old#L83)
5. Copy the file in `app_config_local.template` into `app_config_local.dart` and change the configuration to your local IP's
6. Run the app using `./build.sh --run --local`

## Known issues

- <https://github.com/threefoldtech/threefold_connect/issues/306>

## TODO

- signingConfigs
41 changes: 27 additions & 14 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,44 @@

The (temporary) backend for 3Bot login.

## Run service

Go inside virtual environment:

`source ./venv/bin/activate`

Start UWSGI backend:

```bash
uwsgi --http :5000 --gevent 1000 --http-websockets --master --wsgi-file __main__.py --callable app -s 0.0.0.0:3030
: 1643024584:0;uwsgi --http :5000 --gevent 1000 --http-websockets --master --wsgi-file __main__.py --callable app -s 0.0.0.0:3030
```

## Data to save

### User

A user is someone that authenticates using 3botlogin.

| Key | Type | Example | Description |
| --- | --- | --- | --- |
| double_name | String | ivan.coene | The name of the user (case insensitive) |
| sid | String | EWFWEGFWGWGWDS | Socket ID |
| email | String | <ivan.coene@gmail.com> | The email of the user (case insensitive) |
| public_key | string | G1gcbyeTnR2i...H8_3yV3cuF | The public key of the user to verify access |
| device_id | String | abc | The ID of the device where we can send notifications to |
| Key | Type |  Example | Description |
| ----------- | ------- | ------------------------- | ------------------------------------------------------- |
| double_name |  String | ivan.coene | The name of the user (case insensitive) |
| sid |  String | EWFWEGFWGWGWDS | Socket ID |
| email |  String | <ivan.coene@gmail.com> | The email of the user (case insensitive) |
| public_key |  string | G1gcbyeTnR2i...H8_3yV3cuF | The public key of the user to verify access |
| device_id |  String | abc | The ID of the device where we can send notifications to |

### Login attempt

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

| Key | Type | Example | Description |
| --- | --- | --- | --- |
| double_name | String | ivan.coene | The name of the user (case insensitive) |
| state_hash | String | 1gcbyeTnR2iZSfx6r2qIuvhH8 | The "identifier" of a login-attempt |
| timestamp | Datetime | 2002-12-25 00:00:00-06:39 | The time when this satehash came in |
| scanned | Boolean | false | Flag to keep the QR-scanned state |
| singed_statehash | String | 1gcbyeTnR2iZSfx6r2qIuvhH8 | The signed version of the state hash|
| Key | Type |  Example | Description |
| ---------------- | -------- | -------------------------- | --------------------------------------- |
| double_name |  String | ivan.coene | The name of the user (case insensitive) |
| state_hash | String | 1gcbyeTnR2iZSfx6r2qIuvhH8 |  The "identifier" of a login-attempt |
|  timestamp | Datetime |  2002-12-25 00:00:00-06:39 | The time when this satehash came in |
| scanned | Boolean | false | Flag to keep the QR-scanned state |
| singed_statehash | String | 1gcbyeTnR2iZSfx6r2qIuvhH8 |  The signed version of the state hash |

## Run in dev mode

Expand Down