# charlie-shub/world_on_client architecture

> Architecture diagram of the GitHub repository charlie-shub/world_on_client, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/charlie-shub/world_on_client
- Repository: https://github.com/charlie-shub/world_on_client

## Overview

##### Main Architectural Components

a) Presentation Layer (Views)
- Main UI components from /lib/views/
- By features (authentication, profile, experience_management, etc.)

b) Application Layer (BLoCs)
- Below the presentation layer
- The BLoC components from /lib/application/
- By feature matching the views

c) Domain Layer
- In the center
- Entities, value objects, and interfaces from /lib/domain/
- Core business logic and validation rules

d) Infrastructure Layer
- At the bottom
- Repositories and data sources from /lib/data/
- External service integrations (Firebase, Google services)

##### Key Relationships to Highlight

- Dependency flow (following Clean Architecture)
- Data flow between layers
- Event/State management patterns
- Repository implementations
- External service interactions

##### Component Groups

Related components into bounded contexts:
- Authentication & User Management
- Experience Management
- Navigation & Maps
- Social Features (comments, sharing)
- Store & Purchases
- Notifications
- Search & Discovery

##### Technical Details

Specific implementations of:
- Firebase integration
- BLoC pattern implementation
- Repository pattern
- Clean Architecture boundaries
- Dependency injection setup
- Testing architecture

##### Cross-Cutting Concerns

Shared components:
- Core utilities
- Validation logic
- Common widgets
- Error handling
- Authentication state

##### External Dependencies

Integration points with:
- Firebase services
- Google services
- Local storage
- Location services
- Payment processing

- Clean Architecture layers
- Feature modularity
- Data flow directions
- State management
- Error handling paths
- Authentication flow
- Domain model relationships

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef bloc fill:#2ecc71,stroke:#27ae60,color:white
    classDef domain fill:#f1c40f,stroke:#f39c12,color:black
    classDef data fill:#e67e22,stroke:#d35400,color:white
    classDef external fill:#e74c3c,stroke:#c0392b,color:white
    classDef core fill:#9b59b6,stroke:#8e44ad,color:white

    %% Presentation Layer
    subgraph Presentation
        AuthViews["Authentication Views"]:::ui
        ProfileViews["Profile Views"]:::ui
        ExpViews["Experience Views"]:::ui
        NavViews["Navigation Views"]:::ui
        SearchViews["Search Views"]:::ui
        StoreViews["Store Views"]:::ui
        NotifViews["Notification Views"]:::ui
        CoreViews["Core Views"]:::ui
    end

    %% Application Layer
    subgraph Application
        AuthBloc["Auth BLoC"]:::bloc
        ProfileBloc["Profile BLoC"]:::bloc
        ExpBloc["Experience BLoC"]:::bloc
        NavBloc["Navigation BLoC"]:::bloc
        CommentBloc["Comments BLoC"]:::bloc
        SearchBloc["Search BLoC"]:::bloc
        StoreBloc["Store BLoC"]:::bloc
        NotifBloc["Notifications BLoC"]:::bloc
    end

    %% Domain Layer
    subgraph Domain
        AuthDomain["Auth Domain"]:::domain
        ProfileDomain["Profile Domain"]:::domain
        ExpDomain["Experience Domain"]:::domain
        NavDomain["Navigation Domain"]:::domain
        CommentDomain["Comments Domain"]:::domain
        SearchDomain["Search Domain"]:::domain
        StoreDomain["Store Domain"]:::domain
        NotifDomain["Notifications Domain"]:::domain
        CoreDomain["Core Domain"]:::core
    end

    %% Infrastructure Layer
    subgraph Infrastructure
        AuthData["Auth Repository"]:::data
        ProfileData["Profile Repository"]:::data
        ExpData["Experience Repository"]:::data
        NavData["Navigation Repository"]:::data
        CommentData["Comments Repository"]:::data
        SearchData["Search Repository"]:::data
        StoreData["Store Repository"]:::data
        NotifData["Notifications Repository"]:::data
        CoreInfra["Core Infrastructure"]:::core
    end

    %% External Services
    Firebase["Firebase Services"]:::external
    GoogleServices["Google Services"]:::external
    LocalStorage["Local Storage"]:::external
    LocationServices["Location Services"]:::external
    PaymentServices["Payment Processing"]:::external

    %% Relationships
    %% Views to BLoCs
    AuthViews --> AuthBloc
    ProfileViews --> ProfileBloc
    ExpViews --> ExpBloc
    NavViews --> NavBloc
    SearchViews --> SearchBloc
    StoreViews --> StoreBloc
    NotifViews --> NotifBloc

    %% BLoCs to Domain
    AuthBloc --> AuthDomain
    ProfileBloc --> ProfileDomain
    ExpBloc --> ExpDomain
    NavBloc --> NavDomain
    CommentBloc --> CommentDomain
    SearchBloc --> SearchDomain
    StoreBloc --> StoreDomain
    NotifBloc --> NotifDomain

    %% Domain to Data
    AuthDomain --> AuthData
    ProfileDomain --> ProfileData
    ExpDomain --> ExpData
    NavDomain --> NavData
    CommentDomain --> CommentData
    SearchDomain --> SearchData
    StoreDomain --> StoreData
    NotifDomain --> NotifData

    %% Data to External Services
    AuthData --> Firebase
    ProfileData --> Firebase
    ExpData --> Firebase
    NavData --> LocationServices
    SearchData --> Firebase
    StoreData --> PaymentServices
    NotifData --> Firebase

    %% Core Relationships
    CoreDomain --> CoreInfra
    CoreInfra --> LocalStorage
    CoreInfra --> GoogleServices

    %% Click Events
    click AuthViews "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/views/authentication/"
    click ProfileViews "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/views/profile/"
    click ExpViews "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/views/experience_management/"
    click NavViews "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/views/experience_navigation/"
    click SearchViews "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/views/search/"
    click StoreViews "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/views/store/"
    click NotifViews "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/views/notifications/"
    click CoreViews "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/views/core/"
    
    click AuthBloc "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/application/authentication/"
    click ProfileBloc "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/application/profile/"
    click ExpBloc "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/application/experience_management/"
    click NavBloc "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/application/experience_navigation/"
    click CommentBloc "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/application/comments/"
    click SearchBloc "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/application/search/"
    click StoreBloc "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/application/store/"
    click NotifBloc "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/application/notifications/"
    
    click AuthDomain "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/domain/authentication/"
    click ProfileDomain "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/domain/profile/"
    click ExpDomain "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/domain/experience_management/"
    click NavDomain "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/domain/experience_navigation/"
    click CommentDomain "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/domain/comments/"
    click SearchDomain "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/domain/search/"
    click StoreDomain "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/domain/store/"
    click NotifDomain "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/domain/notifications/"
    click CoreDomain "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/domain/core/"
    
    click AuthData "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/data/authentication/"
    click ProfileData "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/data/profile/"
    click ExpData "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/data/experience_management/"
    click NavData "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/data/experience_navigation/"
    click CommentData "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/data/comments/"
    click SearchData "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/data/search/"
    click StoreData "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/data/store/"
    click NotifData "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/data/notifications/"
    click CoreInfra "https://github.com/Charlie-sHub/world_on_client/tree/master/lib/data/core/"
```
