# apiko-dev/perfi architecture

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

- Interactive diagram: https://gitdiagram.com/apiko-dev/perfi
- Repository: https://github.com/apiko-dev/perfi

## Overview

##### Project type and purpose
- This is a React Native mobile app (“Perfi”) for personal finance management, bootstrapped with Create React Native App (Expo).
- It’s a front-end–only codebase (no standalone backend code) that uses Redux for state management, React Navigation for screen flow, and Expo to package for Android/iOS.

##### File structure
- Top-level config files (.babelrc, .eslintrc.js, flowconfig, package.json) and scripts (npm start, ios, android).
- app/
- assets/ (fonts, images, svgs)
- components/ (reusable UI widgets)
- modules/ (Redux ducks: actions, reducers, operations, selectors, types per domain)
- navigation/ (navigator containers, drawer, route definitions)
- screens/ (screen containers + views per feature)
- store.js (Redux store setup)
- styles/ (global style tokens)
- utils/ (helpers, HOCs, enhancers)
- tests/ (unit tests for reducers)

##### README for additional insights
- Confirms it’s an open-source personal finance management app, installs via Expo, uses React Native CLI if ejected, no explicit backend—data likely local or via mockData.

##### Elements
- Clear labels for each layer and component.
- UI → Redux actions
- Operations → store updates
- Store → selectors → UI
- Navigation → screen transitions
- Purple ovals = Assets/Constants

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Expo Environment"
        direction TB
        AppConfig["App.js, app.json, package.json"]:::extern
        subgraph "Mobile Client"
            direction TB

            subgraph "UI Layer"
                direction TB
                Screens["Screens (Transactions, Accounts, Categories, Trends, Settings, OnBoarding, etc.)"]:::ui
                Components["Reusable Components (Buttons, Lists, Pickers, DateFilters, Icons)"]:::ui
            end

            subgraph "Navigation Layer"
                direction TB
                NavContainer["Navigator Containers"]:::ui
                NavDefs["Stack & Drawer Definitions"]:::ui
            end

            subgraph "State Management Layer"
                direction TB
                Store["Redux Store (store.js)"]:::state
                subgraph "Redux Modules"
                    direction TB
                    AppModule["app module"]:::state
                    AccountsModule["accounts module"]:::state
                    CategoriesModule["categories module"]:::state
                    TransactionsModule["transactions module"]:::state
                    TransfersModule["transfers module"]:::state
                    SettingsModule["settings module"]:::state
                    NavigatorModule["navigator module"]:::state
                end
            end

            subgraph "Data Layer"
                direction TB
                subgraph "Operations"
                    direction TB
                    OpAccounts["accounts operations"]:::data
                    OpCategories["categories operations"]:::data
                    OpTransactions["transactions operations"]:::data
                    OpTransfers["transfers operations"]:::data
                    OpSettings["settings operations"]:::data
                end
                subgraph "Mock Data"
                    direction TB
                    MockTransactions["transactions mockData"]:::data
                    MockTransfers["transfers mockData"]:::data
                end
                subgraph "Selectors"
                    direction TB
                    SelAccounts["accounts selectors"]:::data
                    SelCategories["categories selectors"]:::data
                    SelTransactions["transactions selectors"]:::data
                    SelTransfers["transfers selectors"]:::data
                end
            end

            subgraph "Asset & Constants Layer"
                direction TB
                Assets["Assets (fonts, images, SVGs)"]:::assets
                Constants["Constants (enums, icons, formats)"]:::assets
                Styles["Global Styles & Tokens"]:::assets
            end

            subgraph "Utility Layer"
                direction TB
                Utils["Helpers & HOCs (withLoading, withDataSource, enhancers)"]:::util
            end

            subgraph "Tests"
                direction TB
                Tests["Unit tests for reducers"]:::extern
            end

            %% Connections
            Screens -->|dispatch actions| Store
            Components -->|used by| Screens
            NavContainer -->|controls| Screens
            NavDefs -->|defines routes| NavContainer

            Store -->|state modules| AppModule
            AppModule -->|contains| AccountsModule
            AppModule -->|contains| CategoriesModule
            AppModule -->|contains| TransactionsModule
            AppModule -->|contains| TransfersModule
            AppModule -->|contains| SettingsModule
            AppModule -->|contains| NavigatorModule

            OpAccounts -->|update| AccountsModule
            OpCategories -->|update| CategoriesModule
            OpTransactions -->|update| TransactionsModule
            OpTransfers -->|update| TransfersModule
            OpSettings -->|update| SettingsModule

            MockTransactions -->|provide data| OpTransactions
            MockTransfers -->|provide data| OpTransfers

            AccountsModule -->|selectors| SelAccounts
            CategoriesModule -->|selectors| SelCategories
            TransactionsModule -->|selectors| SelTransactions
            TransfersModule -->|selectors| SelTransfers

            SelAccounts -->|supply data| Screens
            SelCategories -->|supply data| Screens
            SelTransactions -->|supply data| Screens
            SelTransfers -->|supply data| Screens

            Assets -->|injected into| Screens
            Constants -->|injected into| Screens
            Styles -->|applied to| Components
            Utils -->|wraps| Screens

            Tests -->|test reducers| AppModule

            %% Click Events
            click Screens "https://github.com/apiko-dev/perfi/tree/master/app/screens"
            click Components "https://github.com/apiko-dev/perfi/tree/master/app/components"
            click NavContainer "https://github.com/apiko-dev/perfi/tree/master/app/navigation"
            click NavDefs "https://github.com/apiko-dev/perfi/tree/master/app/navigation/navigators"
            click NavDefs "https://github.com/apiko-dev/perfi/tree/master/app/navigation/routes"
            click Store "https://github.com/apiko-dev/perfi/blob/master/app/store.js"
            click AppModule "https://github.com/apiko-dev/perfi/tree/master/app/modules/app"
            click AccountsModule "https://github.com/apiko-dev/perfi/tree/master/app/modules/accounts"
            click CategoriesModule "https://github.com/apiko-dev/perfi/tree/master/app/modules/categories"
            click TransactionsModule "https://github.com/apiko-dev/perfi/tree/master/app/modules/transactions"
            click TransfersModule "https://github.com/apiko-dev/perfi/tree/master/app/modules/transfers"
            click SettingsModule "https://github.com/apiko-dev/perfi/tree/master/app/modules/settings"
            click NavigatorModule "https://github.com/apiko-dev/perfi/tree/master/app/modules/navigator"
            click OpAccounts "https://github.com/apiko-dev/perfi/blob/master/app/modules/accounts/operations.js"
            click OpCategories "https://github.com/apiko-dev/perfi/blob/master/app/modules/categories/operations.js"
            click OpTransactions "https://github.com/apiko-dev/perfi/blob/master/app/modules/transactions/operations.js"
            click OpTransfers "https://github.com/apiko-dev/perfi/blob/master/app/modules/transfers/operations.js"
            click OpSettings "https://github.com/apiko-dev/perfi/blob/master/app/modules/settings/operations.js"
            click MockTransactions "https://github.com/apiko-dev/perfi/blob/master/app/modules/transactions/mockData.js"
            click MockTransfers "https://github.com/apiko-dev/perfi/blob/master/app/modules/transfers/mockData.js"
            click SelAccounts "https://github.com/apiko-dev/perfi/blob/master/app/modules/accounts/selectors.js"
            click SelCategories "https://github.com/apiko-dev/perfi/blob/master/app/modules/categories/selectors.js"
            click SelTransactions "https://github.com/apiko-dev/perfi/blob/master/app/modules/transactions/selectors.js"
            click SelTransfers "https://github.com/apiko-dev/perfi/blob/master/app/modules/transfers/selectors.js"
            click Assets "https://github.com/apiko-dev/perfi/tree/master/app/assets"
            click Constants "https://github.com/apiko-dev/perfi/tree/master/app/constants"
            click Styles "https://github.com/apiko-dev/perfi/tree/master/app/styles"
            click Utils "https://github.com/apiko-dev/perfi/tree/master/app/utils"
            click Tests "https://github.com/apiko-dev/perfi/tree/master/tests/reducers"

        end
    end

    classDef ui fill:#D0E8FF,stroke:#0366d6;
    classDef state fill:#E0FFD0,stroke:#228B22;
    classDef data fill:#FFE5B4,stroke:#FF8C00;
    classDef assets fill:#E5D0FF,stroke:#800080;
    classDef util fill:#FFFFFF,stroke:#A9A9A9,stroke-dasharray:5 5;
    classDef extern fill:#F0F0F0,stroke:#000000;
```
