Git Product home page Git Product logo

phorvicheka-flutter / flutter_group_chat_app_with_firebase Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rodrigobertotti/flutter_group_chat_app_with_firebase

0.0 0.0 0.0 1.85 MB

A complete Flutter Group Chat App with Firebase that supports video calls. It handles typing, received and read indicators, Group Management, closed app and opened app notifications, security, account creation, login, mutex for generating the numeric Agora UID and more.

License: MIT License

JavaScript 0.36% Ruby 0.91% C++ 7.22% C 0.43% Objective-C 0.01% Kotlin 0.04% Dart 75.62% TypeScript 8.25% Swift 0.83% HTML 0.59% CMake 5.73%

flutter_group_chat_app_with_firebase's Introduction

Flutter Group Chat App with Firebase

A complete Flutter Group Chat App with Firebase that supports video calls. It handles typing, received and read indicators, Group Management, closed app and opened app notifications, security, account creation, login, mutex for generating the numeric Agora UID and more.

  • Firebase Cloud Messaging (FCM) is used to send push notifications when the user sends a new message or joins a video call.
  • Firebase Cloud Functions: The backend that handles the Agora token request so the user can join the call. It also runs triggers when a Firestore document changes, like sending push notifications when a new message is created.
  • Video Calls are handled with Agora, the package agora_rtc_engine is used to handle video calls, agora_uikit is used for the video call screen layout.
  • Firestore Security Rules: firestore.rules file contains rules like: only admins can add users to the group, users can only see public data of other users, etc.
  • Firestore Indexes: firestore.indexes.json file contains the Firestore indexes.

Platforms

Android iOS Web
Video Calls โœ… โœ… โŒ
All other features โœ… โœ… โœ…

Getting Started

Step 1:

To get started, open the terminal in the flutter_app folder.

Go to your Firebase project > Click on the Engine โš™๏ธ button right to "Project Overview" > Copy your Project ID Follow the instructions of Add Firebase to your Flutter app and run these two commands inside the flutter_app folder, replace paste-your-project-id-here with your own Project ID.

dart pub global activate flutterfire_cli
flutterfire configure --project=paste-your-project-id-here

Go to your Firebase Console > Build > Authentication > Get Started > Sign-in method > Email/Password and enable Email/Password and save it.

Go to your Firebase Console > Build > Firestore Database > Create database. You can choose any option (Start in production mode or Start in test mode), it's not important because we will update the security rules in the following steps.

Step 2: Push notifications (optional)

iOS and Web platforms require additional configuration for Firebase Cloud Messaging (FCM), so you can show push notifications when a user receives a new text message.

iOS

Follow these instructions on iOS.

Web

A vapidKey is required for web.

  1. Get your vapidKey on the Firebase Console, you can check the instructions here.
  2. Go to the file flutter_app/lib/core/domain/services/notifications_service.dart
  3. Replace the value of _vapidKeyForWeb with your own vapidKey

Set the environment on the web/environment file:

  1. Copy the values from web field in the flutter_app/lib/firebase_options.dart file
  2. Paste the values in the flutter_app/web/environment.js file

Step 3: Video Calls (optional)

  1. Create your Agora account, go to the projects page and click on "Create a Project"
  2. Under "Authentication" choose the Secured mode: APP ID + Token (Recommended) option
  3. Copy the App ID value and save in your notepad so that we can use later
  4. Click on "Configure"
  5. On "App Certificate", copy the Primary Certificate value as well
  6. Go to functions/environment.ts and set the Agora App ID and App Certificate.
  7. Go to flutter_app/lib/environment.dart and set only the Agora App ID there.

โš ๏ธ Do not expose your App Certificate

Step 4: Deploying

  • Run npm install -g firebase-tools to install the Firebase CLI
  • Run firebase use --add and select your Firebase project, add any alias you prefer
  • Optional: In case you prefer not deploying to web, go to firebase.json file and remove the hosting object
  • And finally, run firebase deploy, so the firestore security rules will be updated, cloud functions and indexes will be created.

Getting in touch

Feel free to open a GitHub issue about:

  • โ” questions

  • ๐Ÿ’ก suggestions

  • ๐Ÿœ potential bugs

License

MIT

Contacting me

๐Ÿ“ง [email protected]

flutter_group_chat_app_with_firebase's People

Contributors

rodrigobertotti avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.