Skip to content

Mohamed-Fadel/Devhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Flutter Version Dart Version Architecture State Management

A comprehensive Flutter architecture showcase demonstrating top development practices, multiple state management patterns, and production-ready features.

This repository demonstrates:

βœ… Architecture Excellence

  • Clean Architecture implementation
  • Multiple design patterns (Repository, Factory, Observer)
  • SOLID principles adherence
  • Separation of concerns

βœ… State Management Mastery

  • BLoC pattern for complex flows (Authentication, Onboarding)
  • Riverpod for modern reactive programming (Dashboard)
  • Provider for traditional state management (Profile)

βœ… Production-Ready Quality

  • Comprehensive error handling and logging
  • Security best practices (secure storage, token management)
  • Performance optimization (lazy loading, caching, memory management)
  • Accessibility compliance (screen readers, contrast, focus management)

βœ… Modern Flutter Practices

  • Material Design 3 implementation
  • Responsive design for all platforms
  • Dark/light theme support
  • Internationalization ready

🎬 Video Demo

Watch the video

▢️ Watch Full Demo Video (1 minute)

See the app in action: Onboarding flow β€’ Authentication flow β€’ Dashboard features β€’ Profile management β€’ Real-time updates β€’ Responsive design


🎯 Project Overview

DevHub is a developer portfolio and social platform built to demonstrate advanced Flutter architecture patterns and best practices. This project serves as a comprehensive showcase of modern Flutter development, featuring multiple state management solutions, clean architecture, and production-ready features.

What Makes This Project Special

  • Modular Feature-Based Structure - Each feature is self-contained and independently maintainable
  • Multiple Architecture Patterns - Clean Architecture, MVVM, Repository Pattern
  • Multiple State Management - BLoC, Riverpod, Provider (comparative implementation)
  • Dependency Injection - Using GetIt and Injectable for proper dependency management
  • Advanced Routing - Modular routing system with AutoRoute
  • Production-Ready Features - Authentication, offline support, performance optimization
  • Real-World Complexity - Complex UI, data visualization, real-time features

App Features

Onboarding Module (BLoC Pattern)

  • Interactive onboarding flow with animations
  • Page indicators and navigation controls
  • Skip functionality for returning users
  • Animated backgrounds and smooth transitions
  • Completion tracking with local storage
  • Seamless navigation to authentication

Authentication Module (BLoC Pattern)

  • Email/Password authentication
  • Social login (Google, GitHub) (in-progress)
  • Biometric authentication (in-progress)
  • Password reset functionality (in-progress)
  • JWT token management with auto-refresh (in-progress)

Dashboard Module (Riverpod Pattern)

  • Real-time developer statistics
  • Activity feed with infinite scroll
  • Performance metrics visualization
  • Offline-first architecture with sync

Profile Module (Provider Pattern)

  • Profile management and editing
  • Skills and achievements system
  • GitHub integration for stats
  • Image upload and caching (in-progress)

πŸ—οΈ Architecture

Clean Architecture Implementation

lib/
β”œβ”€β”€ app/                          # Application layer
β”‚   └── pages/                    # App-level pages
β”‚
β”œβ”€β”€ core/                         # Core functionality
β”‚   β”œβ”€β”€ constants/                # App constants
β”‚   β”œβ”€β”€ data/                     # Core data layer
β”‚   β”œβ”€β”€ domain/                   # Core domain layer
β”‚   β”œβ”€β”€ network/                  # Network configuration
β”‚   β”œβ”€β”€ routing/                  # Routing infrastructure
β”‚   β”œβ”€β”€ services/                 # Core services (interfaces)
β”‚   β”œβ”€β”€ theme/                    # App theming
β”‚   └── utils/                    # Utilities
β”‚
β”œβ”€β”€ features/                     # Feature modules
β”‚   β”œβ”€β”€ onboarding/               # Onboarding feature
β”‚   β”‚   β”œβ”€β”€ domain/               # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ entities/         # Business objects
β”‚   β”‚   β”‚   β”œβ”€β”€ repositories/     # Repository interfaces
β”‚   β”‚   β”‚   └── usecases/         # Business rules
β”‚   β”‚   β”œβ”€β”€ data/                 # Data layer
β”‚   β”‚   β”‚   β”œβ”€β”€ datasources/      # Remote/Local sources
β”‚   β”‚   β”‚   β”œβ”€β”€ models/           # Data models
β”‚   β”‚   β”‚   └── repositories/     # Repository implementations
β”‚   β”‚   β”œβ”€β”€ presentation/         # UI layer
β”‚   β”‚   β”‚   β”œβ”€β”€ bloc/             # State management
β”‚   β”‚   β”‚   β”œβ”€β”€ pages/            # Screen widgets
β”‚   β”‚   β”‚   β”œβ”€β”€ widgets/          # Reusable widgets
β”‚   β”‚   β”‚   └── routing/          # Feature routing
β”‚   β”‚   β”œβ”€β”€ routing/              # routing configuration
β”‚   β”‚   └── services/             # Feature-specific services implementations
β”‚   β”‚
β”‚   β”œβ”€β”€ auth/                     # Auth feature (similar structure)
β”‚   β”œβ”€β”€ dashboard/                # Dashboard feature
β”‚   └── profile/                  # Profile feature
β”‚
β”œβ”€β”€ infrastructure/               # Infrastructure layer
β”‚   β”œβ”€β”€ network/                  # Network clients and interceptors
β”‚   └── services/                 # Third-party service implementations
β”‚
└── shared/                       # Shared code between features
    β”œβ”€β”€ domain/                   # Shared domain logic
    └── presentation/             # Shared UI components

πŸ”„ Data Flow Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Presentation  β”‚ (UI + State Management)
β”‚  BLoC/Riverpod  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ Stream/State
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Domain      β”‚ (Use Cases + Entities)
β”‚  Business Logic β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ Repository Interface
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Data       β”‚ (Repository Implementation)
β”‚  Local/Remote   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🧩 Modular Routing System

Each feature module manages its own routes:

// Feature-level router
class OnboardingRouter implements BaseRouter {
  @override
  String get baseRoute => '/onboarding';
  
  @override
  List<AutoRoute> get routes => [
    AutoRoute(page: OnboardingRoute.page, path: baseRoute),
  ];
}

// Centralized route registration
class AppRouter extends $AppRouter {
  @override
  List<AutoRoute> routes => [
    ...onboardingRouter.routes,
    ...authRouter.routes,
    ...dashboardRouter.routes,
  ];
}

State Management Comparison

Feature BLoC Riverpod Provider
Authentication βœ… Primary
Dashboard βœ… Primary
Profile βœ… Primary

Dependency Injection

Using GetIt with Injectable for compile-time dependency injection:

@injectable
class AuthBloc extends Bloc<AuthEvent, AuthState> {
  final SignInUseCase _signInUseCase;
  final AuthRepository _authRepository;
  
  AuthBloc(this._signInUseCase, this._authRepository);
}

Technical Stack

Core Technologies

  • Flutter 3.16+ - Latest stable version
  • Dart 3.7+ - Null safety, records, patterns
  • Material Design 3 - Modern UI components

State Management

  • flutter_bloc ^8.1.3 - BLoC pattern implementation
  • flutter_riverpod ^2.4.9 - Modern state management
  • provider ^6.1.1 - Traditional Flutter state management

Networking & Serialization

  • dio ^5.4.0 - HTTP client with interceptors
  • retrofit ^4.0.3 - Type-safe API calls
  • json_annotation ^4.8.1 - JSON serialization
  • freezed ^2.4.6 - Immutable data classes

Local Storage

  • hive ^2.2.3 - NoSQL local database
  • drift ^2.14.1 - SQLite with type safety
  • flutter_secure_storage ^9.0.0 - Secure storage

UI & Animations

  • lottie ^2.7.0 - Lottie animations
  • rive ^0.12.4 - Interactive animations
  • shimmer ^3.0.0 - Shimmer loading effects
  • fl_chart ^0.66.0 - Beautiful charts

Development & Quality

  • very_good_analysis ^5.1.0 - Strict linting rules
  • injectable ^2.3.2 - Dependency injection
  • auto_route ^7.9.2 - Code generation routing

πŸš€ Getting Started

Prerequisites

  • Flutter SDK (3.16.0 or higher)
  • Dart SDK (3.7.0 or higher)
  • Android Studio / VS Code
  • Git

Installation

  1. Clone the repository
git clone https://github.com/yourusername/devhub-flutter.git
cd devhub-flutter
  1. Install dependencies
flutter pub get
  1. Generate code
flutter packages pub run build_runner build --delete-conflicting-outputs
  1. Run the app
flutter run

Environment Setup

Create a .env file in the root directory:

API_BASE_URL=https://api.devhub.com
API_KEY=your_api_key_here
GOOGLE_CLIENT_ID=your_google_client_id
GITHUB_CLIENT_ID=your_github_client_id

Testing Strategy

Testing Pyramid

πŸ”Ί Integration Tests (E2E user flows)
πŸ”ΊπŸ”Ί Widget Tests (UI components)  
πŸ”ΊπŸ”ΊπŸ”Ί Unit Tests (Business logic)

Running Tests

# Run all tests
flutter test

# Run tests with coverage
flutter test --coverage

# Run integration tests
flutter test integration_test/

Performance Optimization

Key Optimizations Implemented

  1. Lazy Loading - Widgets and data loaded on demand
  2. Image Caching - Efficient network image caching
  3. Memory Management - Proper disposal of controllers and streams
  4. Database Optimization - Indexed queries and pagination

Design System

Design Principles

  • Consistency - Unified design language across all screens
  • Accessibility - WCAG 2.1 AA compliant
  • Spacing System: 8pt grid system
  • Component Library: Reusable UI components
  • Responsiveness - Adaptive design for all screen sizes
  • Performance - Optimized animations and interactions

Key Components

// Custom Design System Implementation
class AppTheme {
  static ThemeData get lightTheme => // Modern Material 3 theme
  static ThemeData get darkTheme => // Dark mode support
}

class AppColors {
  static const primary = Color(0xFF6366F1);    // Indigo
  static const secondary = Color(0xFF10B981);  // Emerald
  static const accent = Color(0xFFF59E0B);     // Amber
}

Code Quality

Code Generation

Extensive use of code generation for:

  • Freezed - Immutable data classes
  • Injectable - Dependency injection
  • Auto Route - Type-safe routing
  • JSON Serializable - Model serialization

What This Demonstrates

For Flutter Expertise

  1. Advanced Architecture - Multiple proven patterns in production
  2. State Management Mastery - Comparative implementation of major solutions
  3. Performance Optimization - Real-world optimization techniques
  4. Code Quality - Production-ready code standards

Continuous Improvement

Planned Enhancements

  • Testing Suite - Comprehensive unit and integration tests
  • Offline-First Architecture - Complete offline functionality
  • Micro-Frontend Architecture - Modular feature development
  • Advanced Analytics - Machine learning insights
  • Accessibility Improvements - Enhanced screen reader support
  • Performance Monitoring - Real-time performance tracking

Current Status

  • βœ… Authentication System - Complete with social login
  • βœ… Core Architecture - Clean Architecture implemented
  • βœ… State Management - Multiple patterns demonstrated
  • βœ… UI/UX Design - Modern, responsive design system
  • ⏳ Testing Suite - Creating comprehensive testing suite In progress
  • ⏳ Real-time Features - WebSocket integration in progress
  • ⏳ Advanced Analytics - Charts and visualization in progress

About

Flutter Clean Architecture showcase with BLoC/Riverpod/Provider patterns. Production-ready developer portfolio app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors