Banana Recognizer Mobile App
Application allows user to generate new ethereum wallet or import existing one via private key. Then application authenticates on backend via signing random message. Then user can set his username bound to his address. Finally when he gets to dashboard he is able to observe his wallet numbers (MATIC, Banana NFT and Banana score) and gain score for every valid banana picture. For gaining score, user need to send some test MATIC to his wallet.
Getting Started
This is flutter project. For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Prerequisites
-
To be sure that you're using proper version of flutter (listed in
.fvm/fvm_config.json), install Flutter Version Management and Configure it with your IDE -
Make sure you have proper version of flutter installed in FVM
Project structure
├── lib - Flutter, platform agnostic code
│ ├── api - Utilities related to backend endpoints integration
│ │ └── ...
│ ├── auth - Global state provider related to auth. Handling communication with wallet and backend
│ │ to authenticate user
│ ├── pages - Pages widgets responsible for displaying full screen views
│ │ ├── auth
│ │ │ ├── private_key_page.dart - Page allowing user to authenticate wallet-wise responsible
│ │ │ │ for generation or import of private key
│ │ │ ├── username_page.dart - Page responsible for allowing user to set his user on backend
│ │ │ │ before we allow him to visite dashboard
│ │ │ └── ...
│ │ └── home
│ │ ├── home_page.dart - User dashboard where user is able to observe his wallet numbers
│ │ │ (MATIC, Banana NFT and Banana score)
│ │ └── ...
│ ├── utils - General purpose utilities
│ │ ├── loader.dart - utility abstracting display of loading spinner during some long running
│ │ │ operations
│ │ └── storage.dart - utility abstracting devices key-value store to perform CRUD operations
│ ├── web3 - Utilities related to integration with solidity contracts (banana nft and score service)
│ ├── widgets - General purpose reusable widgets
│ ├── config.dart - Application config variables
│ └── main.dart - Root of application, routing is handled there
├── android
├── ios
└── ...
Supported devices
Locally application can be run on real devices (android/ios) but only android emulator is supported. Application cannot be run on IOS simulator because of camera support that we need.
Running application
Application could be run via flutter run command. But we highly recommend to configure your IDE for easier running and debugging https://docs.flutter.dev/get-started/editor
Things that could be improved
- Basic config like contract addresses, ABIs, api and rpc endpoints should be obtained from backend to allow to update them without publishing new version of app to store
- Chain also should be dynamic in final version so we would be able to use testnets locally and in prod release change it to mainnet
- Introduce flavors to have staging and prod versions of application pointing to different resources
- Abstract wallet logic so user will be able also to connect 3rd party wallet i.e. via wallet-connect protocol
- Gaining score shouldn't be done via triggering transaction straight from mobile since user which understand how it works can just trigger those transactions directly and skip image verification