Skip to content

XChat (Frontend) mobile chat application built using Flutter. Implementing Clean Architecture, Riverpod for state management, and WebSocket for real-time communication.

Notifications You must be signed in to change notification settings

Kirara02/Flutter-ChatApp

Repository files navigation

XChat - Real-time Chat Application with Flutter

Flutter Version Riverpod Version Architecture

This is the frontend repository for the XChat application. The corresponding backend repository (built with Go-Fiber) can be found here: Backend Repository: https://github.com/Kirara02/Go-Fiber-ChatApp.git

XChat is a functional mobile application built using Flutter to provide a modern, fast, and reliable instant messaging platform. This application is designed with Clean Architecture to ensure the code is manageable, scalable, and testable.

Application Screenshots

Here are some of the main screens of the XChat application:

Login Screen Register Screen
Login Screen Screenshot Register Screen Screenshot
Chats List Chat Room
Chats List Screenshot Chat Room Screenshot

Key Features

  • User Authentication: Complete flow for Register, Login, and Logout.
  • Chats List: Displays all chat rooms (private and group) with the last message and timestamp.
  • Real-time Chat: Instant two-way communication using WebSockets.
  • Clean Architecture: Clear separation between Presentation, Domain, and Data layers.
  • Modern State Management: Uses Riverpod for reactive and efficient state management.
  • Error Handling: Robust mechanism for handling network errors.

Technology & Architecture

This project is built with a modern technology stack for Flutter application development:

  • Framework: Flutter
  • Language: Dart
  • State Management: Riverpod with Riverpod Generator for boilerplate-free code.
  • Networking:
  • Routing: GoRouter with Typed Routes for safe navigation.
  • Architecture: Adopts Clean Architecture principles with the following layers:
    • Presentation: UI (Widgets) and Controllers (Notifiers).
    • Domain: Usecases and entity Models.
    • Data: Repositories and DataSources (remote/local).

Getting Started

To run this project in your local environment, follow these steps:

Prerequisites

  • Ensure you have the Flutter SDK installed (version 3.x or newer).
  • An IDE like VS Code or Android Studio.

Installation

  1. Clone this repository:

    git clone [https://github.com/YOUR_USERNAME/xchat.git](https://github.com/YOUR_USERNAME/xchat.git)
    cd xchat
  2. Install dependencies:

    flutter pub get
  3. Run the code generator: Riverpod Generator is used to generate providers. Run the following command to generate the necessary files (.g.dart):

    flutter pub run build_runner watch --delete-conflicting-outputs
  4. Run the application: Ensure you have a running emulator or a connected physical device, then run:

    flutter run

Project Structure

The project's directory structure is designed to be easily navigable and scalable:

lib/
├── src/
│   ├── core/                # Core logic, such as networking, result type, etc.
│   ├── features/            # Main features of the application
│   │   ├── auth/            # Authentication feature (login, register)
│   │   │   ├── data/
│   │   │   ├── domain/
│   │   │   └── presentation/
│   │   └── main/            # Main feature after login (chats, chat room)
│   │       ├── data/
│   │       ├── domain/
│   │       └── presentation/
│   ├── global_providers/    # Global Riverpod providers
│   ├── routes/              # GoRouter configuration
│   └── utils/               # Utilities and extensions
└── main.dart                # Main entry point of the application

Contribution

Contributions are highly appreciated! If you wish to contribute, please fork this repository and create a pull request. For major changes, please open an issue first to discuss what you would like to change.

About

XChat (Frontend) mobile chat application built using Flutter. Implementing Clean Architecture, Riverpod for state management, and WebSocket for real-time communication.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages