Skip to content

A Real-time chat application designed using flutter and firebase.

Notifications You must be signed in to change notification settings

ANSHIKA010/Talkify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Talkify

A real-time chat application built using Flutter and various services of Firebase, such as, Firebase Authentication, Cloud Storage, Firestore Database, CLoud Functions, etc.
The application allowed users to authenticate through their email and create a customized account. The app is a typical chat application where users can send messages and images to other registered users.

Features

  • Real-time Messaging: Enjoy instant messaging with real-time updates.
  • User Authentication: Securely authenticate users using Firebase Authentication.
  • Firestore Database Integration: Store and retrieve chat messages in real-time using Firebase Cloud Firestore.
  • Cloud Storage: Help to send images via chat and also allow users to customize their profile photo.
  • Flutter UI: Intuitive and responsive user interface built with Flutter for a smooth user experience.
  • Lexical Seach: To find specific users amongst all registered users.

User Flow

UserFlow

System Design

1. System Architecture

The system consists of the following major components:

  • Client Application: Built with Flutter, the client app handles the user interface and interactions, including sending and receiving messages and images.
  • Firebase Authentication: Manages user authentication and secure login using email and password.
  • Firestore Database: A NoSQL database that stores user profiles, messages, and other chat-related data in real-time.
  • Firebase Cloud Storage: Stores media files such as profile pictures and images shared in chat.
  • Cloud Functions: Used for server-side logic, such as sending notifications, handling complex queries, and other backend operations.

2. Component Interaction

  • User Authentication: Users register or log in using their email credentials. Firebase Authentication manages secure sessions.
  • Real-time Messaging: Messages are sent and received in real-time using Firestore, where each conversation is stored as a collection of messages.
  • Media Sharing: Images sent in chat are uploaded to Firebase Cloud Storage, and their URLs are stored in Firestore.
  • Profile Management: Users can update their profiles, including their profile pictures, which are stored in Cloud Storage.

3. Data Flow

  • Auth Section:
    • User opens the app -> Check if the user is logged in.
    • If not logged in -> Redirect to Login or Registration page.
    • Upon successful login -> Redirect to the Dashboard.
  • On Dashboard:
    • Access Conversations, Users, or Profile sections.
    • Start a new conversation or continue an existing one.
  • Messaging:
    • Send text messages or images.
    • Messages are displayed in real-time.

Database Schema

1. Users Collection

Document ID: UserID (auto-generated)
Fields:
email: String - User's email address.
username: String - User's display name.
profileImageUrl: String - URL of the profile picture stored in Cloud Storage.
status: String - User status (online, offline).
createdAt: Timestamp - Account creation date.
lastLogin: Timestamp - Last login date.

2. Conversations Collection

Document ID: ConversationID (auto-generated)
Fields:
participants: Array - List of user IDs participating in the conversation.
lastMessage: String - Preview of the last message sent.
lastMessageTimestamp: Timestamp - Time when the last message was sent.

3. Messages Subcollection (under Conversations)

Document ID: MessageID (auto-generated)
Fields:
senderId: String - User ID of the sender.
text: String - Content of the text message (if any).
imageUrl: String - URL of the image in Cloud Storage (if any).
timestamp: Timestamp - Time when the message was sent.

4. Images Collection (optional, if storing separately)

Document ID: ImageID (auto-generated)
Fields:
uploadedBy: String - User ID who uploaded the image.
imageUrl: String - URL of the image in Cloud Storage.
uploadedAt: Timestamp - Time when the image was uploaded.

Application Interface (Screen Shots)

Project Setup

Follow the instruction below to setup the project on your device.

Prerequisites

Before you begin, ensure you have met the following requirements:

Installation

  1. Clone the repository:

    git clone https://github.com/ANSHIKA010/talkify.git
    
  2. Move to the created directory.

    cd talkify
    
  3. Install Dependencies

    flutter pub get
    
  4. Setup Firebase

    • Create a new project on the Firebase Console.
    • Add an Android and/or iOS app to your Firebase project.
    • Configure your project using flutterfire
  5. Configure and Deploy Cloud Functions

    • Activate the service in firebase project for google cloud functions.
    • Use the functions designed --> File containg functions
    • Deploy those function on firebase.
  6. Run the app

    flutter run
    
    

Contributing

Contributions are welcomed! Please follow the contribution guidelines for details.

Acknowledgments

FLutter Firebase

About

A Real-time chat application designed using flutter and firebase.

Topics

Resources

Stars

Watchers

Forks

Languages