# ramadanmohamed11/social-media architecture

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

- Interactive diagram: https://gitdiagram.com/ramadanmohamed11/social-media
- Repository: https://github.com/ramadanmohamed11/social-media

## Overview

##### Project type and purpose
- This is a cross-platform Flutter “social_media” client application.
- It targets Android, iOS, Web, Windows, macOS, and Linux via the standard Flutter folders.
- It implements user authentication, profile, search, and “add” features and relies on Firebase (Auth, Firestore, Storage) as its backend.

##### File structure
- Top-level platform folders (android/, ios/, web/, macos/, linux/, windows/) contain boilerplate code.
- lib/ holds the Dart code, organized roughly along Clean Architecture lines:
- core/ – errors, helpers, models, utils, service_locator (dependency injection)
- features/ – separate feature modules (authentication, home, profile, search, add) each with data & presentation subfolders
- Configuration files: pubspec.yaml, firebase.json, Android/iOS project files, flutter CI configs.

##### README for additional insights
- It’s a new Flutter project scaffolded for rapid prototyping.

##### Final checklist
- Callouts for key frameworks (flutter_bloc, firebase_auth, cloud_firestore)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer" 
        direction TB
        A1["LoginView"]:::presentation
        A2["RegisterView"]:::presentation
        A3["AuthenticationCubit"]:::presentation
        A4["HomeView"]:::presentation
        A5["LayoutView"]:::presentation
        A6["HomeViewBody"]:::presentation
        A7["ProfileView"]:::presentation
        A8["ProfileViewBody"]:::presentation
        A9["SearchView"]:::presentation
        A10["SearchViewBody"]:::presentation
        A11["AddView"]:::presentation
        A12["AddViewModel"]:::presentation
    end

    %% Data Layer
    subgraph "Data Layer" 
        direction TB
        D1["AuthRepository"]:::data
        D2["AuthRepositoryImpl"]:::data
    end

    %% Core Layer
    subgraph "Core Layer"
        direction TB
        C1["UserModel"]:::core
        C2["Failures"]:::core
        C3["TextFormFieldValidations"]:::core
        C4["AppRouter"]:::core
        C5["AppColors"]:::core
        C6["AssetsData"]:::core
        C7["AuthenticationService"]:::core
        C8["ServiceLocator"]:::core
        C9["main.dart"]:::core
        C10["firebase_options.dart"]:::core
        C11["constants.dart"]:::core
    end

    %% External Services
    subgraph "External Services"
        direction TB
        E1["Firebase Auth"]:::external
        E2["Cloud Firestore"]:::external
        E3["Firebase Storage"]:::external
    end

    %% Connections Presentation to Core/Data
    A1 -->|"dispatch login()"| A3
    A2 -->|"dispatch register()"| A3
    A3 -->|"calls login/register"| C7
    A7 -->|"UI event"| A3
    A4 -->|"UI event"| A3

    %% Service to Repository to External
    C7 -->|"use AuthRepo"| D1
    D1 -->|"implemented by"| D2
    D2 -->|"firebase_auth call"| E1
    D2 -->|"firestore query"| E2
    D2 -->|"storage upload"| E3

    %% Service Locator wiring
    C9 -->|"init app"| C8
    C8 -->|"provides"| C7
    C8 -->|"provides"| A3
    C8 -->|"provides"| A12

    %% Return data flow
    E1 -->|"auth result"| D2
    E2 -->|"data snapshot"| D2
    D2 -->|"repo response"| C7
    C7 -->|"emits state"| A3
    A3 -->|"update UI"| A1
    A3 -->|"update UI"| A2

    %% Click Events for Component Mapping
    click A3 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/authentication/presentation/view_models/cubit/authentication_cubit.dart"
    click A1 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/authentication/presentation/views/login_view.dart"
    click A2 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/authentication/presentation/views/register_view.dart"
    click A4 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/home/presentation/views/home_view.dart"
    click A5 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/home/presentation/views/layout_view.dart"
    click A6 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/home/presentation/views/widgets/home_view_body.dart"
    click A7 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/profile/presentation/views/profile_view.dart"
    click A8 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/profile/presentation/views/widgets/profile_view_body.dart"
    click A9 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/search/presentation/views/search_view.dart"
    click A10 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/search/presentation/views/widgets/search_view_body.dart"
    click A11 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/add/presentation/views/add_view.dart"
    click A12 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/add/presentation/views/widgets/add_view_model.dart"
    click D1 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/authentication/data/repos/auth_repo.dart"
    click D2 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/features/authentication/data/repos/auth_repo_impl.dart"
    click C1 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/core/models/user_model.dart"
    click C2 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/core/errors/failures.dart"
    click C3 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/core/helper/text_form_filed_validations.dart"
    click C4 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/core/utils/app_router.dart"
    click C5 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/core/utils/app_colors.dart"
    click C6 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/core/utils/assets_data.dart"
    click C7 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/core/utils/authentication_service.dart"
    click C8 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/core/utils/service_locator.dart"
    click C9 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/main.dart"
    click C10 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/firebase_options.dart"
    click C11 "https://github.com/ramadanmohamed11/social-media/blob/main/lib/constants.dart"

    %% Styles
    classDef presentation fill:#D6EFFF,stroke:#5B8FF9,color:#000
    classDef data fill:#D1FFD6,stroke:#28A745,color:#000
    classDef core fill:#C8C8FF,stroke:#6F42C1,color:#000
    classDef external fill:#FFE2B3,stroke:#FD7E14,color:#000
```
