Skip to content

Commit

Permalink
Merge pull request #435 from threefoldtech/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
LennertDefauw1 authored Apr 11, 2022
2 parents 8efe2b8 + 09c0cfb commit 35e60a7
Show file tree
Hide file tree
Showing 130 changed files with 4,923 additions and 3,178 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: tfjimber-builder
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to docker hub
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,35 @@ jobs:
build:
runs-on: tfjimber-builder
steps:
# - uses: actions/checkout@v1
# - uses: actions/setup-java@v1
# with:
# java-version: '12.x'

# # Setup the flutter environment.
# - uses: subosito/flutter-action@v1
# with:
# channel: 'stable' # 'dev', 'alpha', default to: 'stable'
# flutter-version: '2.10.1' # you can also specify exact version of flutter

# # Get flutter dependencies.
# - run: cd app && flutter pub get

# # Check for any formatting issues in the code.
# - run: flutter format --set-exit-if-changed .

# # Statically analyze the Dart code for any errors.
# - run: flutter analyze .

# # Build apk.
# - run: flutter build apk

# # Upload generated apk to the artifacts.
# - uses: actions/upload-artifact@v1
# with:
# name: release-apk
# path: app/apks/app-release.apk

- uses: actions/checkout@v2
- name: Login to docker hub
run: docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_TOKEN }}
Expand All @@ -17,6 +46,7 @@ jobs:
run: docker build . --file Dockerfile --tag jimber/3botlogin:staging-${{ github.sha }}
- name: Push the Docker image
run: docker push jimber/3botlogin:staging-${{ github.sha }}

deploy:
needs: build
runs-on: tfc-connect-staging
Expand Down
81 changes: 77 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,80 @@
# ThreeFold Connect

- Mobile app that serves as your main gateway to the ThreeFold Grid, ThreeFold products and services.
- Ultra secure 2FA authenticator.
- Completed with a XLM wallet to store your ThreeFold Tokens.
- Stay updated with ThreeFold News within the app.
## Introduction

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!

#### Planetary network

It is possible to have a a planetary network IPv6 address. Here you can enable the planety network connection and your phone will automatically be connected to the p2p network.

#### 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.

## 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/tfsupport

## Frontend

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

`yarn && yarn serve`


## Backend

Go inside virtual environement:

`source ./venv/bin/activate
`

Start UWSGI backend:

` 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 environement

`./build.sh --init && ./build.sh --switch --local`

Connect your phone / start an emulator and everything should work properly.

2 changes: 1 addition & 1 deletion app/android/app/build_local
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
2 changes: 1 addition & 1 deletion app/android/app/build_production
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
2 changes: 1 addition & 1 deletion app/android/app/build_staging
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 31
ndkVersion "20.1.5948944"
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
2 changes: 1 addition & 1 deletion app/android/app/build_testing
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
10 changes: 8 additions & 2 deletions app/android/app/src/main/AndroidManifest_local
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.jimber.threebotlogin.local">
<application android:label="3Bot Local" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">
<manifest xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" package="org.jimber.threebotlogin.local">
<application tools:replace="android:label" android:label="3Bot Local" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">
<service
android:name="org.threefold.yggdrasil_plugin.PacketTunnelProvider"
android:enabled="true"
Expand Down Expand Up @@ -32,6 +32,12 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="threebot" android:host="login" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="threebot" android:host="sign" />
</intent-filter>
</activity>
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
Expand Down
10 changes: 8 additions & 2 deletions app/android/app/src/main/AndroidManifest_production
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.jimber.threebotlogin">
<application android:label="Threefold Connect" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">
<manifest xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" package="org.jimber.threebotlogin">
<application tools:replace="android:label" android:label="Threefold Connect" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">
<service
android:name="org.threefold.yggdrasil_plugin.PacketTunnelProvider"
android:enabled="true"
Expand Down Expand Up @@ -32,6 +32,12 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="threebot" android:host="login" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="threebot" android:host="sign" />
</intent-filter>
</activity>
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
Expand Down
10 changes: 8 additions & 2 deletions app/android/app/src/main/AndroidManifest_staging
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.jimber.threebotlogin.staging">
<application android:label="3Bot Staging" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">
<manifest xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" package="org.jimber.threebotlogin.staging">
<application tools:replace="android:label" android:label="3Bot Staging" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">

<service
android:name="org.threefold.yggdrasil_plugin.PacketTunnelProvider"
Expand Down Expand Up @@ -34,6 +34,12 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="threebot" android:host="login" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="threebot" android:host="sign" />
</intent-filter>
</activity>
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
Expand Down
10 changes: 8 additions & 2 deletions app/android/app/src/main/AndroidManifest_testing
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.jimber.threebotlogin.testing">
<application android:label="3Bot Testing" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">
<manifest xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" package="org.jimber.threebotlogin.testing">
<application tools:replace="android:label" android:label="3Bot Testing" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">
<service
android:name="org.threefold.yggdrasil_plugin.PacketTunnelProvider"
android:enabled="true"
Expand Down Expand Up @@ -32,6 +32,12 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="threebot" android:host="login" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="threebot" android:host="sign" />
</intent-filter>
</activity>
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jimber.threebotlogin
package org.jimber.threebotlogin.staging

import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 7 additions & 8 deletions app/android/app/src/main/res/drawable-v21/launch_background.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap android:gravity="center" android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 7 additions & 8 deletions app/android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap android:gravity="center" android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>
17 changes: 17 additions & 0 deletions app/android/app/src/main/res/values-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowFullscreen">false</item>
<item name="android:windowSplashScreenBackground">#FFFFFF</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
3 changes: 2 additions & 1 deletion app/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:windowFullscreen">false</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Expand All @@ -15,4 +16,4 @@
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
</resources>
2 changes: 1 addition & 1 deletion app/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.5.31'
repositories {
google()
jcenter()
Expand Down
Empty file added app/apks/.gitkeep
Empty file.
Binary file modified app/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
platform :ios, '13'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
Loading

0 comments on commit 35e60a7

Please sign in to comment.