# mrsedan/recordmoney architecture

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

- Interactive diagram: https://gitdiagram.com/mrsedan/recordmoney
- Repository: https://github.com/mrsedan/recordmoney

## Overview

##### Project Type and Purpose
- This is a React Native mobile application (“Record Money”) written in TypeScript.

##### File Structure Analysis
- Top-level files:
- App.tsx — application entry point and root component
- app.json, babel.config.js, metro.config.js — Expo/Metro bundler and build configuration
- package.json, tsconfig.json — dependencies and TS configuration
- Directories:
- views/ — feature modules, each in its own folder (accounts, advices, calendar, debts, home, piggybanks, tools)
- views/modular_components/ — reusable UI elements (Cards, Inputs, Headers, Modals)
- No backend folder—data persistence and logic all live on the client (likely using AsyncStorage, SQLite, or another local store).

##### README Insights
- Instructions focus on installing, starting (npm start), and running in web mode.
- No mention of remote APIs or microservices—mobile app logic only.

##### Main Components
a. App Entry & Bundler
- Metro Bundler / Expo runtime
- JS bundle loaded by native shell (iOS/Android)
b. UI Layer
- Navigation container (if used—assumed from App.tsx)
- Feature Views: Accounts, Advices, Calendar, Debts, Home, Piggy Banks, Tools
- Modular Components: Card, Input, Header, Modal, etc.
c. Data Layer
- Models / Interfaces.ts (type definitions)
- Persistence Service (AsyncStorage or SQLite wrapper)—abstracted as “Local Storage”
d. Platform & Device
- Native modules (iOS/Android OS) providing storage, file access, network interfaces

##### Relationships & Interactions
- App.tsx initializes the Navigation container and loads initial state from Local Storage.
- Feature Views consume Models and call Data Layer APIs to read/write records.
- Modular Components are used by Views to render lists, charts, forms.
- Persistence Service interacts with Native Storage.
- Assets are loaded at startup by Metro via app.json configuration.

##### Architectural Patterns & Principles
- Component-based UI (React paradigm)
- Separation of concerns:
- Views for UI, Models for types, Services for data
- Modular Components for reuse
- Single Source of Truth: application state stored in Local Storage and in-memory React state

##### Relevant Technologies
- React Native with Expo (app.json, metro.config.js)
- TypeScript (tsconfig.json, .tsx files)
- Metro Bundler, Babel (babel.config.js)
- AsyncStorage or SQLite (implied)
- NPM scripts (npm start, npm run web)

## Diagram (Mermaid)

```mermaid
graph TB
  subgraph "iOS / Android Device"
    %% Configuration & Bundler
    appJSON["app.json"]:::config
    babelConf["babel.config.js"]:::config
    metroConf["metro.config.js"]:::config
    Metro["Metro Bundler"]:::config
    JSBundle["JS Bundle"]:::config
    NativeShell["Native Shell"]:::config

    appJSON --> Metro
    babelConf --> Metro
    metroConf --> Metro
    Metro -->|"bundles JS"| JSBundle
    JSBundle -->|"executes"| NativeShell

    %% App Entry
    AppEntry["App.tsx"]:::config
    NativeShell -->|"loads"| AppEntry

    %% UI Layer
    subgraph "UI Layer"
      Nav["Navigation Container"]:::ui

      subgraph "Features"
        Accounts["Accounts View"]:::ui
        Advices["Advices View"]:::ui
        Calendar["Calendar View"]:::ui
        Debts["Debts View"]:::ui
        subgraph "Home Feature"
          Home["Home View"]:::ui
          CustomDonut["CustomDonutChart"]:::ui
          Donut["DonutChart"]:::ui
          Item["Item"]:::ui
          ListHistory["ListHistory"]:::ui
          ModalCat["ModalWindowCategory"]:::ui
          ModalHist["ModalWindowHistory"]:::ui
          Category["category.ts"]:::ui
          SmallCircle["smallCircle.tsx"]:::ui
          Home --> CustomDonut
          Home --> Donut
          Home --> Item
          Home --> ListHistory
          Home --> ModalCat
          Home --> ModalHist
          Home --> Category
          Home --> SmallCircle
        end
        subgraph "Piggy Banks"
          Piggy["Piggy Banks View"]:::ui
          InputPG["InputPG"]:::ui
          Piggy --> InputPG
        end
        subgraph "Tools"
          ToolsAcc["account.ts"]:::ui
          ToolsIO["iosys.ts"]:::ui
        end
        Calendar --> InputDate["InputDate"]:::ui
      end

      subgraph "Modular Components"
        Card["Card"]:::ui
        CardSwipe["CardSwipe"]:::ui
        CardBtn["CardWithButtons"]:::ui
        Header["Header"]:::ui
        Input["Input"]:::ui
        InputContact["InputContact"]:::ui
        MenuModal["MenuModal"]:::ui
        ModalWin["ModalWindow"]:::ui
        ModalOne["ModalWindowOneButton"]:::ui
      end

      AppEntry --> Nav
      Nav --> Accounts
      Nav --> Advices
      Nav --> Calendar
      Nav --> Debts
      Nav --> Home
      Nav --> Piggy
      Nav --> ToolsAcc
      Nav --> ToolsIO
      %% Features use modular components
      Accounts --> Card
      Advices --> Card
      Calendar --> ModalWin
      Debts --> CardBtn
      Home --> Header
      Piggy --> Input
      ToolsAcc --> MenuModal
      ToolsIO --> ModalOne
    end

    %% Data Layer
    subgraph "Data Layer"
      Models["interfaces.ts"]:::data
      Service["Persistence Service"]:::data
      Storage["Local Storage"]:::storage
      Models --> Service
      Service --> Storage
      AppEntry --> Service
      Accounts --> Service
      Advices --> Service
      Calendar --> Service
      Debts --> Service
      Home --> Service
      Piggy --> Service
      ToolsAcc --> Service
      ToolsIO --> Service
    end

    %% Assets Pipeline
    subgraph "Assets"
      FontAssets["assets/font"]:::assets
      IconAssets["assets/icon"]:::assets
      FontAssets --> Metro
      IconAssets --> Metro
    end
  end

  %% Click Events
  click AppEntry "https://github.com/mrsedan/recordmoney/blob/master/App.tsx"
  click appJSON "https://github.com/mrsedan/recordmoney/blob/master/app.json"
  click babelConf "https://github.com/mrsedan/recordmoney/blob/master/babel.config.js"
  click metroConf "https://github.com/mrsedan/recordmoney/blob/master/metro.config.js"
  click Accounts "https://github.com/mrsedan/recordmoney/blob/master/views/accounts/Account.tsx"
  click Advices "https://github.com/mrsedan/recordmoney/blob/master/views/advices/Advice.tsx"
  click Calendar "https://github.com/mrsedan/recordmoney/blob/master/views/calendar/Calendar.tsx"
  click InputDate "https://github.com/mrsedan/recordmoney/blob/master/views/calendar/additionally/InputDate.tsx"
  click Debts "https://github.com/mrsedan/recordmoney/blob/master/views/debts/Debt.tsx"
  click Home "https://github.com/mrsedan/recordmoney/blob/master/views/home/Home.tsx"
  click CustomDonut "https://github.com/mrsedan/recordmoney/blob/master/views/home/CustomDonutChart.tsx"
  click Donut "https://github.com/mrsedan/recordmoney/blob/master/views/home/DonutChart.tsx"
  click Item "https://github.com/mrsedan/recordmoney/blob/master/views/home/Item.tsx"
  click ListHistory "https://github.com/mrsedan/recordmoney/blob/master/views/home/ListHistory.tsx"
  click ModalCat "https://github.com/mrsedan/recordmoney/blob/master/views/home/ModalWindowCategory.tsx"
  click ModalHist "https://github.com/mrsedan/recordmoney/blob/master/views/home/ModalWindowHistory.tsx"
  click Category "https://github.com/mrsedan/recordmoney/blob/master/views/home/category.ts"
  click SmallCircle "https://github.com/mrsedan/recordmoney/blob/master/views/home/smallCircle.tsx"
  click Piggy "https://github.com/mrsedan/recordmoney/blob/master/views/piggybanks/PiggyBank.tsx"
  click InputPG "https://github.com/mrsedan/recordmoney/blob/master/views/piggybanks/InputPG.tsx"
  click ToolsAcc "https://github.com/mrsedan/recordmoney/blob/master/views/tools/account.ts"
  click ToolsIO "https://github.com/mrsedan/recordmoney/blob/master/views/tools/iosys.ts"
  click Card "https://github.com/mrsedan/recordmoney/blob/master/views/modular_components/Card.tsx"
  click CardSwipe "https://github.com/mrsedan/recordmoney/blob/master/views/modular_components/CardSwipe.tsx"
  click CardBtn "https://github.com/mrsedan/recordmoney/blob/master/views/modular_components/CardWithButtons.tsx"
  click Header "https://github.com/mrsedan/recordmoney/blob/master/views/modular_components/Header.tsx"
  click Input "https://github.com/mrsedan/recordmoney/blob/master/views/modular_components/Input.tsx"
  click InputContact "https://github.com/mrsedan/recordmoney/blob/master/views/modular_components/InputContact.tsx"
  click MenuModal "https://github.com/mrsedan/recordmoney/blob/master/views/modular_components/MenuModal.tsx"
  click ModalWin "https://github.com/mrsedan/recordmoney/blob/master/views/modular_components/ModalWindow.tsx"
  click ModalOne "https://github.com/mrsedan/recordmoney/blob/master/views/modular_components/ModalWindowOneButton.tsx"
  click Models "https://github.com/mrsedan/recordmoney/blob/master/models/interfaces.ts"

  %% Styles
  classDef ui fill:#D0E8FF,stroke:#0366d6,stroke-width:1px
  classDef data fill:#DFFFE0,stroke:#28a745,stroke-width:1px
  classDef config fill:#FFE4B5,stroke:#d2691e,stroke-width:1px
  classDef storage fill:#F0F0F0,stroke:#888888,stroke-width:1px,stroke-dasharray: 5 5
  classDef assets fill:#E8E8E8,stroke:#666666,stroke-width:1px,stroke-dasharray: 2 2
```
