Skip to content

v1.0

Latest

Choose a tag to compare

@TBA5854 TBA5854 released this 06 Mar 11:01
· 1 commit to main since this release
21006eb

Chat App Documentation

Overview

This is a Flutter-based chat application that provides real-time messaging via WebSocket, user authentication through a REST API, and local message storage using Hive. The app uses Flutter Riverpod for state management and SharedPreferences for storing user data.

Features

  • User Authentication: Signup and login through backend API.
  • Real-Time Messaging: WebSocket-based communication.
  • Local Storage:
    • Hive: Stores chat messages locally.
    • SharedPreferences: Persists authentication tokens and user details.
  • Logout Handling: Clears local storage and resets app state.

Technologies Used

  • Flutter & Dart
  • Hive & Hive Flutter
  • SharedPreferences
  • Dio for HTTP requests
  • WebSockets for real-time messaging
  • Riverpod for state management
  • Freezed & JsonSerializable for immutable data classes

Project Structure

/chat-app
├── lib/
│   ├── controllers/
│   │   ├── LoginSigninControllers.dart
│   │   └── WsController.dart
│   ├── models/
│   │   └── chat.dart
│   ├── pages/
│   │   ├── HomePage.dart
│   │   ├── LoginPage.dart
│   │   ├── SignUpPage.dart
│   │   ├── ChatPage.dart
│   │   └── ProfilePage.dart
│   ├── widgets/
│   │   └── home/
│   │       ├── chatAlert.dart
│   │       ├── chatListWidget.dart
│   │       └── chatListEmpty.dart
│   └── main.dart
├── pubspec.yaml
└── README.md

Setup Instructions

Prerequisites

  • Flutter and Dart installed.
  • Backend API URL configured in a .env file.

Installing Dependencies

Run in your project directory:

flutter pub get

Running the App

Launch the application with:

flutter run

Environment Variables

Create a .env file in lib/assets/ with the following:

BACKEND_URL=https://chatapp-backend-gq65.onrender.com/
WS_URL=wss://chatapp-backend-gq65.onrender.com

License

This project is open-source under the MIT License.


Contributors

TBA5854