# curtcox/expogallery architecture

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

- Interactive diagram: https://gitdiagram.com/curtcox/expogallery
- Repository: https://github.com/curtcox/expogallery

## Overview

##### Project’s Main Components
- App Layer: The heart of the application is located in the /app directory. It includes screens organized by feature – for instance, tabs for navigation (chat, explore, gallery, map, profile, etc.), indexes for introductory screens, and even dedicated sections like “eliza” for chatbot functionality and “examples” for demonstrating various features.
- Components: The /components folder contains reusable UI building blocks (e.g., Chat, MapView, ThemedText, WebView) that the screens in the app layer utilize.
- Services: Found in /services, these modules encapsulate API and service integrations (e.g., chat services, location services, external chat integration, and bot features). They form the backend-like logic that bridges UI and data.
- Hooks & Utilities: Custom hooks identified in /hooks and helper functions in /utils add reusable logic and abstract common functionality (for example, theming, local storage, alerts, and network utilities).
- Storage: The /storage folder contains functions for managing different types of local persistence (messages, profile, resources, settings).

##### Out the Interactions and Data Flows
- User Interfaces (in the App layer) interact with UI components from the /components folder. Screens rendered in the app then call custom hooks and communicate with services.
- Services (API integrations, device locations, chat functionalities) retrieve or send data and then interact with local storage to persist information.
- The assets are used by both UI components and the services (for instance, loading configuration JSON or static images) to present rich visuals.
- The utilities and hooks work as cross-cutting modules supporting proper state management, error logging, and responsive design.

##### Architectural Patterns & Design Principles
- Modularity & Separation of Concerns: Notice how the project divides responsibilities. There’s a clear separation between UI (App and Components), business logic (Services), data management (Storage), and cross-cutting utilities (Hooks/Utils).
- Multi-platform Development: Expo’s capabilities allow the same codebase to support iOS, Android, and Web. This cross-platform nature should be represented by showing how the user interface and service abstractions adapt based on the platform.

##### Final Touches
- Notes regarding the Expo ecosystem (cross-platform support via Expo CLI) and deployment aspects (e.g., GitHub workflows deploying the web version).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend/UI Layer"
        SN["Screens & Navigation (App folder)"]:::ui
        UC["UI Components (Components folder)"]:::ui
    end

    subgraph "Business Logic & Services"
        SVC["Services (APIs & Business Logic)"]:::services
        STOR["Storage (Local Persistence)"]:::support
    end

    subgraph "Data & Support"
        AST["Assets (Static Resources)"]:::support
        HOOK["Hooks"]:::support
        UTIL["Utilities"]:::support
    end

    SN -->|"UIRender"| UC
    UC -->|"ServiceCall"| SVC
    SVC -->|"LocalDataUpdate"| STOR
    AST -->|"UIResources"| UC
    AST -->|"ServiceConfig"| SVC
    UC -->|"UsesHooks"| HOOK
    HOOK -->|"UsesUtilities"| UTIL

    click SN "https://github.com/curtcox/expogallery/tree/main/ExpoGallery/app"
    click UC "https://github.com/curtcox/expogallery/tree/main/ExpoGallery/components"
    click AST "https://github.com/curtcox/expogallery/tree/main/ExpoGallery/assets"
    click SVC "https://github.com/curtcox/expogallery/tree/main/ExpoGallery/services"
    click HOOK "https://github.com/curtcox/expogallery/tree/main/ExpoGallery/hooks"
    click UTIL "https://github.com/curtcox/expogallery/tree/main/ExpoGallery/utils"
    click STOR "https://github.com/curtcox/expogallery/tree/main/ExpoGallery/storage"

    classDef ui fill:#AEDFF7,stroke:#333,stroke-width:1px;
    classDef services fill:#C1F0C1,stroke:#333,stroke-width:1px;
    classDef support fill:#F7E6AD,stroke:#333,stroke-width:1px;
```
