Skip to content

TechBuzz is a Flutter news app with a Node.js & MongoDB backend. It features a web admin dashboard, AI news scraper, and options to bookmark & share articles. ๐Ÿš€ Built with BLoC architecture for state management. Tech Stack: Flutter, Node.js, MongoDB, Web Scraping.

Notifications You must be signed in to change notification settings

codewithkd77/technews-flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TechNews Flutter App

TechNews is a modern Flutter application built with Clean Architecture and BLoC pattern that delivers the latest technology news. The app features a robust architecture with proper separation of concerns, comprehensive error handling, and enterprise-grade code organization.

Alt text

๐Ÿ—๏ธ Architecture

This project follows Clean Architecture principles with the BLoC (Business Logic Component) pattern for state management, ensuring:

  • Separation of Concerns: Clear boundaries between data, business logic, and presentation layers
  • Testability: Interface-based design enables comprehensive unit and integration testing
  • Maintainability: Modular structure makes the codebase easy to understand and modify
  • Scalability: Architecture supports feature growth and team expansion
  • Error Handling: Robust exception handling with custom error types

๐Ÿ“ Project Structure

lib/
โ”œโ”€โ”€ main.dart                           # Application entry point with DI setup
โ”œโ”€โ”€ core/                              # ๐Ÿ”ง Core functionality layer
โ”‚   โ”œโ”€โ”€ constants/                     # Application constants
โ”‚   โ”‚   โ”œโ”€โ”€ api_constants.dart         # API endpoints and configuration
โ”‚   โ”‚   โ””โ”€โ”€ app_constants.dart         # App-wide settings and constants
โ”‚   โ”œโ”€โ”€ errors/                        # Custom error handling
โ”‚   โ”‚   โ””โ”€โ”€ exceptions.dart            # Custom exception hierarchy
โ”‚   โ””โ”€โ”€ utils/                         # Utility functions
โ”‚       โ”œโ”€โ”€ date_utils.dart            # Date formatting and manipulation
โ”‚       โ””โ”€โ”€ network_utils.dart         # Network connectivity utilities
โ”œโ”€โ”€ data/                              # ๐Ÿ“Š Data layer
โ”‚   โ”œโ”€โ”€ datasources/                   # Data source abstractions
โ”‚   โ”‚   โ”œโ”€โ”€ news_data_source.dart      # Data source interfaces
โ”‚   โ”‚   โ”œโ”€โ”€ news_remote_data_source.dart # API implementation
โ”‚   โ”‚   โ””โ”€โ”€ news_local_data_source.dart  # Local storage implementation
โ”‚   โ””โ”€โ”€ repositories/                  # Repository implementations
โ”‚       โ””โ”€โ”€ news_repository_impl.dart  # News repository with DI
โ”œโ”€โ”€ models/                            # ๐Ÿ“‹ Data models
โ”‚   โ””โ”€โ”€ news_article.dart             # News article model
โ”œโ”€โ”€ bloc/                              # ๐Ÿง  Business logic layer (BLoC)
โ”‚   โ”œโ”€โ”€ navigation/                    # Navigation state management
โ”‚   โ”‚   โ”œโ”€โ”€ navigation_bloc.dart
โ”‚   โ”‚   โ”œโ”€โ”€ navigation_event.dart
โ”‚   โ”‚   โ””โ”€โ”€ navigation_state.dart
โ”‚   โ”œโ”€โ”€ news/                          # General tech news BLoC
โ”‚   โ”‚   โ”œโ”€โ”€ news_bloc.dart
โ”‚   โ”‚   โ”œโ”€โ”€ news_event.dart
โ”‚   โ”‚   โ””โ”€โ”€ news_state.dart
โ”‚   โ”œโ”€โ”€ ai_news/                       # AI-specific news BLoC
โ”‚   โ”‚   โ”œโ”€โ”€ ai_news_bloc.dart
โ”‚   โ”‚   โ”œโ”€โ”€ ai_news_event.dart
โ”‚   โ”‚   โ””โ”€โ”€ ai_news_state.dart
โ”‚   โ”œโ”€โ”€ saved_news/                    # Bookmarked news BLoC
โ”‚   โ”‚   โ”œโ”€โ”€ saved_news_bloc.dart
โ”‚   โ”‚   โ”œโ”€โ”€ saved_news_event.dart
โ”‚   โ”‚   โ””โ”€โ”€ saved_news_state.dart
โ”‚   โ””โ”€โ”€ news_detail/                   # Article detail BLoC
โ”‚       โ”œโ”€โ”€ news_detail_bloc.dart
โ”‚       โ”œโ”€โ”€ news_detail_event.dart
โ”‚       โ””โ”€โ”€ news_detail_state.dart
โ””โ”€โ”€ screens/                           # ๐ŸŽจ Presentation layer
    โ”œโ”€โ”€ news_screen.dart               # Main news feed screen
    โ”œโ”€โ”€ ai_news_screen.dart            # AI news screen
    โ”œโ”€โ”€ saved_news_screen.dart         # Bookmarked articles screen
    โ””โ”€โ”€ news_detail_screen.dart        # Article detail screen

๐Ÿš€ Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

๐Ÿ› ๏ธ Technology Stack

  • Flutter: Cross-platform mobile development framework
  • Dart: Programming language
  • BLoC Pattern: State management and business logic
  • Clean Architecture: Architectural design pattern
  • HTTP: API communication
  • SharedPreferences: Local data persistence
  • Equatable: Value equality and immutability

Prerequisites

Ensure you have the following installed on your machine:

Installation

  1. Clone the repository:

    git clone https://github.com/codewithkd77/technews-flutter.git
    cd technews-flutter
  2. Install dependencies:

    flutter pub get
  3. Configure API:

    • Open the lib/core/constants/api_constants.dart file.
    • Replace the placeholder API URL and API key with your own:
    class ApiConstants {
      static const String baseUrl = 'YOUR_API_BASE_URL';
      static const String aiNewsApiUrl = 'YOUR_AI_NEWS_API_URL';
      static const String aiApiKey = 'YOUR_AI_API_KEY';
    }
  4. Run the project:

    • Android:
      • Ensure you have an Android emulator running or a physical device connected.
      flutter run
    • iOS:
      • Ensure you have an iOS simulator running or a physical device connected.
      flutter run

๐Ÿ“ฆ Building for Production

Building the APK (Android)

To build the APK file for Android:

flutter build apk --release

The APK file will be generated in the build/app/outputs/flutter-apk/ directory.

Building the iOS App

To build the iOS app:

flutter build ios --release

Note: You need a macOS machine with Xcode installed to build the iOS app.

๐Ÿ›๏ธ Architecture Overview

Clean Architecture Layers

  1. Core Layer (lib/core/)

    • Constants: API endpoints, app configuration
    • Errors: Custom exception hierarchy for robust error handling
    • Utils: Shared utility functions and helpers
  2. Data Layer (lib/data/)

    • Data Sources: Abstract interfaces and concrete implementations
      • NewsRemoteDataSource: API communication
      • NewsLocalDataSource: Local storage operations
    • Repositories: Implementation of repository interfaces with dependency injection
  3. Domain Layer (Implicit)

    • Models: Data entities and business objects
    • Repository Interfaces: Abstract contracts for data operations
  4. Presentation Layer (lib/bloc/ + lib/screens/)

    • BLoC: Business logic and state management
    • Screens: UI components and user interactions

Key Architectural Benefits

  • ๐Ÿ”„ Dependency Inversion: High-level modules don't depend on low-level modules
  • ๐Ÿงช Testability: Each layer can be tested independently
  • ๐Ÿ”ง Maintainability: Clear separation of concerns
  • ๐Ÿ“ˆ Scalability: Easy to add new features and modify existing ones
  • ๐Ÿ”’ Error Handling: Comprehensive exception handling at each layer

๐Ÿ“ฑ Screens Overview

๐Ÿ  News Screen (news_screen.dart)

  • Main tech news feed
  • Pull-to-refresh functionality
  • Navigation to article details
  • Search functionality

๐Ÿค– AI News Screen (ai_news_screen.dart)

  • Dedicated AI and machine learning news
  • Similar functionality to main news feed
  • AI-specific content filtering

๐Ÿ”– Saved News Screen (saved_news_screen.dart)

  • Bookmarked articles management
  • Local storage integration
  • Remove from bookmarks functionality

๐Ÿ“– News Detail Screen (news_detail_screen.dart)

  • Full article content display
  • Bookmark/unbookmark functionality
  • Share article feature
  • Related articles suggestions

๐Ÿ”ง Configuration

API Configuration

Update lib/core/constants/api_constants.dart:

class ApiConstants {
  static const String baseUrl = 'https://your-api-url.com';
  static const String newsEndpoint = '/api/news';
  static const String aiNewsApiUrl = 'https://your-ai-api-url.com';
}

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Follow the architecture: Maintain Clean Architecture principles
  4. Write tests: Include unit tests for new features
  5. Follow code style: Use consistent formatting and naming
  6. Commit changes: git commit -m 'Add amazing feature'
  7. Push to branch: git push origin feature/amazing-feature
  8. Open a Pull Request

Code Style Guidelines

  • Follow Dart Style Guide
  • Use meaningful variable and function names
  • Add comprehensive documentation
  • Maintain consistent file structure
  • Include proper error handling

๐Ÿ”ฎ Future Enhancements

  • Dark mode support
  • Push notifications for breaking news
  • Offline reading mode
  • Social sharing integration
  • News categories and filtering
  • User preferences and customization
  • Analytics integration

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘จโ€๐Ÿ’ป Author

KULDEEPSINH - codewithkd77

๐Ÿ™ Acknowledgments

  • Flutter team for the amazing framework
  • BLoC pattern developers for state management solution
  • Clean Architecture principles by Robert C. Martin
  • Open source community for continuous inspiration

Built with โค๏ธ using Flutter and Clean Architecture

(back to top)

About

TechBuzz is a Flutter news app with a Node.js & MongoDB backend. It features a web admin dashboard, AI news scraper, and options to bookmark & share articles. ๐Ÿš€ Built with BLoC architecture for state management. Tech Stack: Flutter, Node.js, MongoDB, Web Scraping.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages