# vanlong00/movie-flutter-bloc architecture

> Architecture diagram of the GitHub repository vanlong00/movie-flutter-bloc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vanlong00/movie-flutter-bloc
- Repository: https://github.com/vanlong00/movie-flutter-bloc

## Overview

##### Project Type and Purpose
This is a full-stack mobile application built with Flutter that interfaces with The Movie DB API. It's a movie streaming application with features like authentication, movie browsing, payments, and user profiles.

##### Main Architecture Components

a. Client Layer (Flutter App):
- Presentation Layer (Features)
- Core Layer
- Data Layer
- Network Layer

b. External Services:
- The Movie DB API
- Firebase Services
- Payment Gateway

##### Detailed Component Breakdown

Frontend Architecture (Flutter):
**[User Interface Layer]**
- ↓
**[BLoC/Cubit Layer (State Management)]**
- ↓
**[Domain Layer (Use Cases)]**
- ↓
**[Repository Layer]**
- ↓
**[Data Layer (Remote/Local)]**

##### Implementation Details

- BLoC Pattern Implementation
- Repository Pattern
- Clean Architecture Principles
- Feature-First Directory Structure

##### Specific Architectural Patterns

How the application implements:
- Dependency Injection using GetIt
- BLoC/Cubit for State Management
- Repository Pattern for Data Access
- Clean Architecture Separation

##### External Integrations

Clearly mark:
- Movie DB API Integration
- Firebase Services
- Payment Gateway Integration
- Local Storage Solutions

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Flutter Application"]
        UI["User Interface Layer"]
        BLoC["BLoC/Cubit Layer"]
        Domain["Domain Layer"]
        Repo["Repository Layer"]
        Data["Data Layer"]
    end

    subgraph CoreLayer["Core Layer"]
        direction TB
        Common["Common Utilities"]:::core
        Network["Network Layer"]:::core
        CoreData["Data Layer"]:::core
        StateBase["State Management Base"]:::core
    end

    subgraph Features["Feature Modules"]
        direction TB
        Auth["Auth Module"]:::feature
        Movie["Movie Module"]:::feature
        Profile["Profile Module"]:::feature
        Payment["Payment Module"]:::feature
        Download["Download Module"]:::feature
    end

    subgraph DataLayer["Data Layer Components"]
        direction TB
        Remote["Remote Data"]:::data
        Local["Local Storage"]:::data
        Models["Data Models"]:::data
    end

    subgraph Architecture["Architecture Components"]
        direction TB
        DI["Dependency Injection"]:::arch
        NetConfig["Network Configuration"]:::arch
        EnvConfig["Environment Config"]:::arch
        UseCases["Use Cases"]:::arch
    end

    subgraph UIComponents["UI Components"]
        direction TB
        Widgets["Common Widgets"]:::ui
        Resources["Resources"]:::ui
        Trans["Translations"]:::ui
    end

    subgraph Navigation["Navigation"]
        direction TB
        Routes["App Routes"]:::nav
        MainScreen["Main Screen"]:::nav
    end

    subgraph External["External Services"]
        direction TB
        MovieDB["The Movie DB API"]:::external
        Firebase["Firebase Services"]:::external
        PayGateway["Payment Gateway"]:::external
    end

    %% Relationships
    UI --> BLoC
    BLoC --> Domain
    Domain --> Repo
    Repo --> Data
    Data --> Remote
    Data --> Local

    CoreLayer --> Features
    Features --> DataLayer
    Features --> Architecture
    Features --> UIComponents
    Features --> Navigation

    Remote --> External

    %% Click Events
    click Common "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/common/"
    click Network "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/network/"
    click CoreData "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/data/"
    click StateBase "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/bloc/"
    click Auth "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/features/auth/"
    click Movie "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/features/movies/"
    click Profile "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/features/main/screens/profile/"
    click Payment "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/features/payments/"
    click Download "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/features/main/screens/download/"
    click Remote "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/data/data_resource/remote/"
    click Local "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/data/data_resource/local/"
    click Models "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/data/model/"
    click DI "https://github.com/vanlong00/movie-flutter-bloc/blob/master/lib/di/dependency_injection.dart"
    click NetConfig "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/network/"
    click EnvConfig "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/common/environment/"
    click UseCases "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/usecase/"
    click Widgets "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/common/widgets/"
    click Resources "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/common/resource/"
    click Trans "https://github.com/vanlong00/movie-flutter-bloc/tree/master/lib/core/common/translations/"
    click Routes "https://github.com/vanlong00/movie-flutter-bloc/blob/master/lib/core/config/app_routes.dart"
    click MainScreen "https://github.com/vanlong00/movie-flutter-bloc/blob/master/lib/features/main/screens/main_screen.dart"

    %% Styles
    classDef core fill:#e1f5fe,stroke:#01579b
    classDef feature fill:#e8f5e9,stroke:#2e7d32
    classDef data fill:#fff3e0,stroke:#ff6f00
    classDef arch fill:#f3e5f5,stroke:#7b1fa2
    classDef ui fill:#e3f2fd,stroke:#1565c0
    classDef nav fill:#fce4ec,stroke:#c2185b
    classDef external fill:#efebe9,stroke:#3e2723

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Feature Modules"]:::feature
        L3["Data Components"]:::data
        L4["Architecture Components"]:::arch
        L5["UI Components"]:::ui
        L6["Navigation"]:::nav
        L7["External Services"]:::external
    end
```
