Apache License
AlgoChat is a Cross-Platform(Android & iOS) Mobile Application using the Algorand blockchain written in Dart and built on Flutter and others. It actualizes many functionalities viz; chatting with friends, Posting of polls, posting of products/listings(ads), payment for purchases using Algocoins,sending and receiving Algocoins, direct messaging, video chatting, voice chatting, live stream of events and many others.
The AlgoChat Wallet built upon the wallet-core SDK, which provides a set of API's for the AlgoChat platform and its auxiliary services. Those services include:
- Architecture relies on the recently released community SDK, algorand-dart, Bloc,
- The relayer service for fee abstraction
- A predictable state management library and Hive, a lightweight and blazing fast key-value database written in pure Dart.
- Redux for state management (https://pub.dev/packages/flutter_redux)
- Dio for fetching APIs (https://pub.dev/packages/dio)
- GetIt/Injectable for Dependecy Injection (DI) (https://pub.dev/packages/get_It and https://pub.dev/packages/injectable)
- auto_route for routing (https://pub.dev/packages/auto_route)
- Multi language support (i18n)(https://marketplace.visualstudio.com/items?itemName=localizely.flutter-intl)
- Logging using logger (lib/utils/log)
Download the release APK to try out AlgoChat
-
Post photo posts from camera or gallery
- Like posts
- Comment on posts
- View all comments on a post
-
Profile Pages
- Follow / Unfollow Users
- Change image view from grid layout to feed layout
- Add your own bio
- Copy user public address
- Send Algocoins to user, Etc.
-
Activity Feed showing recent likes / comments of your posts + new followers
-
Direct Messaging
-
Video Calls (using Agora functions)
- Custom Camera Implementation
-
Firebase Security Rules
-
Voice Calls (using Agora functions)
-
Live Video Streaming
-
Stories
-
And others here
- Flutter
- Firestore
- Image Picker
- Google Sign In
- Firebase Auth
- UUID
- Dart Image
- Path Provider
- Font Awesome
- Dart HTTP
- Dart Async
- Algorand Dart
- Permission Handler
- Cloud Storage
- Collapsible_Sidebar
- Agora
- Photo View
- Geocoder
- Focused Menu
- Flutter Shared Preferences
- Cached Network Image
- Others
You can download the beta version of our app from the Google Play or the App Store
-
Set up a Flutter environment on your machine.
- You can get started here.
- Make sure to also create a keystore as described here.
-
Connect a phone or run a simulator.
-
Clone the project.
git clone https://github.com/Milimeter/algo_chat cd algochat
If you have any issue cloning this project Chat me upYou can click here
- Make a copy of
.env_example
named.env
-cd environment && cp .env_example .env
- For Android development, create a file at
./android/key.properties
, as described here, containing the keystore path and passwords, as set up earlier. - Run
flutter doctor
to check which tools are installed on the local machine and which tools need to be configured. Make sure all of them are checked and enabled.
-
Then Run the app.
flutter run
If you have some issues running the sample project, make sure Flutter is enabled and active:
- Open plugin preferences (File > Settings > Plugins).
- Select Marketplace, select the Flutter plugin and click Install.
- Restart the IDE
- You'll need to create a Firebase instance. Follow the instructions at https://console.firebase.google.com.
- Once your Firebase instance is created, you'll need to enable Google authentication.
- Go to the Firebase Console for your new instance.
- Click "Authentication" in the left-hand menu
- Click the "sign-in method" tab
- Click "Google" and enable it
- Create Cloud Functions (to make the Feed work)
- Create a new firebase project with
firebase init
- Copy this project's
functions/lib/index.js
to your firebase project'sfunctions/index.js
- Push the function
getFeed
withfirebase deploy --only functions
In the output, you'll see the getFeed URL, copy that. - Replace the url in the
_getFeed
function infeed.dart
with your cloud function url from the previous step.
If you are getting no errors, but an empty feed You must post photos or follow users with posts as the getFeed function only returns your own posts & posts from people you follow.
- Enable the Firebase Database
- Go to the Firebase Console
- Click "Database" in the left-hand menu
- Click the Cloudstore "Create Database" button
- Select "Start in test mode" and "Enable"
- (skip if not running on Android)
- Create an app within your Firebase instance for Android, with package name com.yourcompany.news
- Run the following command to get your SHA-1 key:
keytool -exportcert -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore
- In the Firebase console, in the settings of your Android app, add your SHA-1 key by clicking "Add Fingerprint, if you want to include that to your login access".
- Follow instructions to download google-services.json
- place
google-services.json
into/android/app/
.
- (skip if not running on iOS)
- Create an app within your Firebase instance for iOS, with your app package name
- Follow instructions to download GoogleService-Info.plist
- Open XCode, right click the Runner folder, select the "Add Files to 'Runner'" menu, and select the GoogleService-Info.plist file to add it to /ios/Runner in XCode
- Open /ios/Runner/Info.plist in a text editor. Locate the CFBundleURLSchemes key. The second item in the array value of this key is specific to the Firebase instance. Replace it with the value for REVERSED_CLIENT_ID from GoogleService-Info.plist
Double check install instructions for both
- Google Auth Plugin
- Firestore Plugin
If you opened this file in Vs code, you should have a file structure similar to the image below:
final algodClient = AlgodClient(
apiUrl: PureStake.TESTNET_ALGOD_API_URL,
apiKey: apiKey,
tokenKey: PureStake.API_TOKEN_HEADER,
);
final indexerClient = IndexerClient(
);
final algorand = Algorand(
algodClient: algodClient,
indexerClient: indexerClient,
);
-
Algorand
-
Algorand Accoun Fetch
final accountInformation = await algorand.getAccountByAddress(account.publicAddress);
final amount = information.amountWithoutPendingRewards;
final pendingRewards = information.pendingRewards;
AlgorandBalance(
balance: Algo.fromMicroAlgos(amount).toString(),
),
algoSendDialog(context, {String uid}) {
return showDialog(
context: context,
builder: (context) {
return Container(
height: MediaQuery.of(context).size.height * 0.4,
margin: EdgeInsets.all(35),
Agora.io provides building blocks for you to add real-time voice and video communications through a simple and powerful SDK. You can integrate the Agora SDK to enable real-time communications in your own application quickly. Agora Video SDK requires camera and microphone permission to start video call.
-
Android Open the AndroidManifest.xml file and add the required device permissions to the file.
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- The Agora SDK requires Bluetooth permissions in case users are using Bluetooth devices.--> <uses-permission android:name="android.permission.BLUETOOTH" />
-
iOS Open the Info.plist and add:
Privacy - Microphone Usage Description, and add a note in the Value column. Privacy - Camera Usage Description, and add a note in the Value column.
class CallMethods {
final CollectionReference callCollection =
FirebaseFirestore.instance.collection(CALL_COLLECTION);
Stream<DocumentSnapshot> callStream({String uid}) =>
callCollection.doc(uid).snapshots();
Future<bool> makeCall({Call call}) async {
try {
call.hasDialled = true;
Map<String, dynamic> hasDialledMap = call.toMap(call);
call.hasDialled = false;
Map<String, dynamic> hasNotDialledMap = call.toMap(call);
await callCollection.doc(call.callerId).set(hasDialledMap);
await callCollection.doc(call.receiverId).set(hasNotDialledMap);
return true;
} catch (e) {
print(e);
return false;
Many Others Fuctionalities were discussed and displayed in this app Download and enjoy the App. Thanks