Skip to content

Latest commit

 

History

History
60 lines (50 loc) · 2.3 KB

File metadata and controls

60 lines (50 loc) · 2.3 KB

Flutter Chat application with Firebase

Flutter chat application with login and signup using Firebase.

Short description

Signup form uses Firebase Email and Password authentication with Phone Number verification.

Login form uses Firebase Email and Password authentication with Users stored in firestore database.

Chat uses Firebase Realtime Database.

User profile picture is stored in firebase storage.

Setting up the project

  1. Clone the repository.
  2. Run the following command in the project directory:
    flutter pub get
  3. You'll need to install Firebase CLI.
  4. Log into Firebase using your Google account:
    firebase login
  5. Install the FlutterFire CLI with command:
    dart pub global activate flutterfire_cli
  6. Change your Firebase project plan to Blaze.
  7. Run the following command:
    flutterfire configure
  8. To deploy your functions to Firebase, run the following command:
    cd firebase/functions && firebase deploy --only functions
  9. Update your Firestore rules to allow only authenticated users to access the database.
  10. Update your Firebase Realtime Database rules to allow only authenticated users to access the database.
  11. Finally, run the following command:
    flutter run

Setup example of Realtime database structure for messaging

- chats 
 - chat_id
   - lastMessage: string
   - timestamp: number
   
- members
 - chat_id
    - user_id: true
    - user_id2: true
    
- messages
 - chat_id
    - message_id
       - message: string
       - timestamp: number
       - sender: user_id: string

Screenshots