All Projects → hadilq → rust-flutter-reactive

hadilq / rust-flutter-reactive

Licence: Apache-2.0 license
This is a sample app to improve consistency over Mobile App Development.

Programming Languages

rust
11053 projects
dart
5743 projects
c
50402 projects - #5 most used programming language
ruby
36898 projects - #4 most used programming language
Nix
1067 projects
kotlin
9241 projects

Projects that are alternatives of or similar to rust-flutter-reactive

winsafe
Windows API and GUI in safe, idiomatic Rust.
Stars: ✭ 110 (+340%)
Mutual labels:  native, ffi
windigo
Windows API and GUI in idiomatic Go.
Stars: ✭ 187 (+648%)
Mutual labels:  native, ffi
PointerScript
Scripting language with pointers and native library access.
Stars: ✭ 26 (+4%)
Mutual labels:  native, ffi
Dart native
Write iOS&Android Code using Dart. This package liberates you from redundant glue code and low performance of Flutter Channel.
Stars: ✭ 564 (+2156%)
Mutual labels:  native, ffi
Android Luajit Launcher
Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
Stars: ✭ 87 (+248%)
Mutual labels:  native, ffi
sqlite3
The fastest and correct module for SQLite3 in Deno.
Stars: ✭ 143 (+472%)
Mutual labels:  native, ffi
SwiftObserver
Elegant Reactive Primitives for Clean Swift Architecture #NoRx
Stars: ✭ 14 (-44%)
Mutual labels:  reactive, clean-architecture
react-native-fast-openpgp
OpenPGP for react native made with golang for fast performance
Stars: ✭ 29 (+16%)
Mutual labels:  flatbuffers, ffi
titanium-vue
Use Vue.js to easily create native mobile apps with Axway Appcelerator Titanium.
Stars: ✭ 45 (+80%)
Mutual labels:  native
Dads
*BA DUM TSSS*
Stars: ✭ 240 (+860%)
Mutual labels:  clean-architecture
springboot-rsocketjwt-example
Example of using JWT with RSocket and Spring Boot
Stars: ✭ 26 (+4%)
Mutual labels:  reactive
webgl-raub
WebGL bindings to desktop OpenGL
Stars: ✭ 66 (+164%)
Mutual labels:  native
clean-gin
Implementation of clean architecture in Go, Gin with dependency injection.
Stars: ✭ 181 (+624%)
Mutual labels:  clean-architecture
haskell-libui
Haskell bindings to the libui C library.
Stars: ✭ 45 (+80%)
Mutual labels:  ffi
elastic-composer
Client-side Elasticsearch query generator and executor. Filter fields, find search suggestions, and paginate query results for your indicies using a simple, reactive, and high-level API
Stars: ✭ 14 (-44%)
Mutual labels:  reactive
blog
📓前端博客👏 ⭐⭐⭐鼓励一下👉
Stars: ✭ 41 (+64%)
Mutual labels:  native
deep-state-observer
State library for high performance applications.
Stars: ✭ 25 (+0%)
Mutual labels:  reactive
jspaint.exe
🌂JS Paint ~~ as a cross-platform native desktop app. In other words, the "🎨 Classic MS Paint, REVIVED + ✨Extras".exe hehe
Stars: ✭ 117 (+368%)
Mutual labels:  native
agile
🌌 Global State and Logic Library for JavaScript/Typescript applications
Stars: ✭ 90 (+260%)
Mutual labels:  reactive
node-express-clean-architecture
A modular folder structure for developing highly scalable and maintainable APIs in nodejs using express.
Stars: ✭ 41 (+64%)
Mutual labels:  clean-architecture

Rust Flutter Reactive

This is a sample app to improve consistency over Mobile App Development. You can find more explanation below. By the way, I started playing with fluterust sample, but in the end, by reorganize its structure and architecture, and also don't rely on FFI code generations, come up with this solution, so part of the code here is just a copy of that sample.

Technologies

The followings are the libraries and technologies that are used in this sample.

  • Rust as the main part of the app. Tried to create it as scalable as possible.
  • Dependency Injection.
  • Applying Dependency Inversion Principle on module level, where you can find implement/interface modules.
  • Flutter as the ui framework. You can find the flutter project in ui directory.
  • Clean Architecture as you can find the domain, data, and presentation layers in domain, data, and presentaiton directories. The data layer is completely empty and just created to show how wire up these layers.
  • FFI as Foreign function interface and bridge between Rust and Dart code in Flutter. You can find this bridge in bridge-ffi directory.
  • Flatbuffers as the serializer of the bridge. Thanks to fast and scalable serialization of Flatbuffers, this project can be easily plugged out of Flutter and attached to other ui frameworks if exists! Also it make this project scalable without touching the FFI bridge code(Just in case of error or memory leak you may need to touch it). Flatbuffers generates the state and action, where both of them are tree structures, so each developer can work on their branches without conflicting with other developers. Scalability is in the heart of this sample.
  • Redux as the architectural pattern of presentation layer. It designed to be fractal(The tree structure that mentioned before), so it's highly scalable among large number of developers.

Enjoy!

Why Rust?

I can mention the following for my choice.

  • Performance for sure.
  • Strong typing up to constant generics, which means scalability. This one is highly important in my mind, as it can makes you 10x developer by avoiding future bugs and inconsistencies. By up to constant generics, I mean its type system is stronger than Java, Kotlin, Swift, etc. so the code base will be more scalable in Rust.
  • Super fast compiling when you re-run the tests.
  • Compiler messages are more like Stackoverflow posts. Most of them guide you to the correct solution.
  • The same as Dart it makes the code independent of platform.

Why Flutter?

It makes the code independent of the platform. As an Android developer, we face solving problems of Android fragmentation, much frequently than it should be. Add to these inconsistencies, every company deals at least with two sets of developers, Android and iOS developers, for the same problem. If you have the same use-case/validation in backend and frontend you have more than two sets of developers for the same problem. This inconsistencies in worst cases produce bugs. But even when there is no bug, they make users angry why the same feature is working differently in two platforms. By making your code independent of platform you can make it consistent. However, everything is a trade-off. The price you pay for consistency among all platforms is the size of the app. For instance, the size of the app-debug.apk file of this sample is 38M, which I think worth it.

Run/Test

You need to install:

  • xcode if you're on a mac
  • Android Studio, Android sdk, and Android ndk
  • flatbuffer
  • rust's rustup, cargo, cargo-make and the targets
  • flutter

To build and run tests just use standard cargo commands.

cargo test

Before making the artifacts from rust code first run

rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
rustup target add aarch64-apple-ios x86_64-apple-ios
cargo install cargo-make

Then build the shared libraries by

cargo make

To run the flutter app

cd ui && flutter run

Nix

If you're familiar with Nix, you just need to install:

  • xcode if you're on a mac
  • Android Studio, and Android sdk
  • flutter

and Nix will take care of the rest by

nix-shell shell.nix
$ cargo test
$ cargo make

It'll build the shared libraries for Android and iOS. Then you can exit the shell, and continue on flutter:

cd ui && flutter run

Questions/Problems

Please feel free to fill an issue to ask questions or report issues. Also creating PRs are welcomed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].