129

NewsBites

"NewsBites" is a cross-platform mobile short news app. It enhances news reading with personalized, swipeable feeds and concise summaries using Flutter, FastAPI, MongoDB, and the BART model. The app focuses on user-friendly features like passwordless login and personalized content, revolutionizing how users engage with digital news. Also my master’s project.

Animated-smartphones_-slider-remix_%283%29.gif

Introduction

💡 "NewsBites" is currently in the final stages of development and is awaiting approval from Apple to be published on the App Store. It will be available soon on App Store

As we navigate our rapidly evolving digital world, the way we access and engage with news continues to change. Traditional platforms often overwhelm users with an abundance of information, making staying informed feel burdensome rather than a choice. This issue inspired me to develop a solution that addresses these problems while enhancing the digital news experience. The result is "NewsBites," a project I undertook as part of my Master's degree at the University of Massachusetts, Dartmouth.

"NewsBites" aims to simplify and personalize the news reading experience. It utilizes state-of-the-art technologies like Flutter, FastAPI, MongoDB, and the BART language model, to deliver news in a manageable and engaging manner. The app features a user-friendly, swipeable news feed, inspired by popular social media platforms, and a rule-based recommendation system that tailors content to individual preferences. Passwordless authentication further streamlines the user experience, providing secure and effortless access.

In this blog, I'll share the motivations behind "NewsBites," the technology powering it, and the challenges and successes I encountered along the way. Whether you're a technology enthusiast, an avid news reader, or someone interested in digital innovation, I hope this blog provides insight into the meticulous process behind creating an application that aims to redefine news consumption.

Motivation

The shift towards mobile news consumption has been swift, but many existing applications still overwhelm users with excessive content and offer little personalization. Popular platforms like “Inshorts” in India deliver concise news, but lack cross-platform availability and personalized content, leading to a generic and often unsatisfying user experience. Furthermore, there's no comparable app for news consumption in the US market.

Identifying these limitations, I was driven to create "NewsBites," leveraging advanced technology to provide a more personalized and engaging news experience. The app includes a swipeable news feed, inspired by social media platforms like TikTok, enhancing user interaction and creating a more dynamic experience.

"NewsBites" integrates a rule-based recommendation system, which adapts to user preferences over time, ensuring content relevance and reducing information overload. The use of technologies like Flutter, FastAPI, MongoDB, and the BART language model supports the app's goal of transforming the news consumption experience.

The Goals

The primary goal was to create an intuitive, user-centered news application that leverages cutting-edge technology to offer a personalized and engaging user experience. I envisioned "NewsBites" as a platform that could:

  1. Reduce content overload through personalized news feeds.
  2. Increase user engagement with interactive news consumption formats.
  3. Improve accessibility and usability across various devices using a cross-platform approach.

How I Built NewsBites

Technology Stack

Building "NewsBites" involved selecting a technology stack that could support a robust, scalable, and interactive mobile news application. Here's how each technology was chosen and utilized:

  1. Flutter: Selected for its capacity to deliver a native cross-platform experience, Flutter was used to build a seamless interface that functions smoothly on both iOS and Android. Its rapid development capabilities and extensive widget library expedited the creation of a polished user interface.
  2. FastAPI: This modern, high-performance web framework was used for building the backend. FastAPI's ability to handle asynchronous requests makes it ideal for managing the volume of data and user queries that "NewsBites" processes daily, ensuring quick server responses.
  3. MongoDB: Chosen for its flexibility and powerful querying capabilities, MongoDB stores user data and news content. Its schema-less nature allows for quick iterations during the development phase without significant database restructuring.
  4. BART Language Model (Pre-trained on CNN News Data from Hugging Face): Used for summarizing news content, the BART model offers state-of-the-art text summarization capabilities, crucial for converting lengthy articles into concise, readable summaries. Fine-tuned on news data, it ensures the summaries are accurate and contextually relevant.

Methodology -

The architecture of "NewsBites" is designed to be robust and scalable, integrating various services and components to deliver a seamless news reading experience:

  1. Frontend (Flutter App): This is the part that you interact with! It presents news in a fun and engaging format, keeps track of your choices, and sends requests to the backend to bring you fresh news. It also keeps a record of how much time you spend on a particular news item or category.

    1. Comes with dark and light theme
    2. To make my code fast, easy and reusable, I make use of state management called BloC state management.
  2. Authentication (Supabase): I prefer things to be simple and secure, so I decided to skip passwords altogether! Instead, I implemented a system that uses social logins and sends magic links directly to your email for a hassle-free sign in.

  3. Backend (FastAPI): Processes requests, fetches news data, and manages all computational tasks, including user authentication and data storage and the recommendation engine.

    1. Recommendation Engine - Our recommendation engine isn't overly complex—it's all about rules. It starts by paying attention to how you interact with the app, like how long you spend reading certain pieces or which categories you tend to prefer. It then uses this info to keep your profile and preferences up to date. So when it's time to suggest content, the engine checks your preferences, finds news articles from your favorite categories that you haven't seen yet, and voila! Fresh, personalized content is presented to you. This way, your news feed stays fresh and interesting, enhancing your app experience.
    2. You may wonder if fetching news based on previous preferences might slow down the process? Not to worry! I've designed it so that news is delivered in batches of 10 cards. So, by the time you're enjoying the 8th card, the next batch of 10 is already being prepared for you. This ensures the news feed remains smooth and speedy!
  4. Database (MongoDB): Stores all data necessary for the app's operation, including user profiles, preferences, and summarized news articles. Just 3 collections for now.

  5. Fetcher and Summarizer: This is the cool bit where I rolled up my sleeves and really dug in. It's got two main parts:

    1. Fetcher - So, the fetcher goes and scoops up the top headlines by category from NewsAPI.org. But here's the catch, they don't give out the whole content for free. So, I came up with this nifty scraper that can grab all the content from any news site. The secret sauce to how I did it? Well, that's a trade secret, mate!
    2. Summarizer - Next, the fetcher's loot is handed over to our buddy, the BART model. But before that, I break it down into bite-size pieces (tokenizing, truncating), and send it over in smaller chunks so as not to upset the model's token limit.

    And guess what? This whole shebang is packed into a Docker container and living it up on GCP. (But man, the size of that Docker image! I really need to get my head around MLOPs.)

hdd.png

Challenges and Solutions

Developing "NewsBites" presented several challenges, each requiring thoughtful solutions:

  1. News Fetching (Biggest Hurdle): Accessing news articles was a significant challenge, as many U.S. sources are behind paywalls and public APIs are costly. I developed a unique, cost-effective method that combines public APIs with dynamic data scraping techniques to pull content from various news portals. The specifics of this method are confidential to maintain the uniqueness of our approach and respect copyright constraints, ensuring "NewsBites" offers diverse and timely news without excessive costs.
  2. Real-Time Data Handling: Managing the flow of real-time news data was challenging, particularly ensuring the content was frequently and reliably updated. By implementing scheduled cron jobs within FastAPI, news data is fetched and updated at regular intervals, keeping the content fresh and relevant.
  3. Scalable Summarization: Initially, handling the volume of news content for summarization was daunting. The solution involved optimizing the BART model's implementation to handle bulk requests efficiently, using queue systems to manage load and maintain performance during peak usage times.

What Makes NewsBites Special

Innovative Features

  1. Swipeable News Feed: A TikTok-like swipeable interface makes news consumption more interactive and engaging.
  2. Passwordless Authentication: Simplifies the login process while enhancing security.
  3. Personalized Recommendations: Uses user behavior to tailor the news feed, ensuring content relevance and engagement.

Lessons Learned

Creating "NewsBites" was an enlightening and challenging journey. It gave me a wealth of knowledge and new skills that shaped the final product. Here are some key lessons I learned:

  1. Large Language Model Implementation: Working with the BART large language model taught me critical aspects of deploying AI for text summarization. I learned how to run these models locally for testing, host them efficiently on cloud platforms, and manage intricacies such as data chunking and tokenizing to handle large inputs and optimize performance.
  2. State Management Mastery (BLoC Pattern): Understanding the mechanics of state management helped me improve the app's performance and user experience. This knowledge was key in maintaining the app's responsiveness and ensuring smooth, intuitive user interactions.
  3. Authentication Trials: I explored various authentication methods as a crucial part of the development process. After experimenting with platforms like Firebase, Kinde, and crafting custom JWT solutions, I chose Supabase for its simplicity and effectiveness. It ensures a secure and user-friendly login experience.
  4. Advanced Content Scraping: To overcome the challenges of fetching news content, I refined dynamic scraping techniques. These techniques enable me to pull diverse and timely articles from multiple sources. This approach not only solved the problem of accessing gated content but also enriched our news feed without incurring high costs.
  5. MLOps on GCP: Implementing MLOps practices on the Google Cloud Platform allowed me to streamline the deployment and maintenance of machine learning models used for news summarization. This made the process more efficient and scalable.
  6. UI/UX Insights: My exploration into UI/UX design taught me how different design elements can impact user psychology. For example, the swipeable feeds in "NewsBites" cater to the modern user’s short attention span and enhance engagement. This shows how thoughtful design can directly influence app usability and appeal.
  7. Adhering to Platform Styles: Developing "NewsBites" for iOS and Android taught me the importance of adhering to each platform's design guidelines. Ensuring the app conformed to Apple's and Google's standards was essential for a seamless user experience and facilitated smoother approval processes, especially with Apple’s stringent review guidelines.

Future Directions

Going forward, I plan to:

  1. Incorporate Machine Learning: To refine the personalization algorithms.
  2. Expand Language Support: To cater to a global audience.
  3. Integrate Social Sharing Features: To increase user interaction and app visibility.
  4. Bookmarking Feature: This allows users to bookmark and revisit news articles they want to read again.
  5. Explore Monetization Strategies: To sustain and expand the app's operations.

Creating "NewsBites" significantly impacted my journey in mobile app development, aiming to enhance daily news interactions. I look forward to its evolution and continued impact.

Join me in refining "NewsBites" further by signing up for our testing phase. Your feedback will help improve and expand the app. Become a tester and access the latest features early.

💡 I am eager to connect with fellow tech enthusiasts, potential collaborators, and anyone interested in digital innovation. If you want to discuss, share insights, or explore potential collaborations, please connect with me on LinkedIn.