NewsBits is a high-performance, intelligent news reader application built with Modern Android Architecture. It leverages the power of Jetpack Compose for UI, Firebase for backend services (Auth, Firestore, Cloud Functions), Algolia for lightning-fast search, Gemini AI for smart news summarization, and Dagger Hilt for robust Dependency Injection.
Key focus areas: Offline-First, Real-Time Sync, Strict Feature-Driven Architecture, and Premium UX.
- ✨ Features
- 🛠 Tech Stack
- 🧱 Architecture & Design
- 📂 Project Structure
- 🔄 Data Flow & Sync
- 🔥 Firebase Setup
- 🔍 Algolia Search Setup
- 🧠 Gemini AI Setup
- ⚙️ Local Properties Setup
- 🚀 Getting Started
- 🔮 Roadmap
- ⚖️ License
- Real-time News Sync: Fetches global headlines every 7.5 minutes from NewsData.io via Firebase Cloud Functions, syncing seamlessly to Firestore and Algolia.
- Intelligent Search: Powered by Algolia, offering typo-tolerant, instant search results across thousands of articles.
- AI Summaries: Integrated Gemini AI to generate concise or detailed summaries of top stories on demand.
- Offline-First: Built with Room Database and Firestore Offline Persistence to ensure the app works flawlessly without internet.
- "For You" Vertical Feed: A TikTok/Reels-style vertical carousel for immersive news consumption.
- Smart Onboarding: Personalized topic selection and smooth authentication flow (Guest, Google, Email/Password).
- Interactive Explore: Horizontal scrolling headlines, infinite feed, and category filtering.
- Bookmarks & History: Save articles locally and track reading history.
- Secure Auth: Email verification enforcement and secure session management using Credential Manager and Google Identity.
The project utilizes a state-of-the-art modern Android tech stack.
| Category | Libraries / Tools |
|---|---|
| Language | Kotlin (v2.0.21) |
| UI Toolkit | Jetpack Compose (Material 3, Animation, Adaptive) |
| Architecture | MVVM, Clean Architecture, Vertical Slice / Feature Modules |
| DI / Mgmt | Dagger Hilt (Dependency Injection) |
| Backend | Firebase (Auth, Firestore, Cloud Functions, Analytics) |
| Search | Algolia Search (Client Kotlin v3.x) |
| AI / ML | Gemini API (via Ktor Client) |
| Local Data | Room Database (KSP, Coroutines support) |
| Network | Ktor Client (OkHttp engine), NetworkConnectivityObserver |
| Image Loading | Coil Compose |
| Navigation | Navigation Compose (Type-safe navigation) |
| Async | Kotlin Coroutines, Flow |
| Build | Gradle Kotlin DSL (KTS), Version Catalogs (libs.versions.toml) |
The app follows Clean Architecture principles enforced with MVVM (Model-View-ViewModel) and built on a Feature-by-Feature (Vertical Slice) package structure. Dagger Hilt is utilized throughout the app to inject ViewModels, Repositories, Database DAOs, and Network Clients automatically, decoupling creation logic from usage.
- App Level (
NewsBitsApplication): Annotated with@HiltAndroidAppto initialize DI components. - UI Layer (
ui/&feature/.../ui/):- Uses Hilt injected view models (
@HiltViewModel). - Composable screens react to state (
StateFlow). - Material 3 theming implementation.
- Uses Hilt injected view models (
- Data & Domain Layers (
feature/.../data/,feature/.../domain/):- Repositories: Injected cleanly into ViewModels without manual factories.
- Data Sources: Room DAOs and network clients provided by Hilt Modules.
The project has been scaled into strict feature-specific packages for high maintainability:
com.shanudevcodes.newsbits
├── core # Core utilities, theme, navigation setup
├── data # Shared data elements like Repositories and Room DB
├── feature # Vertical Slices (Currently migrating to this architecture)
│ ├── auth # Auth specific UI and Domain
│ └── news # News feature module
├── ui # Traditional UI package (Screens, Animation, Theme)
│ ├── animation
│ ├── screens
│ └── theme
├── viewmodel # ViewModels mapping to screens
├── AuthenticationActivity.kt
├── MainActivity.kt
└── NewsBitsApplication.kt
- Ingestion: A scheduled Firebase Cloud Function fetches news from NewsData.io every 7.5 minutes.
- Storage: Data is cleaned and stored in Firestore.
- Indexing: An
onCreateFirestore trigger automatically pushes new articles to an Algolia Index for search capability. - Consumption:
- The Android app listens to Firestore for real-time feed updates.
- Hilt injects the relevant DAOs, and bookmarks are seamlessly saved in Room.
⚠️ Critical: This project relies extensively on Firebase.
- Create Project: Go to Firebase Console and create a new project.
- Add Android App: Download
google-services.jsonand place it in theapp/directory. - Enable Services:
- Authentication: Email/Password, Google Sign-In. (Add SHA-1 & SHA-256 fingerprints for Google Auth).
- Firestore: Create a database (Production mode).
- Deploy Cloud Functions:
cd functions npm install firebase login firebase deploy --only functions
- Sign up at Algolia.
- Create an Index named
newsbits_articles. - Set Searchable Attributes:
title,description,content,category,source_id. - Copy your App ID and Search API Key.
- Get an API Key from Google AI Studio.
- This key is used securely through
.propertiesinjection to ping the Gemini flash model.
Create a local.properties file in the project root to secure your keys. Do not commit this file.
sdk.dir=C\:\\Users\\YourName\\AppData\\Local\\Android\\Sdk
# Algolia Configuration
ALGOLIA_APP_ID=YOUR_ALGOLIA_APP_ID
ALGOLIA_SEARCH_KEY=YOUR_ALGOLIA_SEARCH_KEY
ALGOLIA_INDEX=newsbits_articles
# Gemini AI
Gemini_API_Key=YOUR_GEMINI_API_KEYThese are automatically injected into BuildConfig by Gradle.
- Android Studio: Ladybug (2024.2.1) or newer recommended.
- JDK: Version 17 or higher (Project uses Kotlin 2.0).
- Firebase Project: Configured as above.
- Clone the repository:
git clone https://github.com/ShanuDevCodes/NewsBits.git cd NewsBits - Add Secrets: Create your
local.propertiesfile with the keys. - Add Firebase Config: Place
google-services.jsoninapp/. - Sync & Build: Open in Android Studio, sync Gradle, and run.
- MVP Release: Core news feed, Auth, Search.
- AI Integration: Gemini Summaries.
- Offline Mode: Room DB Caching.
- Dependency Injection: Integrated Dagger Hilt.
- Vertical Slicing: Refactored to feature-based architecture.
- Bit Digest: Daily AI-curated audio briefings.
- Wear OS Support: Quick headlines on browsing watch face.
Copyright (c) 2026 ShanuDevCodes/NewsBits. All Rights Reserved.
This software is proprietary. You may NOT copy, modify, distribute, publish, transmit, reverse engineer, or otherwise use the Software, in whole or in part, without the express written permission of the owner. See the LICENSE file for complete details.