# chronie-shizutoki/homemoney architecture

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

- Interactive diagram: https://gitdiagram.com/chronie-shizutoki/homemoney
- Repository: https://github.com/chronie-shizutoki/homemoney

## Overview

##### Project Type and Purpose
- This is a full-stack web application (“Household Finance Manager”) with:
- A Vue 3 SPA frontend (client/)
- An Express/Sequelize/SQLite backend API server (server/)
- Static-hosted mini-applications under client/public/miniapp
- Purpose: enable multilingual personal finance tracking, analytics, budget/debt/todo management and mini-app extensibility.

##### File Structure
- Top-level “client/” directory houses the Vue 3 application (components, views, router, stores).
- “client/public/miniapp/” contains self-contained micro-apps (calculator, text-encryption-tool) auto-discovered at runtime.
- Top-level “server/” directory houses an Express server:
- src/controllers (request handlers)
- src/models (Sequelize ORM entities)
- src/routes (API endpoints)
- src/utils (response formatters, import/export helpers)
- Config files: vite.config.js (frontend build), server/config/config.js, package.json scripts for dev/build.
- Database migrations/scripts under server/scripts.

##### README for Additional Insights
- Tech stack: Vue 3, Vite, Element Plus, Pinia, Chart.js, Vue I18n, Axios on frontend; Express, SQLite3, Sequelize on backend; Day.js, Papa Parse for CSVs; bcrypt for encryption.
- Architectural patterns:
- Frontend: component-based UI, composables, Pinia stores, Router.
- Backend: MVC (controllers/models/routes), utility modules for import/export.
- Mini-app subsystem: dynamic scanning of client/public/miniapp, metadata via package.json in each mini‐app.

##### Detail
- Every major module: router, store, controllers, models, utils, scripts
- Data flows (create/read/update/delete) and analytics pipelines (charts, CSV export/import)
- I18n module connecting to UI text layers
- Build/deploy boundary: Vite dev server vs. production build

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        SPA["Vue SPA"]:::ui
        Components["Vue Components"]:::ui
        Views["Vue Views"]:::ui
        Router["Vue Router"]:::ui
        Stores["Pinia Stores"]:::ui
        Composables["Composables"]:::ui
        I18n["Internationalization (i18n)"]:::ui
        UtilsFE["Utility Modules (FE)"]:::ui
        MiniManager["Mini-App Manager"]:::ui
        subgraph "Mini-Apps"
            Calc["Calculator Mini-App"]:::static
            TextEnc["Text Encryption Tool Mini-App"]:::static
        end
    end

    %% API Layer
    subgraph "API Layer"
        Server["Express API Server"]:::api
        Routes["API Routes"]:::api
        Controllers["Request Controllers"]:::api
        UtilsBE["Utility Modules (BE)"]:::api
        ConfBE["Server Configuration"]:::api
    end

    %% Data Layer
    subgraph "Data Layer"
        DB["SQLite Database"]:::data
        Models["Sequelize Models"]:::data
        DBInit["Database Initialization"]:::data
        Scripts["CSV Import/Export Scripts"]:::data
    end

    %% External Libraries
    Axios["Axios (HTTP)"]:::ext
    ChartJS["Chart.js"]:::ext
    PapaParse["Papa Parse"]:::ext
    Dayjs["Day.js"]:::ext
    Bcrypt["bcrypt"]:::ext

    %% Relationships
    SPA --> Router
    SPA --> Stores
    SPA --> Components
    Components <--> Stores
    Router --> Views
    Views --> ChartJS
    Views --> Dayjs
    UtilsFE --> PapaParse

    SPA -->|Axios HTTP| Axios
    Axios -->|calls| Routes
    Routes --> Controllers
    Controllers --> Models
    Controllers --> UtilsBE
    Controllers --> Bcrypt
    Models --> DB
    DBInit --> DB
    Scripts --> DB

    MiniManager --> Calc
    MiniManager --> TextEnc

    ConfBE --> Server
    Server --> Routes
    Server --> Controllers
    Server --> UtilsBE
    Server --> DBInit
    Server --> Scripts

    %% Click Events
    click SPA "https://github.com/chronie-shizutoki/homemoney/tree/main/client/src"
    click Components "https://github.com/chronie-shizutoki/homemoney/tree/main/client/src/components"
    click Views "https://github.com/chronie-shizutoki/homemoney/tree/main/client/src/views"
    click Router "https://github.com/chronie-shizutoki/homemoney/blob/main/client/src/router/index.js"
    click Stores "https://github.com/chronie-shizutoki/homemoney/tree/main/client/src/stores"
    click Composables "https://github.com/chronie-shizutoki/homemoney/tree/main/client/src/composables"
    click I18n "https://github.com/chronie-shizutoki/homemoney/blob/main/client/src/locales/i18n.js"
    click UtilsFE "https://github.com/chronie-shizutoki/homemoney/tree/main/client/src/utils"
    click MiniManager "https://github.com/chronie-shizutoki/homemoney/blob/main/client/src/components/MiniAppManager.vue"
    click Calc "https://github.com/chronie-shizutoki/homemoney/tree/main/client/public/miniapp/calculator"
    click TextEnc "https://github.com/chronie-shizutoki/homemoney/tree/main/client/public/miniapp/text-encryption-tool"
    click Server "https://github.com/chronie-shizutoki/homemoney/blob/main/server/src/app.js"
    click Routes "https://github.com/chronie-shizutoki/homemoney/tree/main/server/src/routes"
    click Controllers "https://github.com/chronie-shizutoki/homemoney/tree/main/server/src/controllers"
    click Models "https://github.com/chronie-shizutoki/homemoney/tree/main/server/src/models"
    click DBInit "https://github.com/chronie-shizutoki/homemoney/blob/main/server/src/db.js"
    click Scripts "https://github.com/chronie-shizutoki/homemoney/tree/main/server/scripts"
    click UtilsBE "https://github.com/chronie-shizutoki/homemoney/tree/main/server/src/utils"
    click ConfBE "https://github.com/chronie-shizutoki/homemoney/blob/main/server/config/config.js"

    %% Styles
    classDef ui fill:#B3CDE0,stroke:#036,stroke-width:1px
    classDef api fill:#C7E9B4,stroke:#083,stroke-width:1px
    classDef data fill:#FDD0A2,stroke:#F60,stroke-width:1px
    classDef static fill:#E0E0E0,stroke:#888,stroke-width:1px
    classDef ext stroke-dasharray:5 5,fill:none,stroke:#999,stroke-width:1px
```
