How riadhaidar/animeapp works
Project Type & Purpose
• It’s a cross-platform mobile/desktop/web Flutter application scaffolded with a Clean Architecture.
• The README indicates it’s a starter app; the code under lib/features/shows and lib/features/subscription implements two feature modules (“Shows” and “Subscription”) using layered architecture.
File Structure Analysis
• Top-level platform folders (android, ios, linux, macos, windows, web) contain the platform integration and Flutter engine hooks.
• The lib directory is organized by layers:
• core/—dependency injection, theming, error handling, shared widgets
• features/—each feature subdivided into data, domain, presentation
• main.dart bootstraps the app and invokes core/di dependency setup.
Key Architectural Patterns
• Clean Architecture (Presentation → Domain → Data)
• Dependency Inversion via a DI container (likely GetIt in core/di)
• Feature-based modularization
• MVC/MVVM isn’t explicit; presentation widgets call domain use-cases directly.
Main Components & Interactions
a. Platform Runners
• AndroidRunner, iOSRunner, etc. host the Flutter engine.
b. Flutter Core
• Flutter Engine / Dart VM
• main.dart
c. Core Module
• DependencyInjection: registers UseCases, Repositories, DataSources
• Theming & Shared Widgets
• Error handling
d. Presentation Layer (per feature)
• Screens (e.g. ShowsListScreen, ShowDetailsScreen, SubscriptionsScreen)
• Widgets (ActionButton, CategoryChip, PlanCard…)
• Depends on Domain layer via injected UseCases
e. Domain Layer
• Entities (CharacterEntity, ShowResponseEntity)
• Repository interfaces (ShowsRepository)
• UseCases (GetShowsUseCase)
f. Data Layer
• Repository implementations (ShowsRepositoryImplementation)
• DataSources (MockDataSource; could be replaced by NetworkDataSource)
• Models (character.dart, shows_response_model.dart)
g. External Services
• Currently a mock data source; swap-in external HTTP / local DB in the Data layer.
• Outermost: Platform Runners & Flutter Engine
• Core Module (DI container)
• Presentation Layer
• Domain Layer
• Data Layer
• External Services / Data Sources
• main.dart → Core/DI (initialization)
• Presentation → Domain (UseCase invocation)
• Domain → Data (Repository interface calls)
• Data → DataSource / External API (data fetch)
• DI container → provides dependencies at each boundary
• Core (blue)
• Presentation (green)
• Domain (orange)
• Data (purple)
5. Callouts for:
• core/di/dependency_injection.dart (DI registration)
• main.dart (application entry point)
• key use-case GetShowsUseCase
• mock_data_source (placeholder for real API)