# yebinnnnn/moneylover architecture

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

- Interactive diagram: https://gitdiagram.com/yebinnnnn/moneylover
- Repository: https://github.com/yebinnnnn/moneylover

## Overview

##### Project type and purpose
- This is a front-end, mobile-first web application (“MoneyLover”) built with Vue 3 + Vite. It provides personal finance features: recording income/expenses, visualizing charts, calendar views, budget management, and savings goals. There is no dedicated backend in the repo; a local JSON file (db.json) is likely used with a mock server or will be replaced by a real REST API.

##### File structure
- Top-level: configuration files (.gitignore, package.json, vite.config.js), a mock database (db.json), and public/index.html.
- `src/`: the heart of the app
- `main.js` / `App.vue`: bootstraps the Vue application and mounts router + Pinia.
- `router/index.js`: defines client-side routes for pages.
- `stores/*.js`: Pinia stores (budget, saving, user, counter) hold application state and perform API calls via Axios.
- `pages/`: grouped by feature (home, charts, plus, saving, login, mypage), each containing view components and subcomponents (e.g., `ExpenseChart.vue`, `IncomeList.vue`).
- `assets/`: CSS, fonts, images for UI.
- `utils/`: helper functions (`hash.js`, `navigation.js`).
- `constants/translate.js`: static text or i18n keys.

##### Key technologies & frameworks (from README)
- Vue 3 (core UI), Vue Router (routing), Pinia (state management)
- Axios (HTTP), Day.js (date handling), Chart.js / v-calendar (visuals), SweetAlert2 (alerts), Bootstrap 5 (styling)
- Vite (build tool), Prettier, Font Awesome, Figma (design)

- Browser / Client
- Vue Application
· Router Layer
· View Layer (Pages & Components)
· State Layer (Pinia Stores)
· Service Layer (Axios HTTP client)
· Utility Layer (utils, constants)
- Assets Layer (CSS, fonts, images)
- Mock API / Real API (db.json or external backend)
- External Libraries & Services (Chart.js, Day.js, SweetAlert2)

- User → Browser UI → Router → Page Components
- Components → dispatch/pull from Pinia Store
- Pinia Store ↔ Axios Service → Mock API/Backend
- Store updates → Components re-render → Charts & Calendar libraries consume data
- Utils/Constants are imported by Pages, Stores, or Components

c. Architectural patterns & principles:
- Component-based UI with single responsibility (Vue SFCs)
- Unidirectional data flow: components dispatch actions, stores update state, state propagates back
- Modular folder structure by feature to enforce separation of concerns
- Pluggable service layer (HTTP client) for easy swap of mock vs. real API

- Public/index.html and Vite serve the app; vite.config.js configures the build

## Diagram (Mermaid)

```mermaid
flowchart TB
    Browser["User / Browser"]:::external

    subgraph "Vue Application"
        direction TB
        AppBootstrap["App Bootstrap\n(main.js & App.vue)"]:::frontend
        subgraph "Router Layer"
            Router["Vue Router\n(src/router/index.js)"]:::frontend
        end
        subgraph "View Layer"
            direction TB
            HomeView["HomeView.vue"]:::frontend
            HomeCalendar["HomeCalendar.vue"]:::frontend
            ExpenseListHome["ExpenseList.vue"]:::frontend
            BudgetSettings["BudgetSettings.vue"]:::frontend
            ExpenseChartView["Expense.vue + ExpenseChart.vue\n(Charts)"]:::frontend
            IncomeChartView["Income.vue + IncomeChart.vue\n(Charts)"]:::frontend
            PlusTab["AddTab.vue\n(Add Transaction)"]:::frontend
            PlusIncome["AddTabIncome.vue"]:::frontend
            PlusOutcome["AddTabOutcome.vue"]:::frontend
            PlusCalendar["AddCalendarModal.vue"]:::frontend
            SavingManagement["SavingManagement.vue"]:::frontend
            AddSavings["AddSavings.vue"]:::frontend
            SavingDetail["SavingDetail.vue"]:::frontend
            SignIn["SignIn.vue"]:::frontend
            SignUp["SignUp.vue"]:::frontend
            ChangePassword["ChangePassword.vue"]:::frontend
            SettingsMain["SettingsMain.vue"]:::frontend
            SettingIcon["SettingIcon.vue"]:::frontend
        end
        subgraph "State Layer"
            BudgetStore["budget.js"]:::state
            SavingStore["saving.js"]:::state
            UserStore["user.js"]:::state
            CounterStore["counter.js"]:::state
        end
        Service["Axios HTTP Client"]:::service
        subgraph "Utility Layer"
            HashUtil["hash.js"]:::util
            NavUtil["navigation.js"]:::util
        end
        Const["translate.js"]:::util
        Assets["Assets\n(CSS, fonts, images)"]:::assets
    end

    DataSource["Mock API / db.json"]:::data

    Browser --> AppBootstrap
    AppBootstrap --> Router
    Router --> HomeView
    Router --> ExpenseChartView
    Router --> IncomeChartView
    Router --> PlusTab
    Router --> SavingManagement
    Router --> SignIn
    Router --> SettingsMain

    HomeView --> HomeCalendar
    HomeView --> ExpenseListHome
    HomeView --> BudgetSettings

    ExpenseChartView --> ExpenseListHome
    IncomeChartView --> IncomeChartView

    PlusTab --> PlusIncome
    PlusTab --> PlusOutcome
    PlusTab --> PlusCalendar

    SavingManagement --> AddSavings
    SavingManagement --> SavingDetail

    SettingsMain --> SettingIcon

    HomeView & ExpenseChartView & IncomeChartView & PlusTab & SavingManagement & SignIn & SettingsMain --> BudgetStore
    HomeView & ExpenseChartView & IncomeChartView & PlusTab & SavingManagement & SignIn & SettingsMain --> SavingStore
    SignIn & SettingsMain --> UserStore
    AnyView --> CounterStore

    BudgetStore --> Service
    SavingStore --> Service
    UserStore --> Service
    CounterStore --> Service

    Service --> DataSource
    DataSource --> Service

    Assets --> HomeView
    Assets --> ExpenseChartView
    Assets --> IncomeChartView
    Assets --> PlusTab
    Assets --> SavingManagement
    Assets --> SignIn
    Assets --> SettingsMain

    HashUtil --> HomeView
    HashUtil --> SignIn
    NavUtil --> Router
    NavUtil --> SettingsMain
    Const --> HomeView
    Const --> ExpenseChartView

    classDef frontend fill:#D0E8FF,stroke:#0971B2,stroke-width:1px
    classDef state fill:#D0FFD6,stroke:#228B22,stroke-width:1px
    classDef service fill:#E0FFE0,stroke:#32CD32,stroke-width:1px
    classDef util fill:#F0F0F0,stroke:#A9A9A9,stroke-width:1px
    classDef assets fill:#FFF5E6,stroke:#FFA500,stroke-width:1px
    classDef data fill:#FFEFD5,stroke:#FF8C00,stroke-width:1px
    classDef external fill:#E8E8E8,stroke:#666666,stroke-width:1px

    click AppBootstrap "https://github.com/yebinnnnn/moneylover/blob/main/src/main.js"
    click AppBootstrap "https://github.com/yebinnnnn/moneylover/blob/main/src/App.vue"
    click Router "https://github.com/yebinnnnn/moneylover/blob/main/src/router/index.js"
    click HomeView "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/home/HomeView.vue"
    click HomeCalendar "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/home/HomeCalendar.vue"
    click ExpenseListHome "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/home/ExpenseList.vue"
    click BudgetSettings "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/home/BudgetSettings.vue"
    click ExpenseChartView "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/charts/expense/Expense.vue"
    click ExpenseChartView "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/charts/expense/ExpenseChart.vue"
    click IncomeChartView "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/charts/income/Income.vue"
    click IncomeChartView "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/charts/income/IncomeChart.vue"
    click PlusTab "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/plus/AddTab.vue"
    click PlusIncome "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/plus/AddTabIncome.vue"
    click PlusOutcome "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/plus/AddTabOutcome.vue"
    click PlusCalendar "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/plus/AddCalendarModal.vue"
    click SavingManagement "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/saving/SavingManagement.vue"
    click AddSavings "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/saving/AddSavings.vue"
    click SavingDetail "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/saving/SavingDetail.vue"
    click SignIn "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/login/SignIn.vue"
    click SignUp "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/login/SignUp.vue"
    click ChangePassword "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/login/ChangePassword.vue"
    click SettingsMain "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/mypage/SettingsMain.vue"
    click SettingIcon "https://github.com/yebinnnnn/moneylover/blob/main/src/pages/mypage/SettingIcon.vue"
    click BudgetStore "https://github.com/yebinnnnn/moneylover/blob/main/src/stores/budget.js"
    click SavingStore "https://github.com/yebinnnnn/moneylover/blob/main/src/stores/saving.js"
    click UserStore "https://github.com/yebinnnnn/moneylover/blob/main/src/stores/user.js"
    click CounterStore "https://github.com/yebinnnnn/moneylover/blob/main/src/stores/counter.js"
    click HashUtil "https://github.com/yebinnnnn/moneylover/blob/main/src/utils/hash.js"
    click NavUtil "https://github.com/yebinnnnn/moneylover/blob/main/src/utils/navigation.js"
    click Const "https://github.com/yebinnnnn/moneylover/blob/main/src/constants/translate.js"
    click Assets "https://github.com/yebinnnnn/moneylover/blob/main/src/assets/main.css"
    click DataSource "https://github.com/yebinnnnn/moneylover/blob/main/db.json"
```
