How raj-pavara/word-wave works
Project type and purpose
• Word Wave is a full-stack mobile chat application (Android client) that leverages Firebase for backend services (Authentication, Firestore, Realtime Database, Storage) and ZegoCloud for audio/video calling.
• The app is organized around five user-facing sections: Authentication, Profile Initialization/Edit, Main Activity (with Chat List, Photo Status, Profile Info, Search User), Individual Chat, and Individual User Info.
File structure
• Top-level “app” module contains all Android code and resources.
• src/main/java/com/example/wordwave: Activities (Authentication, ForgetPassword, OTP_Verification, PhoneNumber_Authentication, Splash_Screen, MainActivity, IndividualChat, IndividualUserInfo, PhotoStatus, ProfileFragment, StatusFragment, ChatsFragment), helper classes (MessageModel, ToastMaker), adapters (RecyclerAdapter*, Custom_Viewpager_Adapter), dialogs (ProfilePicDialog)
• Build scripts: Gradle Kotlin DSL (build.gradle.kts, settings.gradle.kts, libs.versions.toml)
• No custom backend code—push/pull goes to Firebase and ZegoCloud SDKs.
README for architecture insights
• Authentication via Firebase Auth (Google, Email/Password, Phone/OTP).
• User profile data in Firebase Firestore; profile images in Firebase Storage.
• Chat messages and user status (“online” flag, last seen) in Firebase Realtime Database.
• Photo status files also in Realtime Database + Storage.
• ZegoCloud SDK used for in-app audio/video calls.
• UI flows orchestrated by Activities + Fragments + RecyclerViews.
Main components
a. Android Client
• UI Layer: Activities & Fragments (Authentication screens, Profile Init/Edit, MainActivity tabs, IndividualChat, IndividualUserInfo)
• Presentation/Adapter Layer: RecyclerView Adapters, Custom Viewpager Adapter, Dialogs
• Domain/Model Layer: MessageModel, user-status models, utilities (ToastMaker)
• Service Layer: Firebase SDK clients, ZegoCloud SDK client
b. Firebase Backend Services
• Authentication Service (OAuth & custom email/phone)
• Firestore (user profile collection)
• Realtime Database (chat messages, status, photo statuses)
• Storage (profile pictures, status images)
c. ZegoCloud Audio/Video Calling Service
d. External Services
• Google Sign-In API
• Device notifications (if applicable)
Relationships and data flows
• User opens Android app → UI Layer (Activity/Fragment)
• App calls Firebase Auth to sign in/up → Auth Service
• On successful auth → Firestore read/write for profile init/edit; Storage uploads images
• In MainActivity:
• Chat List & Search User → reads chat partners from Realtime DB → displays via RecyclerView
• Photo Status → reads/writes status entries (image URLs) in Realtime DB & Storage
• Profile Info → reads user document from Firestore
• Individual Chat → two-way streaming with Realtime DB for messages and user status flags
• Audio/Video Call buttons → invoke ZegoCloud SDK APIs → stream peer-to-peer or via ZegoCloud servers
• External Google Sign-In flow delegates back to Firebase Auth
Architectural patterns and design principles
• Separation of Concerns:
• UI Components (Activities/Fragments) only handle user interaction
• Adapters handle data binding for RecyclerViews
• Service Layer (Firebase & ZegoCloud clients) encapsulates network calls
• Model classes encapsulate data structures
• Reactive / Event-Driven updates via Firebase Realtime listeners
• Stateless UI; state persists in Firebase services