Skip to content

thenitishmind/Chatify---Flutter-Firebase-Chat-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’¬ Chatify - Flutter Firebase Chat Application

A modern, real-time chat application built with Flutter and Firebase that provides seamless messaging experience with user authentication, media sharing, and live chat functionality.

πŸ“± Features

  • βœ… User Authentication (Login/Register)
  • βœ… Real-time Messaging
  • βœ… Image Sharing
  • βœ… User Profile Management
  • βœ… Online Status Tracking
  • βœ… Chat History
  • βœ… Responsive UI Design
  • βœ… Dark/Light Theme Support

πŸ—οΈ Project Architecture

MVVM Pattern with Provider State Management

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     View        │◄──►│   ViewModel     │◄──►│     Model       β”‚
β”‚   (Pages/UI)    β”‚    β”‚  (Providers)    β”‚    β”‚ (Services/Data) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‚ Project Structure

lib/
β”œβ”€β”€ 🏠 main.dart                    # Application entry point
β”œβ”€β”€ πŸ“„ firebase_options.dart        # Firebase configuration
β”‚
β”œβ”€β”€ πŸ“ models/                      # Data Models
β”‚   β”œβ”€β”€ πŸ‘€ chat_user.dart          # User data model
β”‚   β”œβ”€β”€ πŸ’¬ chat_message.dart       # Message data model
β”‚   └── πŸ—£οΈ chat.dart               # Chat conversation model
β”‚
β”œβ”€β”€ πŸ“ pages/                       # UI Screens
β”‚   β”œβ”€β”€ 🌟 splash_page.dart        # App loading screen
β”‚   β”œβ”€β”€ πŸ” login_page.dart         # User login interface
β”‚   β”œβ”€β”€ ✍️ register_page.dart      # User registration interface
β”‚   β”œβ”€β”€ 🏑 home_page.dart          # Main navigation hub
β”‚   β”œβ”€β”€ πŸ’¬ chats_page.dart         # Chat conversations list
β”‚   β”œβ”€β”€ πŸ—¨οΈ chat_page.dart          # Individual chat interface
β”‚   └── πŸ‘₯ users_page.dart         # Available users list
β”‚
β”œβ”€β”€ πŸ“ providers/                   # State Management (MVVM)
β”‚   β”œβ”€β”€ πŸ”‘ authentication_provider.dart    # Auth state management
β”‚   β”œβ”€β”€ πŸ’¬ chats_page_provider.dart       # Chats list state
β”‚   β”œβ”€β”€ πŸ—¨οΈ chat_page_provider.dart        # Individual chat state
β”‚   └── πŸ‘₯ users_page_provider.dart       # Users list state
β”‚
β”œβ”€β”€ πŸ“ services/                    # Business Logic & APIs
β”‚   β”œβ”€β”€ πŸ—„οΈ database_service.dart   # Firestore operations
β”‚   β”œβ”€β”€ ☁️ cloud_storage_service.dart     # Firebase Storage
β”‚   β”œβ”€β”€ πŸ“± media_service.dart      # Image/Media handling
β”‚   └── 🧭 navigation_service.dart # Route management
β”‚
β”œβ”€β”€ πŸ“ widgets/                     # Reusable UI Components
β”‚   β”œβ”€β”€ πŸ“ custom_input_fields.dart       # Input components
β”‚   β”œβ”€β”€ πŸ“‹ custom_list_view_tiles.dart    # List item components
β”‚   β”œβ”€β”€ πŸ’­ message_bubbles.dart    # Chat message UI
β”‚   β”œβ”€β”€ πŸ”˜ rounded_button.dart     # Button components
β”‚   β”œβ”€β”€ πŸ–ΌοΈ rounded_image.dart      # Image components
β”‚   └── πŸ“Š top_bar.dart            # App bar component
β”‚
└── πŸ“ utils/                       # Helper Functions
    └── πŸ” firebase_api_health_check.dart # API status checker

πŸ”§ Core Components

πŸ”‘ Authentication System

  • Provider: AuthenticationProvider
  • Features: Login, Registration, Session Management
  • Backend: Firebase Authentication

πŸ’¬ Chat System

  • Provider: ChatPageProvider
  • Features: Real-time messaging, Message history
  • Backend: Cloud Firestore

πŸ‘₯ User Management

  • Provider: UsersPageProvider
  • Features: User discovery, Profile management
  • Backend: Firestore + Firebase Storage

πŸ“± Media Handling

  • Service: MediaService
  • Features: Image picking, Upload/Download
  • Backend: Firebase Cloud Storage

πŸš€ Workflow Chart

graph TD
    A[πŸš€ App Launch] --> B[🌟 Splash Screen]
    B --> C{πŸ” User Authenticated?}
    
    C -->|No| D[πŸ“ Login Page]
    C -->|Yes| E[🏑 Home Page]
    
    D --> F[πŸ”‘ Firebase Auth]
    D --> G[✍️ Register Page]
    G --> F
    
    F -->|Success| H[πŸ‘€ Create User Profile]
    F -->|Failure| I[❌ Show Error]
    I --> D
    
    H --> J[πŸ’Ύ Store in Firestore]
    J --> E
    
    E --> K[πŸ“± Bottom Navigation]
    K --> L[πŸ’¬ Chats Tab]
    K --> M[πŸ‘₯ Users Tab]
    
    L --> N[πŸ“‹ Load Chat List]
    N --> O[☁️ Firestore Query]
    O --> P[πŸ“„ Display Chats]
    P --> Q{πŸ“± Chat Selected?}
    Q -->|Yes| R[πŸ—¨οΈ Open Chat Page]
    
    M --> S[πŸ‘₯ Load Users List]
    S --> T[☁️ Firestore Query]
    T --> U[πŸ“„ Display Users]
    U --> V{πŸ‘€ User Selected?}
    V -->|Yes| W[πŸ†• Create/Open Chat]
    W --> R
    
    R --> X[πŸ’­ Real-time Chat Interface]
    X --> Y[πŸ“ Type Message]
    X --> Z[πŸ“· Send Image]
    
    Y --> AA[πŸ’Ύ Send to Firestore]
    Z --> BB[☁️ Upload to Storage]
    BB --> CC[πŸ”— Get Download URL]
    CC --> AA
    
    AA --> DD[πŸ“‘ Real-time Update]
    DD --> EE[πŸ“± Update UI]
    EE --> X
    
    style A fill:#e1f5fe
    style E fill:#e8f5e8
    style R fill:#fff3e0
    style F fill:#fce4ec
Loading

πŸ“Š Detailed Component Workflow

1. πŸ” Authentication Flow

User Input β†’ Validation β†’ Firebase Auth β†’ User Profile Creation β†’ Database Storage β†’ Navigation

2. πŸ’¬ Chat Creation Flow

Select User β†’ Check Existing Chat β†’ Create New/Open Existing β†’ Real-time Listener β†’ UI Update

3. πŸ“€ Message Sending Flow

Compose Message β†’ Validate Content β†’ Upload Media (if any) β†’ Store in Firestore β†’ Real-time Broadcast

4. πŸ“₯ Message Receiving Flow

Firestore Listener β†’ Data Parsing β†’ UI State Update β†’ Message Display β†’ Read Status Update

πŸ› οΈ Technologies Used

Frontend

  • Flutter - Cross-platform UI framework
  • Dart - Programming language
  • Provider - State management
  • Material Design - UI/UX framework

Backend & Services

  • Firebase Authentication - User management
  • Cloud Firestore - Real-time database
  • Firebase Storage - Media file storage
  • Firebase Analytics - User analytics

Additional Packages

  • get_it - Dependency injection
  • file_picker - Media file selection
  • flutter_spinkit - Loading animations
  • timeago - Relative time formatting
  • flutter_keyboard_visibility - Keyboard detection

πŸ“± App Flow Description

🌟 Splash Screen

  • App initialization
  • Firebase configuration
  • Authentication state check
  • Route to appropriate screen

πŸ” Authentication Pages

  • Login: Email/password validation, Firebase auth
  • Register: User data collection, profile creation
  • Error handling: Input validation, network errors

🏑 Home Page

  • Bottom navigation setup
  • Tab management (Chats, Users)
  • Real-time data synchronization
  • User status updates

πŸ’¬ Chats Page

  • Chat conversations list
  • Last message preview
  • Unread message indicators
  • Pull-to-refresh functionality

πŸ‘₯ Users Page

  • Available users discovery
  • User search functionality
  • Online status indicators
  • Chat initiation

πŸ—¨οΈ Chat Page

  • Real-time messaging interface
  • Message type handling (text/image)
  • Media upload/download
  • Message status indicators
  • Keyboard management

πŸ”§ Setup Instructions

Prerequisites

  • Flutter SDK (>=2.12.0)
  • Firebase project setup
  • Android Studio / VS Code

Installation Steps

  1. Clone the repository
git clone <repository-url>
cd Chatify - Flutter Firebase Chat Application
  1. Install dependencies
flutter pub get
  1. Firebase Setup
  • Create Firebase project
  • Add Android/iOS apps
  • Download config files:
    • google-services.json β†’ android/app/
    • GoogleService-Info.plist β†’ ios/Runner/
  1. Enable Firebase services
  • Authentication (Email/Password)
  • Cloud Firestore
  • Firebase Storage
  1. Run the application
flutter run

πŸš€ Build & Deploy

Debug Build

flutter run

Release Build

flutter build apk --release
flutter build ios --release

Install on Device

flutter install

πŸ”’ Security Features

  • Authentication: Secure Firebase Auth
  • Data Validation: Input sanitization
  • Privacy: User data protection
  • Storage Rules: Firestore security rules

πŸ“ˆ Performance Optimizations

  • Lazy Loading: Efficient data fetching
  • Image Caching: Optimized media loading
  • Real-time Updates: Efficient listeners
  • Memory Management: Proper disposal

🎨 UI/UX Features

  • Responsive Design: Adaptive layouts
  • Theme Support: Light/dark modes
  • Animations: Smooth transitions
  • Accessibility: Screen reader support

🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Developer

Nitish - Flutter Developer

πŸ™ Acknowledgments

  • Flutter team for the amazing framework
  • Firebase for backend services
  • Material Design for UI guidelines
  • Open source community for packages

Built with ❀️ using Flutter & Firebase

About

Chatify is a cross-platform real-time chat application built with Flutter and Firebase. It features user authentication, real-time messaging, image sharing, light/dark themes, and a clean MVVM architecture using Provider. Designed for seamless user experience across mobile and web, it demonstrates modern state management and backend integration.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors