# tarikulker-js/ulker-social-v2 architecture

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

- Interactive diagram: https://gitdiagram.com/tarikulker-js/ulker-social-v2
- Repository: https://github.com/tarikulker-js/ulker-social-v2

## Overview

##### Project type and purpose
- This is a cross-platform Flutter application (“ulkersocialv2”), targeting Android, iOS, Linux, macOS, Windows and Web.
- From the `lib/` folder and file names (screens, components, middleware, storage), it’s clearly a client-side social-style app—handles UI pages (login, feed, profile, chat), local token storage, date conversion, and likely talks to remote APIs for posts, reels, comments, likes, etc.

##### File structure
- Top-level platform folders (`android/`, `ios/`, `linux/`, `macos/`, `windows/`, `web/`) contain Flutter engine embedding and native glue.
- `lib/` subdivides into:
- `components/` – reusable UI widgets.
- `screens/` – full-page layouts (LoginScreen, ExploreScreen, ChatScreen, etc.).
- `middleware/` – pure-Dart utilities/business logic (e.g., ConvertDateToAgo).
- `storage/` – local persistence (SecureStorage).
- `main.dart` – app entry point (sets up routing, DI, theme).
- `pubspec.yaml` defines dependencies; `test/` holds widget tests.

##### README
- It’s the default Flutter starter README, confirming this is a front-end project. No mention of backend code here, so assume “external API(s)” for data.

##### Detail & essential architectural elements
- Don’t omit the main.dart/router component that wires up screens and services.
- Screen category (Home, Explore, Chat, Profile, Reels) as sub-components under the Presentation layer.
- Middleware utilities (e.g., ConvertDateToAgo, CheckToken) as distinct nodes.
- SecureStorage separately from in-memory state.
- Native runners (android/ios/etc.) under a “Platform Embedders” container feeding into the Flutter runtime.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Platform Embedders"
        direction TB
        Android["Android Shell"]:::platform
        iOS["iOS Shell"]:::platform
        Linux["Linux Shell"]:::platform
        macOS["macOS Shell"]:::platform
        Windows["Windows Shell"]:::platform
        Web["Web Shell"]:::platform
    end

    FlutterCore["main.dart (App Entry & Routing)"]:::core

    subgraph "Presentation Layer"
        direction TB
        subgraph "Screens" 
            direction TB
            LoginScreen["LoginScreen"]:::ui
            RegisterScreen["RegisterScreen"]:::ui
            MainScreen["MainScreen"]:::ui
            ExploreScreen["ExploreScreen"]:::ui
            ChatScreen["ChatScreen"]:::ui
            ProfileScreen["ProfileScreen"]:::ui
            ReelsScreen["ReelsScreen"]:::ui
            CreatePostScreen["CreatePostScreen"]:::ui
            CreateReelsScreen["CreateReelsScreen"]:::ui
        end
        subgraph "Components"
            direction TB
            AppBarComp["AppBar"]:::ui
            DrawerComp["Drawer"]:::ui
            CommentModal["CommentModal"]:::ui
            LikesModal["LikesModal"]:::ui
            ToastMessage["ToastMessage"]:::ui
            CheckTokenComp["CheckToken"]:::ui
            subgraph "Explore Components"
                direction TB
                ExploreBody["Explore Body"]:::ui
                ExplorePosts["Explore Posts"]:::ui
            end
            subgraph "Home Components"
                direction TB
                HomeBody["Home Body"]:::ui
                HomePosts["Home Posts"]:::ui
                HomeStories["Home Stories"]:::ui
            end
            ReelsContent["Reels Content"]:::ui
        end
    end

    subgraph "Business Logic Layer"
        direction TB
        ConvertDate["ConvertDateToAgo"]:::logic
    end

    subgraph "Data Layer"
        direction TB
        SecureStorage["SecureStorage"]:::storage
        APIClient["API Client"]:::storage
    end

    ExternalAPI["Remote API Services"]:::external

    %% Relationships
    Android --> FlutterCore
    iOS --> FlutterCore
    Linux --> FlutterCore
    macOS --> FlutterCore
    Windows --> FlutterCore
    Web --> FlutterCore

    FlutterCore --> PresentationLayer
    FlutterCore --> ConvertDate
    FlutterCore --> SecureStorage

    %% UI interactions
    LoginScreen -->|uses| AppBarComp
    LoginScreen -->|invokes| ConvertDate
    LoginScreen -->|reads/writes token| SecureStorage
    LoginScreen -->|calls| APIClient

    RegisterScreen -->|calls| APIClient
    MainScreen -->|navigates| ExploreScreen
    MainScreen -->|navigates| ChatScreen
    MainScreen -->|navigates| ProfileScreen
    MainScreen -->|navigates| ReelsScreen
    MainScreen -->|uses| DrawerComp

    ExploreScreen -->|uses| ExploreBody
    ExploreBody -->|renders| ExplorePosts
    ChatScreen -->|uses| CommentModal
    ChatScreen -->|uses| LikesModal
    ChatScreen -->|uses| ToastMessage

    ProfileScreen -->|uses| CheckTokenComp
    ReelsScreen -->|uses| ReelsContent

    CreatePostScreen -->|calls| APIClient
    CreateReelsScreen -->|calls| APIClient

    %% Business logic
    ConvertDate -->|transforms data| APIClient

    %% Data layer to external
    APIClient -->|HTTP/GraphQL| ExternalAPI
    ExternalAPI -->|responses| APIClient

    %% Storage interactions
    APIClient -->|reads/writes| SecureStorage

    %% Click Events
    click FlutterCore "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/main.dart"
    click LoginScreen "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/screens/LoginScreen.dart"
    click RegisterScreen "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/screens/RegisterScreen.dart"
    click MainScreen "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/screens/MainScreen.dart"
    click ExploreScreen "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/screens/ExploreScreen.dart"
    click ChatScreen "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/screens/ChatScreen.dart"
    click ProfileScreen "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/screens/ProfileScreen.dart"
    click ReelsScreen "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/screens/ReelsScreen.dart"
    click CreatePostScreen "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/screens/CreatePostScreen.dart"
    click CreateReelsScreen "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/screens/CreateReelsScreen.dart"
    click AppBarComp "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/AppBar.dart"
    click DrawerComp "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/Drawer.dart"
    click CommentModal "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/CommentModal.dart"
    click LikesModal "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/LikesModal.dart"
    click ToastMessage "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/ToastMessage.dart"
    click ExploreBody "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/Explore/Body.dart"
    click ExplorePosts "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/Explore/Posts.dart"
    click HomeBody "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/Home/Body.dart"
    click HomePosts "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/Home/Posts.dart"
    click HomeStories "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/Home/Stories.dart"
    click ReelsContent "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/Reels/Content.dart"
    click CheckTokenComp "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/components/CheckToken.dart"
    click ConvertDate "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/middleware/ConvertDateToAgo.dart"
    click SecureStorage "https://github.com/tarikulker-js/ulker-social-v2/blob/main/lib/storage/SecureStorage.dart"

    %% Styles
    classDef platform fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef core fill:#F0E68C,stroke:#333,stroke-width:1px
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef logic fill:#90EE90,stroke:#333,stroke-width:1px
    classDef storage fill:#FFA500,stroke:#333,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px
```
