# guilhermesob/expo-management-app- architecture

> Architecture diagram of the GitHub repository guilhermesob/expo-management-app-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/guilhermesob/expo-management-app-
- Repository: https://github.com/guilhermesob/expo-management-app-

## Overview

##### Project Type and Purpose
- This is a client‐only mobile application built with Expo (React Native).
- It displays and manages a collection of “livros” (books) using a local data store (no remote backend).
- It follows a feature-driven directory layout (src/features/livros) and uses the Repository/DAO pattern for data persistence.

##### File Structure
Top-level files:
- App.js / index.js – application entry points
- app.json, package.json – Expo config and dependencies
- assets, components – shared UI pieces and images
src/:
- src/components – generic, reusable React components
- src/hooks – custom React hooks (e.g. useColorScheme)
- src/styles – global style definitions
- src/features/livros/:
– view: screens (LivrosScreen.tsx)
– controller: hook (useLivrosController.ts) driving UI logic
– model: database setup (DatabaseInstance.ts), DAO (GenericDAO.ts, livrosDAO.ts), repository interfaces & factories
– repository: concrete repository implementations (livros.repository.ts)

##### README for Additional Insights
- Confirms Expo/React Native usage and client‐side orientation.
- No mention of external APIs or servers—data is local.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry Points
    subgraph "Application Entry"
        Index["index.js"]:::entry
        App["App.js"]:::entry
    end

    %% UI Layer
    subgraph "UI Layer"
        LivrosScreen["LivrosScreen"]:::ui
        LivroItem["LivroItem"]:::ui
    end

    %% Controller Layer
    subgraph "Controller Layer"
        UseController["useLivrosController"]:::ctrl
    end

    %% Data Layer
    subgraph "Data Layer"
        subgraph "Model & Repository"
            RepoInterface["LivroStorageRepository"]:::data
            RepoFactory["livros.repository.factory.ts"]:::data
            RepoModelImpl["livros.repository.ts (model)"]:::data
            RepoRepoImpl["livros.repository.ts (repository)"]:::data
        end
        subgraph "DAO Layer"
            GenericDAO["GenericDAO"]:::data
            LivrosDAO["livrosDAO"]:::data
            ModelDef["livro.model.ts"]:::data
        end
        Database[(DatabaseInstance)]:::db
    end

    %% Utilities
    subgraph "Utilities"
        HookC["useColorScheme"]:::utils
        Styles["global.ts"]:::utils
        Assets["assets/"]:::utils
    end

    %% Relationships
    Index -->|"loads"| App
    App -->|"renders"| LivrosScreen
    User([User]) -->|"interacts"| LivrosScreen
    LivrosScreen -->|"renders"| LivroItem
    LivrosScreen -->|"uses"| UseController
    LivroItem -->|"uses"| UseController

    UseController -->|"calls interface"| RepoInterface
    UseController -->|"uses hook"| HookC
    UseController -->|"imports styles"| Styles

    RepoInterface -->|"instantiated by"| RepoFactory
    RepoFactory -->|"creates implementation"| RepoRepoImpl
    RepoRepoImpl -->|"implements interface"| RepoInterface
    RepoRepoImpl -->|"calls DAO"| LivrosDAO

    RepoModelImpl -->|"calls DAO"| LivrosDAO

    LivrosDAO -->|"extends"| GenericDAO
    LivrosDAO -->|"operates on model"| ModelDef
    GenericDAO -->|"accesses"| Database

    LivrosScreen -->|"imports styles"| Styles
    LivrosScreen -->|"loads assets"| Assets

    %% Click Events
    click LivrosScreen "https://github.com/guilhermesob/expo-management-app-/blob/main/src/features/livros/view/LivrosScreen.tsx"
    click LivroItem "https://github.com/guilhermesob/expo-management-app-/blob/main/src/components/LivroItem.tsx"
    click UseController "https://github.com/guilhermesob/expo-management-app-/blob/main/src/features/livros/controller/useLivrosController.ts"
    click RepoInterface "https://github.com/guilhermesob/expo-management-app-/blob/main/src/features/livros/model/LivroStorageRepository.ts"
    click RepoFactory "https://github.com/guilhermesob/expo-management-app-/blob/main/src/features/livros/model/livros.repository.factory.ts"
    click RepoModelImpl "https://github.com/guilhermesob/expo-management-app-/blob/main/src/features/livros/model/livros.repository.ts"
    click RepoRepoImpl "https://github.com/guilhermesob/expo-management-app-/blob/main/src/features/livros/repository/livros.repository.ts"
    click GenericDAO "https://github.com/guilhermesob/expo-management-app-/blob/main/src/features/livros/model/GenericDAO.ts"
    click LivrosDAO "https://github.com/guilhermesob/expo-management-app-/blob/main/src/features/livros/model/livrosDAO.ts"
    click Database "https://github.com/guilhermesob/expo-management-app-/blob/main/src/features/livros/model/DatabaseInstance.ts"
    click ModelDef "https://github.com/guilhermesob/expo-management-app-/blob/main/src/features/livros/model/livro.model.ts"
    click HookC "https://github.com/guilhermesob/expo-management-app-/blob/main/src/hooks/useColorScheme.ts"
    click Styles "https://github.com/guilhermesob/expo-management-app-/blob/main/src/styles/global.ts"
    click Assets "https://github.com/guilhermesob/expo-management-app-/tree/main/assets/"
    click App "https://github.com/guilhermesob/expo-management-app-/blob/main/App.js"
    click Index "https://github.com/guilhermesob/expo-management-app-/blob/main/index.js"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef ctrl fill:#90EE90,stroke:#000,stroke-width:1px
    classDef data fill:#FFA500,stroke:#000,stroke-width:1px
    classDef db fill:#F4A460,stroke:#000,stroke-width:1px
    classDef utils fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef entry fill:#EFEFEF,stroke:#000,stroke-width:1px
```
