# gergesfaiz/movies architecture

> Architecture diagram of the GitHub repository gergesfaiz/movies, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gergesfaiz/movies
- Repository: https://github.com/gergesfaiz/movies

## Overview

Movies is a Flutter app for movie discovery and personal viewing lists. The principal workflow moves from onboarding and optional authentication into browse/search, then movie details; opened movies enter history and users can manage a watch list and profile. The README documents the Clean Architecture boundaries and Firebase/Dio roles, but sampled source excerpts contain no Dart implementation, so detailed call ownership is not independently verified; the graph uses documented relationships only.

Main entry points: [`lib/features/movies/presentation/bloc/movie_details_bloc.dart`](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/bloc/movie_details_bloc.dart) (Movie details), [`lib/features/movies/data/repositories/movies_repository_impl.dart`](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/data/repositories/movies_repository_impl.dart) (Movie repositories), [`lib/features/movies/presentation/pages/home_screen.dart`](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/pages/home_screen.dart) (App navigation), [`lib/features/auth/presentation/cubit/auth_cubit.dart`](https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/presentation/cubit/auth_cubit.dart) (Authentication state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_onboarding["Onboarding"]
  node_app_shell["App navigation<br/>[home_screen.dart]"]
  node_localization["Localization"]
end

subgraph group_identity["Identity and profile"]
  node_language_state["Language state"]
  node_auth_pages["Sign-in pages<br/>[login_page.dart]"]
  node_auth_state["Authentication state<br/>[auth_cubit.dart]"]
  node_auth_repository["Auth repository"]
  node_auth_source["Firebase auth source"]
  node_profile["Profile management<br/>[profile_cubit.dart]"]
end

subgraph group_discovery["Movie discovery"]
  node_browse["Browse and home<br/>[browse_tab.dart]"]
  node_search["Movie search<br/>[search_bloc.dart]"]
  node_movie_state["Movie state<br/>[movies_bloc.dart]"]
  node_details["Movie details"]
  node_personal_movies["Watch list and history"]
end

subgraph group_services["Data and services"]
  node_movie_repository["Movie repositories"]
  node_user_movie_repository["Personal movie repository"]
  node_movie_api_source["Movie API source"]
  node_user_movie_source["Firestore movie source"]
  node_preferences[("App preferences")]
end

node_viewer(("Viewer"))
node_movie_api{{"Movie API"}}
node_firebase_auth{{"Firebase Auth"}}
node_firestore[("Cloud Firestore")]
node_trailer{{"YouTube trailer"}}

node_viewer -->|"starts app"| node_onboarding
node_viewer -->|"signs in"| node_auth_pages
node_viewer -->|"discovers movies"| node_browse
node_onboarding -.->|"continues to"| node_app_shell
node_auth_pages -->|"uses"| node_auth_state
node_auth_state -->|"uses cases"| node_auth_repository
node_auth_repository -->|"delegates to"| node_auth_source
node_auth_source -->|"authenticates with"| node_firebase_auth
node_viewer -->|"manages account"| node_profile
node_profile -.->|"uses auth"| node_auth_state
node_app_shell -.->|"shows tabs"| node_browse
node_browse -.->|"browses"| node_movie_state
node_viewer -->|"searches"| node_search
node_viewer -->|"opens movie"| node_details
node_search -->|"uses cases"| node_movie_repository
node_movie_state -->|"uses cases"| node_movie_repository
node_details -->|"loads details"| node_movie_repository
node_movie_repository -->|"delegates to"| node_movie_api_source
node_movie_api_source -->|"requests data"| node_movie_api
node_details -->|"updates history"| node_personal_movies
node_viewer -->|"manages list"| node_personal_movies
node_personal_movies -->|"uses cases"| node_user_movie_repository
node_user_movie_repository -->|"delegates to"| node_user_movie_source
node_user_movie_source -->|"reads and writes"| node_firestore
node_details -->|"opens trailer"| node_trailer
node_language_state -->|"remembers language"| node_preferences
node_app_shell -->|"displays translations"| node_localization
node_viewer -->|"chooses language"| node_language_state

click node_onboarding "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/pages/onboarding_page.dart"
click node_app_shell "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/pages/home_screen.dart"
click node_localization "https://github.com/gergesfaiz/movies/blob/master/lib/core/l10n/app_localizations.dart"
click node_language_state "https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/presentation/cubit/app_language_cubit.dart"
click node_auth_pages "https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/presentation/pages/login_page.dart"
click node_auth_state "https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/presentation/cubit/auth_cubit.dart"
click node_auth_repository "https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/data/repositories/auth_repository_impl.dart"
click node_auth_source "https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/data/datasources/auth_remote_datasource.dart"
click node_profile "https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/presentation/cubit/profile_cubit.dart"
click node_browse "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/pages/browse_tab.dart"
click node_search "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/bloc/search_bloc.dart"
click node_movie_state "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/bloc/movies_bloc.dart"
click node_details "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/bloc/movie_details_bloc.dart"
click node_personal_movies "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/bloc/user_movies_cubit.dart"
click node_movie_repository "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/data/repositories/movies_repository_impl.dart"
click node_user_movie_repository "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/data/repositories/user_movies_repository_impl.dart"
click node_movie_api_source "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/data/datasources/movies_remote_datasource.dart"
click node_user_movie_source "https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/data/datasources/user_movies_remote_datasource.dart"
click node_preferences "https://github.com/gergesfaiz/movies/blob/master/lib/core/storage/app_preferences.dart"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_onboarding,node_app_shell,node_localization,node_viewer toneBlue
class node_language_state,node_auth_pages,node_auth_state,node_auth_repository,node_auth_source,node_profile,node_firestore toneAmber
class node_browse,node_search,node_movie_state,node_details,node_personal_movies,node_movie_api toneMint
class node_movie_repository,node_user_movie_repository,node_movie_api_source,node_user_movie_source,node_preferences toneRose
class node_firebase_auth,node_trailer toneIndigo
```

## Components

### App experience

- [Onboarding](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/pages/onboarding_page.dart): `lib/features/movies/presentation/pages/onboarding_page.dart`
- [App navigation](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/pages/home_screen.dart): `lib/features/movies/presentation/pages/home_screen.dart`
- [Localization](https://github.com/gergesfaiz/movies/blob/master/lib/core/l10n/app_localizations.dart): `lib/core/l10n/app_localizations.dart`

### Identity and profile

- [Language state](https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/presentation/cubit/app_language_cubit.dart): `lib/features/auth/presentation/cubit/app_language_cubit.dart`
- [Sign-in pages](https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/presentation/pages/login_page.dart): `lib/features/auth/presentation/pages/login_page.dart`
- [Authentication state](https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/presentation/cubit/auth_cubit.dart): `lib/features/auth/presentation/cubit/auth_cubit.dart`
- [Auth repository](https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/data/repositories/auth_repository_impl.dart): `lib/features/auth/data/repositories/auth_repository_impl.dart`
- [Firebase auth source](https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/data/datasources/auth_remote_datasource.dart): `lib/features/auth/data/datasources/auth_remote_datasource.dart`
- [Profile management](https://github.com/gergesfaiz/movies/blob/master/lib/features/auth/presentation/cubit/profile_cubit.dart): `lib/features/auth/presentation/cubit/profile_cubit.dart`

### Movie discovery

- [Browse and home](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/pages/browse_tab.dart): `lib/features/movies/presentation/pages/browse_tab.dart`
- [Movie search](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/bloc/search_bloc.dart): `lib/features/movies/presentation/bloc/search_bloc.dart`
- [Movie state](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/bloc/movies_bloc.dart): `lib/features/movies/presentation/bloc/movies_bloc.dart`
- [Movie details](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/bloc/movie_details_bloc.dart): `lib/features/movies/presentation/bloc/movie_details_bloc.dart`
- [Watch list and history](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/presentation/bloc/user_movies_cubit.dart): `lib/features/movies/presentation/bloc/user_movies_cubit.dart`

### Data and services

- [Movie repositories](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/data/repositories/movies_repository_impl.dart): `lib/features/movies/data/repositories/movies_repository_impl.dart`
- [Personal movie repository](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/data/repositories/user_movies_repository_impl.dart): `lib/features/movies/data/repositories/user_movies_repository_impl.dart`
- [Movie API source](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/data/datasources/movies_remote_datasource.dart): `lib/features/movies/data/datasources/movies_remote_datasource.dart`
- [Firestore movie source](https://github.com/gergesfaiz/movies/blob/master/lib/features/movies/data/datasources/user_movies_remote_datasource.dart): `lib/features/movies/data/datasources/user_movies_remote_datasource.dart`
- [App preferences](https://github.com/gergesfaiz/movies/blob/master/lib/core/storage/app_preferences.dart): `lib/core/storage/app_preferences.dart`

### Other components

- **Viewer**
- **Movie API**
- **Firebase Auth**
- **Cloud Firestore**
- **YouTube trailer**

## Connections

- Viewer → Onboarding: starts app (evidence: `README.md`)
- Viewer → Sign-in pages: signs in (evidence: `README.md`)
- Viewer → Browse and home: discovers movies (evidence: `README.md`)
- Onboarding → App navigation: continues to
- Sign-in pages → Authentication state: uses (evidence: `README.md`)
- Authentication state → Auth repository: uses cases (evidence: `README.md`)
- Auth repository → Firebase auth source: delegates to (evidence: `README.md`)
- Firebase auth source → Firebase Auth: authenticates with (evidence: `README.md`)
- Viewer → Profile management: manages account (evidence: `README.md`)
- Profile management → Authentication state: uses auth
- App navigation → Browse and home: shows tabs
- Browse and home → Movie state: browses
- Viewer → Movie search: searches (evidence: `README.md`)
- Viewer → Movie details: opens movie (evidence: `README.md`)
- Movie search → Movie repositories: uses cases (evidence: `README.md`)
- Movie state → Movie repositories: uses cases (evidence: `README.md`)
- Movie details → Movie repositories: loads details (evidence: `README.md`)
- Movie repositories → Movie API source: delegates to (evidence: `README.md`)
- Movie API source → Movie API: requests data (evidence: `README.md`)
- Movie details → Watch list and history: updates history (evidence: `README.md`)
- Viewer → Watch list and history: manages list (evidence: `README.md`)
- Watch list and history → Personal movie repository: uses cases (evidence: `README.md`)
- Personal movie repository → Firestore movie source: delegates to (evidence: `README.md`)
- Firestore movie source → Cloud Firestore: reads and writes (evidence: `README.md`)
- Movie details → YouTube trailer: opens trailer (evidence: `README.md`)
- Language state → App preferences: remembers language (evidence: `README.md`)
- App navigation → Localization: displays translations (evidence: `README.md`)
- Viewer → Language state: chooses language (evidence: `README.md`)
