This is a simple chat application that allows users to register, login, and chat with their friends or family in different rooms. The application uses Firebase for authentication and real-time database, Room for local data storage, LiveData for observing data changes, and ViewModel for managing UI-related data.
- User Registration and Login
- Create and Join Chat Rooms
- Real-time Messaging
- Local Data Storage with Room
- Data Observation with LiveData
- UI State Management with ViewModel
- Android Studio
- A Firebase project with Realtime Database and Authentication set up
-
Clone the repository:
https://github.com/ahmedNaser7/Chat.git
-
Open the project in Android Studio.
-
Add your
google-services.json
file to theapp
directory. -
Sync the project with Gradle files.
-
Set up Firebase Authentication:
- Enable Email/Password authentication in the Firebase console.
-
Set up Firebase Realtime Database:
- Add the required database rules in the Firebase console to allow read and write access.
- Register: Create a new account using an email and password.
- Login: Access the application using the registered credentials.
- Create Room: Create a new chat room to start a conversation.
- Join Room: Join an existing chat room using the room ID.
- Chat: Send and receive messages in real-time.
The application follows the MVVM (Model-View-ViewModel) architecture pattern for a clean separation of concerns and easy testability.
- Model: Contains the data classes and the repository for data handling.
- View: Includes the UI components and observes the data from the ViewModel.
- ViewModel: Acts as a bridge between the Model and the View, holding the UI data and handling logic.