How sumit-22/chit-chat works
Project Type & Purpose
• Type: Single-module Android mobile application
• Purpose: Real-time chat client (Chit-Chat) with screens for login, signup, chat list, single chat, statuses, and user profile.
• Key technologies (inferred from file tree and google-services.json):
– Android SDK, Jetpack Compose for UI
– Hilt for Dependency Injection
– MVVM architectural pattern (ViewModels + Composables)
– Firebase services (Authentication, Firestore/Realtime Database, Cloud Messaging)
File Structure & Architectural Patterns
Top-Level:
• app/ : Android application module
– build.gradle.kts, google-services.json → configures Firebase
– src/main/java/com/example/chatsphere/
• LCApplication.kt → custom Application class (initializes Hilt)
• HiltModule.kt → DI bindings
• LCViewModel.kt → central ViewModel
• MainActivity.kt → single-Activity entrypoint
• Screens/ → Compose UI screens
• data/ → data types, constants, event definitions
• ui/theme/ → theming resources
– src/main/res/ → drawables, layouts, themes, XML rules
– androidTest, test/ → instrumentation & unit tests
Architectural Pattern:
• MVVM
– View layer: Compose Screens
– ViewModel: LCViewModel injected via Hilt
– Data layer: Repositories (not explicit in file tree but implied in data package) interacting with Firebase
Key Components
A. Android App (Single module)
1. UI Layer (Jetpack Compose)
– BottomNavigationMenu
– LoginScreen, SignUpScreen
– ChatListScreen, SingleChatScreen
– StatusScreen, SingleStatusScreen, ProfileScreen
2. Presentation / ViewModel Layer
– LCViewModel
– Hilt injection (HiltModule)
3. Data Layer
– Repository interfaces & implementations (wrap Firebase calls)
– DataTypes.kt, Constants.kt, Event.kt
B. External Services (Firebase)
1. Firebase Authentication
2. Firebase Firestore / Realtime Database
3. Firebase Cloud Messaging (for push notifications)
C. Android Platform
– MainActivity (NavHost for Compose)
– Application class (LCApplication) for Hilt integration
D. Local Resources
– Resources (drawables, themes, strings)
Relationships & Interactions
• UI Composables ← (observe LiveData/StateFlow) → LCViewModel
• LCViewModel → (invokes) Repository methods
• Repository → (SDK calls) Firebase Auth / Firestore / Messaging
• Firebase services → (callbacks / listeners) → Repository → LCViewModel → UI
• HiltModule binds Repository and ViewModel into LCApplication