Repository navigation
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.mdSetup Instructions
Prerequisites
- Flutter and Dart installed.
- Backend API URL configured in a
.envfile.
Installing Dependencies
Run in your project directory:
flutter pub get
Running the App
Launch the application with:
flutter runEnvironment 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.comLicense
This project is open-source under the MIT License.
Contributors
TBA5854