-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
297 changed files
with
1,993 additions
and
36,465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# Code Style | ||
|
||
REChain tries to be as minimal as possible even in the code style. We try to keep the code clean, simple and easy to read. The source code of the app is under `/lib` with the main entry point `/lib/main.dart`. | ||
|
||
### Directory Structure: | ||
|
||
|
||
- /lib | ||
- /config | ||
- app_config.dart | ||
- ...Constants, styles and other configurations | ||
- /utils | ||
- handy_function.dart | ||
- ...Helper functions and extensions | ||
- /pages | ||
- /chat | ||
- chat.dart | ||
- chat_view.dart | ||
- /chat_list | ||
- chat_list.dart | ||
- chat_list_view.dart | ||
- ...The pages of the app separated in Controllers and Views | ||
- /widgets | ||
- /layouts | ||
- ...Custom widgets created for this project | ||
- main.dart | ||
|
||
|
||
Most of the business model is in the REChain Matrix Dart SDK. We try to not keep a model inside of the source code but extend it under `/utils`. | ||
|
||
### Separation of Controllers and Views | ||
|
||
We split views and controller logic with stateful widgets as controller where the build method just builds a stateless widget which receives the state as the only parameter. A common controller would look like this: | ||
|
||
```dart | ||
// /lib/controller/enter_name_controller.dart | ||
import 'package:flutter/material.dart'; | ||
class EnterName extends StatefulWidget { | ||
@override | ||
EnterNameController createState() => EnterNameController(); | ||
} | ||
class EnterNameController extends State<EnterName> { | ||
final TextEditingController textEditingController = TextEditingController(); | ||
String name = 'Unknown'; | ||
/// Changes the name with the content in the textfield. If the textfield is | ||
/// empty, this breaks up and displays a SnackBar. | ||
void setNameAction() { | ||
if (textEditingController.text.isEmpty) { | ||
ScaffoldMessenger.of(context).showSnackBar( | ||
SnackBar( | ||
content: Text('You have not entered your name'), | ||
), | ||
); | ||
return; | ||
} | ||
setState(() => name = textEditingController.text); | ||
} | ||
@override | ||
Widget build(BuildContext context) => EnterNameView(this); | ||
} | ||
``` | ||
|
||
So we have a controller for a `EnterName` view which as a `TextEditingController`, a state `name` and an action `void setNameAction()`. Actions must always be methods of a type, that we dont need to pass parameters in the corresponding view class and must have dartdoc comments. | ||
|
||
The view class could look like this: | ||
|
||
```dart | ||
// /lib/views/enter_name_view.dart | ||
import 'package:flutter/material.dart'; | ||
class EnterNameView extends StatelessWidget { | ||
final EnterNameController controller; | ||
const EnterNameView(this.controller, {Key key}) : super(key: key); | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text('Your name: ${controller.name}'), | ||
), | ||
body: Center( | ||
child: TextField( | ||
controller: controller.textEditingController, | ||
), | ||
), | ||
floatingActionButton: FloatingActionButton( | ||
onPressed: controller.setNameAction, | ||
child: Icon(Icons.save), | ||
), | ||
); | ||
} | ||
} | ||
``` | ||
|
||
Views should just contain code which describes the view. All other parameters or logic should be in the controller. The job of the view class is just to take the current state and build the widget tree and pipe the callbacks back. If there is any calulation necessary which is not solveable as a simple if-else or switch statement, it should be done in an external helper function unter `/lib/utils/`. | ||
|
||
All file names must be lower_snake_case. All views must have a `View` suffix and all controller must have a `Controller` suffix. Widgets may have a controller too but they should pass the callbacks back to the view where possible. Calling one line methods directly in the view is only recommended if there is no need to pass a parameter. | ||
|
||
To perform an action on state initialization we use the initState method: | ||
```dart | ||
@override | ||
void initState() { | ||
// TODO: implement initState | ||
super.initState(); | ||
} | ||
``` | ||
|
||
And the dispose method to perform an action on disposing: | ||
```dart | ||
@override | ||
void dispose() { | ||
// TODO: implement dispose | ||
super.dispose(); | ||
} | ||
``` | ||
|
||
To run code after the widget was created first we use the WidgetBindings in the initState: | ||
```dart | ||
@override | ||
void initState() { | ||
WidgetsBinding.instance.addPostFrameCallback((_) { | ||
// Do something when build is finished | ||
}); | ||
super.initState(); | ||
} | ||
``` | ||
|
||
### Formatting | ||
|
||
We do not allow code with wrong formatting. Please run `flutter format lib` if your IDE doesn't do this automatically. | ||
|
||
### Code Analyzis | ||
|
||
We do not allow codes with dart errors or warnings. We use the [pedantic](https://pub.dev/packages/pedantic) package for static code analysis with additional rules under `analysis_options.yaml`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Welcome to the REChain Wiki. | ||
|
||
# 👥 User Guides | ||
- [How to Find Users in REChain](https://github.com/sorydima/REChain-/REChain_wiki/How-to-Find-Users-in-REChain) | ||
- [Push Notifications without Google Services ](https://github.com/sorydima/REChain-/REChain_wiki/Push-Notifications-without-Google-Services) | ||
- [Quick account switching in REChain ](https://github.com/sorydima/REChain-/REChain_wiki/Quick-account-switching-in-REChain) | ||
|
||
# 👁️🗨️ Translator Guides | ||
- [Translators Guide](https://github.com/sorydima/REChain-/REChain_wiki/Translators-Guide) | ||
|
||
# 🧑💻️ Developer Guides | ||
- [Code Quality](https://github.com/sorydima/REChain-/REChain_wiki/Code-Quality) | ||
- [REChain Design Guidelines](https://github.com/sorydima/REChain-/REChain_wiki/REChain-Design-Guidelines) | ||
- [How To Build](https://github.com/sorydima/REChain-/REChain_wiki/How-To-Build) | ||
- [How to create your own REChain fork](https://github.com/sorydima/REChain-/REChain_wiki/How-to-create-your-own-REChain-fork) | ||
- [Publish a new Release](https://github.com/sorydima/REChain-/REChain_wiki/Publish-a-new-Release) | ||
- [Release Candidate Public Beta Template](https://github.com/sorydima/REChain-/REChain_wiki/Release-Candidate-Public-Beta-Template) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Welcome to the REChain- wiki! | ||
|
||
# REChain 🪐 | ||
|
||
## Overview | ||
|
||
**REChain** is a decentralized blockchain network designed to enhance privacy, security, and scalability. It provides a robust platform for building decentralized applications (dApps) and services with a special focus on anonymity, security, and modularity. | ||
|
||
REChain is designed to power decentralized solutions with applications ranging from decentralized finance (DeFi), supply chain management, to data privacy, and more. | ||
|
||
--- | ||
|
||
## Key Features | ||
|
||
- **Decentralized architecture**: REChain operates on a fully distributed node network without central points of control. | ||
- **Blockchain Integration**: It integrates seamlessly with multiple blockchain protocols and supports cross-chain operations. | ||
- **High Performance**: Optimized for speed and scalability, enabling high transaction throughput. | ||
- **Security Focused**: Employs cutting-edge cryptographic techniques to ensure secure transactions and communications. | ||
- **Private & Anonymous**: Full end-to-end encryption and privacy guarantees for sensitive data and transactions. | ||
- **Modular & Extensible**: Designed to support modular upgrades and extensions as per user or developer requirements. | ||
|
||
--- | ||
|
||
## Getting Started | ||
|
||
To get started with REChain, clone the repository and follow the instructions below: | ||
|
||
### Prerequisites | ||
|
||
Ensure that you have the following installed: | ||
- **Flutter SDK** | ||
- **Dart SDK** | ||
- **Android Studio** (for Android builds) | ||
- **Xcode** (for iOS builds) | ||
|
||
### Installation | ||
|
||
```bash | ||
# Clone the repository | ||
git clone https://github.com/sorydima/REChain-.git | ||
cd REChain- | ||
|
||
# Fetch the dependencies | ||
flutter pub get | ||
``` | ||
|
||
### Building the Project | ||
|
||
#### Android | ||
```bash | ||
flutter build appbundle --release | ||
``` | ||
|
||
#### iOS | ||
```bash | ||
flutter build ios --release --no-codesign | ||
``` | ||
|
||
#### Web | ||
```bash | ||
flutter build web --release | ||
``` | ||
|
||
--- | ||
|
||
## Running the Tests | ||
|
||
To run the unit tests: | ||
|
||
```bash | ||
flutter test | ||
``` | ||
|
||
--- | ||
|
||
## Contributing | ||
|
||
We welcome contributions from the community! To contribute: | ||
1. Fork the repository. | ||
2. Create a new branch. | ||
3. Submit a pull request with a clear description of your changes. | ||
|
||
For more details, check the [CONTRIBUTING.md](CONTRIBUTING.md). | ||
|
||
--- | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. | ||
|
||
--- | ||
|
||
## Support | ||
|
||
If you encounter any issues or have questions, feel free to open an issue in the [GitHub Issues](https://github.com/sorydima/REChain-.git/issues) section or contact us via email. | ||
|
||
--- | ||
|
||
## Connect | ||
|
||
For more information, visit our official website and follow us on social media: | ||
- Website: [rechain.online](https://rechain.online) | ||
- Twitter: [@rechain_inc](https://twitter.com/rechain_inc) | ||
- Telegram: [REChain Community](https://t.me/rechainchat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
1. [Install flutter](https://flutter.dev) | ||
|
||
2. Clone the repo: | ||
``` | ||
git clone https://github.com/sorydima/REChain-.git | ||
cd REChain- | ||
``` | ||
|
||
3. Choose your target platform below and enable support for it. | ||
|
||
3.1 If you want, enable Googles Firebase Cloud Messaging: | ||
|
||
`git apply ./scripts/enable-android-google-services.patch` | ||
|
||
4. Debug with: `flutter run` | ||
|
||
### Android | ||
|
||
* Install CMake from the SDK Manager | ||
|
||
* Build with: `flutter build apk` | ||
|
||
### iOS / iPadOS | ||
|
||
* Have a Mac with Xcode installed, and set up for Xcode-managed app signing | ||
* If you want automatic app installation to connected devices, make sure you have Apple Configurator installed, with the Automation Tools (`cfgutil`) enabled | ||
* Set a few environment variables | ||
* REChain_NEW_TEAM: the Apple Developer team that your certificates should live under | ||
* REChain_NEW_GROUP: the group you want App IDs and such to live under (ie: com.example.rechainonline) | ||
* REChain_INSTALL_IPA: set to `1` if you want the IPA to be deployed to connected devices after building, otherwise unset | ||
* Run `./scripts/build-ios.sh` | ||
|
||
### Web | ||
|
||
* Enable web support in Flutter: https://flutter.dev/docs/get-started/web | ||
|
||
* Build with: | ||
```bash | ||
./scripts/prepare-web.sh # To install libolm | ||
flutter build web --release | ||
``` | ||
|
||
* Optionally configure by serving a `config.json` at the same path as REChain. | ||
An example can be found at `config.sample.json`. None of these | ||
values have to exist, the ones stated here are the default ones. If you e.g. only want | ||
to change the default homeserver, then only modify the `default_homeserver` key. | ||
|
||
### Desktop (Linux, Windows, macOS) | ||
|
||
* Enable Desktop support in Flutter: https://flutter.dev/desktop | ||
|
||
#### Install custom dependencies (Linux) | ||
|
||
```bash | ||
sudo apt install libjsoncpp-dev libsecret-1-dev libsecret-1-0 librhash0 libwebkit2gtk-4.0-dev libolm3 | ||
``` | ||
|
||
* Build with one of these: | ||
```bash | ||
flutter build linux --release | ||
flutter build windows --release | ||
flutter build macos --release | ||
``` | ||
|
||
For encryption support you have to install [libolm](https://gitlab.matrix.org/matrix-org/olm) on your system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
REChain uses REChain_matrix_bASEDProto SDK and API. This is a decentralized platform that allows users to communicate across various clients. To interact with other users on REChain_matrix_bASEDProto, it's essential to understand how to find users and use REChain_matrix_bASEDProto IDs. | ||
|
||
1. 💳 Understanding REChain_matrix_bASEDProto ID: | ||
The REChain_matrix_bASEDProto ID is a unique identifier for each user on the REChain_matrix_bASEDProto platform. It follows the format @username:REChain_matrix_bASEDProto.org, where username is the chosen username of the target user, and REChain_matrix_bASEDProto.org is the user's home server. This ID is crucial for identifying users and communicating directly with them. | ||
|
||
2. 👥 Finding Users in REChain: | ||
To find a user in REChain, open the app and navigate to your chat list. There, you can access the plus sign or the "New Chat" option. Enter the REChain_matrix_bASEDProto ID of the user you want to find and tap on the found users. Note that you need to enter the complete REChain_matrix_bASEDProto ID, including the home server. | ||
|
||
3. 🤔 What is my own REChain_matrix_bASEDProto ID? | ||
In REChain you can see your own REChain_matrix_bASEDProto ID in the settings next to your profile picture and your displayname. On the chat list page, tap on your profile picture to open the pop up menu and then tap on **Settings**. | ||
|
||
Summary: | ||
Using REChain_matrix_bASEDProto IDs and finding users in REChain are simple steps to facilitate communication on the REChain_matrix_bASEDProto platform. REChain_matrix_bASEDProto IDs allow you to connect directly with a user, while joining rooms is an excellent way to discover a community and engage in discussions related to shared interests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## 1. License | ||
REChain is licensed under GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007. Read the license | ||
(https://github.com/sorydima/REChain-/blob/main/LICENSE) and | ||
make sure that your fork is open source under the same license and that you | ||
fulfill all requirements. Maybe you should consider contacting a lawyer **before** | ||
you publish your fork. | ||
|
||
## 2. Disable end-to-end encryption! | ||
Due to US export regulations you are not allowed to publish your app in | ||
a store or anywhere on a US server before you have removed everything regarding | ||
the encryption or fulfill the regulations. | ||
|
||
Learn more: | ||
https://www.bis.doc.gov/index.php/policy-guidance/encryption | ||
|
||
If you need help from us with using E2EE in your fork read more below under the | ||
topic "**Official Support**". | ||
|
||
## 3. Stay up to date! | ||
REChain contains security related stuff. If we find a security bug, we will | ||
try to fix it as soon as possible and ship it with a new version. But this | ||
means that your fork is out of date and a security risk. You can't be awake | ||
24 hours a day so you must decide how you protect your users by chosing one | ||
of the following methods: | ||
|
||
1. Make your fork as minimal as possible and enable repository mirroring. Set | ||
up a CI which publishes new versions automatically if REChain publishes a | ||
bug fix. | ||
2. Never sleep and pay a big team where one guy at least is never sleeping. | ||
3. Contact [Dmitry](https://dmitry.wiki) to buy official support. | ||
|
||
## 4. Official Support | ||
REChain is free as in free speech and not free beer! Please contact | ||
my company [REChain Network Solutions](https://rechain.network) for offers and official support | ||
and take in mind that it costs a lot of work and time to maintain REChain | ||
or the REChain SDK. So we can't give you support for free. So please | ||
expect around 1$ per month per user of your fork. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
REChain supports end-to-end encryption. You can enable it per chat. Once enabled it cannot be disabled anymore for security reasons. You can not enable encryption for public rooms as this makes no sense when anyone can join and leave the room anyway. Once you have enabled encryption, the server is no longer able to read the content of your messages. It will encrypt all text messages and files. | ||
|
||
To be safe from man-in-the-middle attacks, you should take a look at the device list. You can do this in the encryption settings of a chat. Is there a suspicious device which you or your chat partner don't know? Then you can block it by moving the toggle to the left. | ||
|
||
The color of the toggle shows you the security state. Orange means, that this device is not verified. Grey means that it is blocked and won't receive the encryption keys. This means that this device won't be able to read your messages anymore! Green means that this device is verified. | ||
|
||
To verify the devices of another user, start the verification in a direct chat. For this you have a "Start verification" button in the encryption settings of a direct chat. Be sure that you are standing next to this person or you are connected via phone or any other secure channel. When you have started the verification, you will both see a set of emojis on your device. Compare them and tap on "They match". Wait a little bit and then you should see that all devices become green. |
Oops, something went wrong.