IMessenger is a modern Android messaging application designed for school environments, facilitating communication between students, alumni, and administration.
- User Authentication: Secure login and registration using Firebase Authentication (Email/Password & Google Sign-In).
- Real-time Messaging: Instant messaging with individuals and groups using Firebase Firestore.
- Group Chats:
- Class Groups: Automatically added based on student level.
- Club Groups: Join clubs and societies.
- Alumni Network: Dedicated channel for alumni.
- Public Channels: General school announcements.
- Event Channels: Discussions for upcoming events.
- Profile Management: Edit profile details, view other users' profiles.
- Dark Mode: Fully supported dark theme for comfortable viewing at night.
- Push Notifications: Receive alerts for new messages (FCM).
- Modern UI: Clean, responsive interface built with Material Design components.
The application follows the MVVM (Model-View-ViewModel) architectural pattern combined with the Single Activity Architecture recommended by Google. This ensures a robust, testable, and maintainable codebase.
- Single Activity:
MainActivityserves as the entry point and container for the entire application, hosting various Fragments via the Navigation Component. - Navigation Component: Manages app navigation, including the back stack, deep linking, and fragment transitions with animations.
- Model: Represents the data and business logic (e.g.,
User,ChatMessage,Group). - View: UI components (Fragments) that observe the ViewModel and update the UI.
- ViewModel: Acts as a bridge between the View and the Repository, holding UI-related data and handling logic.
- Repository: Manages data operations, abstracting the data sources (Firebase Firestore, Auth). Implemented as Singletons to ensure a single source of truth and efficient resource management.
- AppExecutors: A centralized thread pool manager to handle background operations (disk, network) efficiently, preventing thread explosion and UI jank.
- Repositories:
AuthRepository,ChatRepository,UserRepository(Singleton Pattern). - ViewModels:
LoginViewModel,RegisterViewModel,ChatListViewModel,ChatViewModel,ProfileViewModel. - Fragments:
LoginFragment,ChatListFragment,ChatFragment,ProfileFragment,SettingsFragment, etc. - Navigation:
nav_graph.xmldefines the application flow and transitions.
- Language: Java
- Backend: Firebase (Authentication, Firestore, Storage, Cloud Messaging)
- UI: XML Layouts, Material Design Components (Material 3 recommended), AndroidX
- Navigation: Android Jetpack Navigation Component
- Image Loading: Glide
- Architecture: MVVM, Single Activity, Android Jetpack (ViewModel, LiveData, ViewBinding)
- Clone the repository.
- Open the project in Android Studio.
- Connect the project to your Firebase Console project.
- Add
google-services.jsonto theapp/directory. - Enable Authentication (Email/Password, Google).
- Enable Firestore Database.
- Enable Cloud Messaging.
- Add
- Build and run the application.
See roadmap.md for future plans.
- End-to-End Encryption: Implemented AES-256 GCM (Galois/Counter Mode) with NoPadding for secure message encryption.
- Messages are encrypted before being sent to Firestore.
- Prevents plain-text data leakage in the database.
- Includes integrity checks (Auth Tag) and random IVs for each message.
- Safety Checks: The application now strictly prevents sending messages if encryption fails, ensuring no plain-text messages are ever stored.
- Cleanup: Removed unused test boilerplate (
ExampleUnitTest,ExampleInstrumentedTest) to keep the codebase clean. - Optimization: Improved
ChatRepositorylistener management to prevent memory leaks and duplicate message handling.