# pratyanj/paldex architecture

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

- Interactive diagram: https://gitdiagram.com/pratyanj/paldex
- Repository: https://github.com/pratyanj/paldex

## Overview

##### Main Application Architecture Layer
- Inside this container, create three main sections:
a. Navigation Layer (based on file-based routing)
b. Core Features Layer
c. Data Layer

##### Navigation Structure (Top Layer)
- Tab navigation structure with four main tabs:
- Breeding
- Construction
- Inventory
- Map
- Sub-navigation routes for detailed screens

##### Core Features Layer (Middle)

a. Inventory Management System:
- Connections to multiple inventory types (Weapons, Armor, Accessories, etc.)
- Link to respective detail screens
- To component library

b. Breeding System:
- FindParent and KnowOffspring components
- Link to breeding data source

c. Construction System:
- Link Production screens
- To production data

d. System:
- Tile management system
- To map assets

##### Components Layer
- Work_Suitability
- General_screen
- Inventory components (CraftingRecipe, ItemCard, etc.)
- Micro components (BottomSheetDrawer, filters)

##### Data Layer (Bottom)
Data structure with:
- JSON data files organization
- Asset management (images, fonts)
- Constants and configurations

##### State Management
- ThemeContext provider
- Hooks integration (useColorScheme, useThemeColor)

Use these visual elements:

- Blue: Navigation components
- Green: Core features
- Yellow: Data layer
- Purple: Shared components
- Gray: Configuration files

- Symbols:
- Rectangles: Components/Modules
- Hexagons: Entry points

Important Considerations:

##### Theme system and its integration across the app

Additional Notes:
- Annotations for key architectural decisions
- Relationship between screens and their corresponding data sources

Remember to highlight the Expo-specific architecture elements and how they integrate with the custom components and features of the application.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Expo Application Framework"
        subgraph "Navigation Layer"
            RootNav["Root Navigator"]:::nav
            TabNav["Tab Navigator"]:::nav
            Breeding["Breeding Tab"]:::nav
            Construction["Construction Tab"]:::nav
            Inventory["Inventory Tab"]:::nav
            Map["Map Tab"]:::nav

            RootNav --> TabNav
            TabNav --> Breeding
            TabNav --> Construction
            TabNav --> Inventory
            TabNav --> Map
        end

        subgraph "Core Features Layer"
            subgraph "Inventory System"
                InvLayout["Inventory Layout"]:::core
                WeaponScreen["Weapon Screen"]:::core
                ArmorScreen["Armor Screen"]:::core
                AccessoryScreen["Accessory Screen"]:::core
                ItemCard["Item Card"]:::component
                CraftRecipe["Crafting Recipe"]:::component
            end

            subgraph "Breeding System"
                FindParent["Find Parent"]:::core
                KnowOffspring["Know Offspring"]:::core
                BreedingComponent["Breeding Component"]:::component
            end

            subgraph "Construction System"
                ProdScreen["Production Screen"]:::core
                ProdDetail["Production Detail"]:::core
                Productions["Productions Data"]:::data
            end
        end

        subgraph "Shared Components"
            WorkSuit["Work Suitability"]:::component
            GenScreen["General Screen"]:::component
            BottomSheet["Bottom Sheet Drawer"]:::component
            FilterBtn["Filter Button"]:::component
            SearchInput["Search Input"]:::component
        end

        subgraph "Data Layer"
            InvData[("Inventory Data")]:::data
            PalsData[("Pals Data")]:::data
            BreedingData[("Breeding Data")]:::data
            Images[("Images")]:::data
        end

        subgraph "State Management"
            ThemeContext["Theme Context"]:::state
            ColorScheme["Color Scheme"]:::state
            ThemeColor["Theme Color"]:::state
            Colors["Colors"]:::state
            ImageMap["Image Mapping"]:::state
            AllItems["All Items"]:::state
        end
    end

    %% Component Connections
    InvLayout --> WeaponScreen & ArmorScreen & AccessoryScreen
    WeaponScreen & ArmorScreen & AccessoryScreen --> ItemCard
    ItemCard --> CraftRecipe
    FindParent & KnowOffspring --> BreedingComponent
    ProdScreen --> ProdDetail
    
    %% Data Connections
    InvData -.-> ItemCard
    BreedingData -.-> BreedingComponent
    Productions -.-> ProdScreen
    
    %% State Connections
    ThemeContext --> ColorScheme
    ThemeContext --> ThemeColor
    Colors --> ThemeContext
    ImageMap --> ItemCard
    AllItems --> InvLayout

    %% Styles
    classDef nav fill:#3498db
    classDef core fill:#2ecc71
    classDef component fill:#9b59b6
    classDef data fill:#f1c40f
    classDef state fill:#95a5a6

    %% Click Events
    click RootNav "https://github.com/pratyanj/PalDex/blob/master/app/_layout.tsx"
    click TabNav "https://github.com/pratyanj/PalDex/blob/master/app/(tabs)/_layout.tsx"
    click Breeding "https://github.com/pratyanj/PalDex/blob/master/app/(tabs)/Breeding.tsx"
    click Construction "https://github.com/pratyanj/PalDex/blob/master/app/(tabs)/Construction.tsx"
    click Inventory "https://github.com/pratyanj/PalDex/blob/master/app/(tabs)/Inventory.tsx"
    click Map "https://github.com/pratyanj/PalDex/blob/master/app/(tabs)/Map.tsx"
    click InvLayout "https://github.com/pratyanj/PalDex/blob/master/app/inventory/_layout.tsx"
    click WeaponScreen "https://github.com/pratyanj/PalDex/blob/master/app/inventory/weaponScreen.tsx"
    click ArmorScreen "https://github.com/pratyanj/PalDex/blob/master/app/inventory/ArmorScreen.tsx"
    click AccessoryScreen "https://github.com/pratyanj/PalDex/blob/master/app/inventory/AccessoryScreen.tsx"
    click ItemCard "https://github.com/pratyanj/PalDex/blob/master/components/inv/itemCard.tsx"
    click CraftRecipe "https://github.com/pratyanj/PalDex/blob/master/components/inv/CraftingRecipe.tsx"
    click FindParent "https://github.com/pratyanj/PalDex/blob/master/app/breeding/FindPerent.tsx"
    click KnowOffspring "https://github.com/pratyanj/PalDex/blob/master/app/breeding/KnowOffspring.tsx"
    click BreedingComponent "https://github.com/pratyanj/PalDex/blob/master/components/micro/breeding.tsx"
    click ProdScreen "https://github.com/pratyanj/PalDex/blob/master/app/Construction/ProductionScreen.tsx"
    click ProdDetail "https://github.com/pratyanj/PalDex/blob/master/app/Construction/ProductionDetail.tsx"
    click Productions "https://github.com/pratyanj/PalDex/blob/master/constants/Productions.tsx"
    click WorkSuit "https://github.com/pratyanj/PalDex/blob/master/components/Work_Suitability.tsx"
    click GenScreen "https://github.com/pratyanj/PalDex/blob/master/components/general_screen.tsx"
    click BottomSheet "https://github.com/pratyanj/PalDex/blob/master/components/micro/BottomSheetDrawer .tsx"
    click FilterBtn "https://github.com/pratyanj/PalDex/blob/master/components/micro/filter/button.tsx"
    click SearchInput "https://github.com/pratyanj/PalDex/blob/master/components/micro/filter/search_input.tsx"
    click InvData "https://github.com/pratyanj/PalDex/tree/master/assets/json/inventory/"
    click PalsData "https://github.com/pratyanj/PalDex/blob/master/assets/json/pals1.json"
    click BreedingData "https://github.com/pratyanj/PalDex/blob/master/assets/json/breeding.json"
    click Images "https://github.com/pratyanj/PalDex/tree/master/assets/images/"
    click ThemeContext "https://github.com/pratyanj/PalDex/blob/master/constants/ThemeContext.tsx"
    click ColorScheme "https://github.com/pratyanj/PalDex/blob/master/hooks/useColorScheme.ts"
    click ThemeColor "https://github.com/pratyanj/PalDex/blob/master/hooks/useThemeColor.ts"
    click Colors "https://github.com/pratyanj/PalDex/blob/master/constants/Colors.ts"
    click ImageMap "https://github.com/pratyanj/PalDex/blob/master/constants/imageMapping.tsx"
    click AllItems "https://github.com/pratyanj/PalDex/blob/master/constants/allItems.tsx"
```
