diff --git a/README.md b/README.md index fd019c539..a82d48916 100644 --- a/README.md +++ b/README.md @@ -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: - -Wallet v3: - -Farmer: - -Support: - -## 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. diff --git a/app/README.md b/app/README.md index 77d317e52..a73346e28 100644 --- a/app/README.md +++ b/app/README.md @@ -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 @@ -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 by md5 and signed by sr25519 using one of your wallets. + +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 (JSON key: `content`) + - A source URL to fetch content from (JSON key: `src`) + - An optional destination URL for the signed data (JSON key: `dest`) +- **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 @@ -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 - -- - -## TODO - -- signingConfigs diff --git a/backend/README.md b/backend/README.md index 3d12cb7dc..0ed04e9a0 100644 --- a/backend/README.md +++ b/backend/README.md @@ -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 | | 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 | | 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 @@ -46,9 +59,3 @@ sudo apt-get install sqlite3 ## Config file Rename config.ini.example to config.ini and add your API key. - -## From version 2.0.0 the app has switched to the grids explorer - - - -