Skip to content

A robust, cross-platform Flutter application designed to browse, search, and analyze StackOverflow users with comprehensive offline support. This project demonstrates modern mobile development practices, including Clean Architecture, offline-first design, and real-time network handling.

Notifications You must be signed in to change notification settings

xSuperMu/StackOverflow-User-List

Repository files navigation

StackOverflow User List

A robust, cross-platform Flutter application designed to browse, search, and analyze StackOverflow users with comprehensive offline support. This project demonstrates modern mobile development practices, including Clean Architecture, offline-first design, and real-time network handling.

Platform Support

This application is built to run seamlessly on all major platforms:

Platform Support
Android
iOS
Web
MacOS
Windows
Linux

Key Features

User Discovery & Search

  • Top User Listing: Fetches users sorted by reputation (descending) from the StackOverflow API
  • Smart Search: Intelligent search that detects input type:
    • Numeric Input: Direct search by User ID
    • String Input: Search by username
  • Pagination: Supports infinite scrolling to load large lists of users efficiently (30 users per page)
  • Rate Limiting: Automatic backoff handling to respect API limits

Reputation Analytics

  • Reputation History: Comprehensive view of user reputation changes over time
  • Interactive Charts: Beautiful visualizations using fl_chart for reputation growth analysis
  • Cumulative Tracking: Real-time calculation of cumulative reputation points
  • Historical Data: Access up to 100 reputation change events per user

Offline First & Caching

  • Offline Mode: Browse previously visited profiles and user lists without internet connection
  • Local Persistence: Uses Hive (NoSQL database) to cache:
    • User Profiles
    • Reputation History
    • Complete User Lists
  • Smart Network Handling: Automatic switching between Remote (API) and Local (Hive) data sources based on connectivity
  • Connection Monitoring: Real-time network status detection using internet_connection_checker

User Preferences

  • Bookmarking System: Save and manage favorite users locally
  • Featured Profile: Dedicated section showcasing Muhammad's StackOverflow profile
  • Cache Management: Ability to flush and refresh cached data

User Experience

  • Custom Fonts: Professional typography with Roboto and Gilroy font families
  • SVG Support: Crisp vector graphics rendering
  • Cached Images: Optimized image loading with caching
  • URL Launcher: Direct links to StackOverflow profiles
  • Custom Splash Screen: Branded app launch experience

Tech Stack & Architecture

This project follows Clean Architecture principles with clear separation of concerns, ensuring scalability, testability, and maintainability.

Architecture Layers

┌─────────────────────────────────────────┐
│         Presentation Layer              │
│    (UI, Providers, Services)            │
├─────────────────────────────────────────┤
│         Domain Layer                    │
│    (Repositories, Business Logic)       │
├─────────────────────────────────────────┤
│         Data Layer                      │
│  (Remote DS, Local DS, Models)          │
└─────────────────────────────────────────┘

Core Technologies

  • Language: Dart ^3.10.1
  • Framework: Flutter ^3.38.3
  • State Management: Provider
  • Dependency Injection: GetIt (Service Locator pattern)
  • Functional Programming: Dartz (Either/Failure handling)

Key Libraries

Category Library Purpose
Networking dio ^5.9.0 HTTP client for API requests
pretty_dio_logger ^1.4.0 Request/response logging
Local Storage hive ^2.2.3 High-performance NoSQL database
hive_flutter ^1.1.0 Flutter-specific Hive integration
shared_preferences ^2.5.4 Key-value storage
Navigation go_router ^17.0.0 Declarative routing
Network Monitoring internet_connection_checker ^3.0.1 Real-time connectivity status
UI Components fl_chart ^1.1.1 Advanced chart visualization
flutter_svg ^2.2.3 SVG rendering
cached_network_image ^3.4.1 Optimized image loading
Utilities intl ^0.20.2 Internationalization and formatting
logger ^2.6.2 Structured logging
url_launcher ^6.3.2 External URL handling

Testing

This project includes a full testing suite to ensure code quality, reliability, and UI correctness across all layers.

Unit Tests

Unit tests validate business logic inside the Data and Domain layers. These tests cover:

  • API request handling with mocked responses
  • Remote Data Source behavior
  • User and reputation model parsing
  • Reputation history cumulative calculation
  • Search input logic (numeric vs text)
  • Repository error handling using Either

Tools used:

  • flutter_test
  • mockito with generated mocks
  • dartz for functional validation

Widget Tests

Widget tests ensure the UI behaves correctly under various states and interactions. These tests include:

  • Rendering empty states
  • Rendering user lists
  • Bookmark toggling and filtered views
  • Floating action button visibility
  • Network connectivity-driven UI updates
  • GoRouter navigation tests

Tools used:

  • flutter_test
  • mockito
  • provider with mock providers
  • go_router test utilities

Core Functionality

Data Flow

  1. Network Check: Repository checks internet connectivity
  2. Cache First: If offline, loads data from Hive cache
  3. API Request: If online, fetches fresh data from StackOverflow API
  4. Cache Update: Stores new data locally for offline access
  5. Error Handling: Uses Either monad for functional error management

Featured Capabilities

User Listing

  • Fetches top 30 users per page sorted by reputation
  • Supports pagination for browsing thousands of users
  • Caches entire user list for offline browsing

Search Functionality

  • Smart detection: numeric input searches by ID, text searches by name
  • Returns up to 100 results for name searches
  • Handles API backoff automatically

Reputation Tracking

  • Fetches up to 100 reputation events
  • Calculates cumulative reputation over time
  • Reverses chronological order for proper cumulative calculation
  • Visualizes data with interactive charts

Offline Support

  • All viewed data cached automatically
  • Bookmarks stored locally
  • Profile data persists between sessions
  • Manual cache flush option available

Getting Started

Prerequisites

  • Flutter SDK ^3.38.3
  • Dart SDK ^3.10.1
  • Android Studio / Xcode / VS Code
  • Git

Installation

  1. Clone the repository:
git clone https://github.com/xSuperMu/StackOverflow-User-List.git
cd stackoverflow_user_list
  1. Install dependencies:
flutter pub get
  1. Generate Hive adapters:
flutter pub run build_runner build --delete-conflicting-outputs
  1. Run the app:
# For Android/iOS
flutter run

# For Web
flutter run -d chrome

# For Desktop (Windows/MacOS/Linux)
flutter run -d windows
flutter run -d macos
flutter run -d linux

App Configuration

API Integration

The app uses the StackExchange API v2.2/2.3. Key endpoints:

  • User listing with reputation sorting
  • User search by ID or name
  • Reputation history tracking
  • Badge counts and user profiles

Local Database

Hive boxes configured for:

  • users - General user cache
  • muhammad - Featured profile cache
  • _muhammadReputation - Reputation history cache

About me

Muhammad Elsayed
Senior Flutter Engineer | Full Stack Firebase Engineer


Development Notes

  • Built with Clean Architecture for separation of concerns
  • Uses Provider for efficient state management
  • Implements Repository Pattern for data abstraction
  • Follows SOLID principles throughout the codebase
  • Includes comprehensive error handling with functional programming patterns
  • Optimized for both online and offline scenarios

Version: 0.0.1+1
Last Updated: 2025

About

A robust, cross-platform Flutter application designed to browse, search, and analyze StackOverflow users with comprehensive offline support. This project demonstrates modern mobile development practices, including Clean Architecture, offline-first design, and real-time network handling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published