# mwpro/tiny-money architecture

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

- Interactive diagram: https://gitdiagram.com/mwpro/tiny-money
- Repository: https://github.com/mwpro/tiny-money

## Overview

##### Main Components
- Frontend:
- Located under the “frontend” directory.
- Built with Vue.js (components, router, store modules, plugins such as Vuetify).
- Handles the presentation layer with views for Budget management, Buffer transactions, Categories, Reports, Tags, Transactions, and Vendors.
- Backend:
- Found in the “backend” directory, particularly in the MW.TinyMoney.Api project.
- Implements REST APIs via controllers (e.g., BudgetController, Buffer, CategoriesController, TransactionsController, etc.) following a domain-driven design.
- Contains infrastructure components like a MySqlConnectionFactory which implies the use of MySQL.
- Database:
- Schema and setup scripts such as categoryTree.sql, dbschema.sql, reports.sql, and setup.sql suggest a relational database backend.
- CI/CD and Deployment:
- Azure Pipelines YAML files (azure-pipelines-backend.yml and azure-pipelines.front.yml) imply automated builds and tests.
- Docker Compose file indicates container orchestration capabilities.

##### Relationships and Interactions
- The backend processes requests (through its various controllers arranged by domain) and accesses the database.
- Deployment pipelines using Azure Pipelines and Docker Compose handle the continuous integration and deployment.
- Optionally, incorporate any external services if applicable (e.g., external authentication or third-party services, if used, although none are explicitly detected in the file structure).

##### Architectural Patterns and Design Principles
- Full-Stack Separation: Clearly separate the presentation (frontend) from the business logic and data-access (backend).
- Domain-Driven Design: In the backend, each domain (Budget, Buffer, Categories, etc.) is logically segmented, suggesting modularity.
- RESTful Service Pattern: The controllers and API models indicate that the backend follows REST principles.
- Dependency Injection / Infrastructure Layer: The presence of components like MySqlConnectionFactory hints at abstraction of resource creation.
- CI/CD and Containerization: The existence of pipeline definitions and docker-compose supports automation and containerized deployment.

##### Relevant Technologies and Frameworks
- Frontend:
- Vue.js, Vue Router, Vuex (store)
- Vuetify (UI plugins)
- Standard tooling (babel, ESLint, PostCSS)
- Backend:
- C#, ASP.NET Core Web API
- MySQL for persistence (via MySqlConnectionFactory)
- Organized into domain-specific controllers and API models
- Other:
- Azure Pipelines for CI/CD
- Docker Compose for environment management

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FE["Frontend (Vue.js Application)"]:::frontend
        FE_Budget["Budget Management Views & Store"]:::frontend
        FE_Buffer["Buffer Transactions"]:::frontend
        FE_Categories["Categories"]:::frontend
        FE_Reports["Reports"]:::frontend
        FE_Tags["Tags"]:::frontend
        FE_Transactions["Transactions"]:::frontend
        FE_Vendors["Vendors"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        BE["Backend API (ASP.NET Core)"]:::backend
        BE_Budget["Budget Domain"]:::backend
        BE_Buffer["Buffer Domain"]:::backend
        BE_Categories["Categories Domain"]:::backend
        BE_Transaction["Transaction Domain"]:::backend
        BE_Vendors["Vendors Domain"]:::backend
        BE_Tags["Tags Domain"]:::backend
        BE_Reports["Reports Domain"]:::backend
        BE_Infrastructure["Infrastructure (MySQL Connection)"]:::backend
    end

    %% Database & DevOps
    subgraph "Database & DevOps"
        DB["Database (MySQL)"]:::database
        SQL["SQL Setup Scripts"]:::database
        CI_CD["CI/CD Pipeline (Azure Pipelines)"]:::cicd
        Container["Containerization (Docker Compose)"]:::cicd
    end

    %% Data Flow between layers
    FE -->|"HTTP/REST"| BE
    BE -->|"CRUD"| DB
    BE_Infrastructure -->|"Connects"| DB

    %% Frontend domain specific API calls to corresponding backend domains
    FE_Budget -->|"API_call"| BE_Budget
    FE_Buffer -->|"API_call"| BE_Buffer
    FE_Categories -->|"API_call"| BE_Categories
    FE_Reports -->|"API_call"| BE_Reports
    FE_Tags -->|"API_call"| BE_Tags
    FE_Transactions -->|"API_call"| BE_Transaction
    FE_Vendors -->|"API_call"| BE_Vendors

    %% DevOps deployment flows
    CI_CD -->|"Deploys"| FE
    CI_CD -->|"Deploys"| BE
    Container -->|"Orchestrates"| FE
    Container -->|"Orchestrates"| BE

    %% Styles
    classDef frontend fill:#B3E5FC,stroke:#01579B,stroke-width:2px;
    classDef backend fill:#FFCDD2,stroke:#C62828,stroke-width:2px;
    classDef database fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px;
    classDef cicd fill:#FFF9C4,stroke:#F9A825,stroke-width:2px;

    %% Click Events for Frontend
    click FE "https://github.com/mwpro/tiny-money/tree/master/frontend/"
    click FE_Budget "https://github.com/mwpro/tiny-money/tree/master/frontend/src/budgets/"
    click FE_Budget "https://github.com/mwpro/tiny-money/blob/master/frontend/src/store/budgets.js"
    click FE_Buffer "https://github.com/mwpro/tiny-money/tree/master/frontend/src/buffer/"
    click FE_Buffer "https://github.com/mwpro/tiny-money/blob/master/frontend/src/store/buffer.js"
    click FE_Categories "https://github.com/mwpro/tiny-money/tree/master/frontend/src/categories/"
    click FE_Categories "https://github.com/mwpro/tiny-money/blob/master/frontend/src/store/categories.js"
    click FE_Reports "https://github.com/mwpro/tiny-money/tree/master/frontend/src/reports/"
    click FE_Reports "https://github.com/mwpro/tiny-money/blob/master/frontend/src/store/reports.js"
    click FE_Tags "https://github.com/mwpro/tiny-money/tree/master/frontend/src/tags/"
    click FE_Tags "https://github.com/mwpro/tiny-money/blob/master/frontend/src/store/tags.js"
    click FE_Transactions "https://github.com/mwpro/tiny-money/tree/master/frontend/src/transactions/"
    click FE_Transactions "https://github.com/mwpro/tiny-money/blob/master/frontend/src/store/transactions.js"
    click FE_Vendors "https://github.com/mwpro/tiny-money/tree/master/frontend/src/vendors/"
    click FE_Vendors "https://github.com/mwpro/tiny-money/blob/master/frontend/src/store/vendors.js"

    %% Click Events for Backend
    click BE "https://github.com/mwpro/tiny-money/tree/master/backend/MW.TinyMoney.Api/"
    click BE_Budget "https://github.com/mwpro/tiny-money/tree/master/backend/MW.TinyMoney.Api/Budget/"
    click BE_Buffer "https://github.com/mwpro/tiny-money/tree/master/backend/MW.TinyMoney.Api/Buffer/"
    click BE_Categories "https://github.com/mwpro/tiny-money/tree/master/backend/MW.TinyMoney.Api/Categories/"
    click BE_Transaction "https://github.com/mwpro/tiny-money/tree/master/backend/MW.TinyMoney.Api/Transaction/"
    click BE_Vendors "https://github.com/mwpro/tiny-money/tree/master/backend/MW.TinyMoney.Api/Vendors/"
    click BE_Tags "https://github.com/mwpro/tiny-money/tree/master/backend/MW.TinyMoney.Api/Tags/"
    click BE_Reports "https://github.com/mwpro/tiny-money/tree/master/backend/MW.TinyMoney.Api/Reports/"
    click BE_Infrastructure "https://github.com/mwpro/tiny-money/blob/master/backend/MW.TinyMoney.Api/Infrastructure/MySqlConnectionFactory.cs"

    %% Click Events for Database & DevOps
    click SQL "https://github.com/mwpro/tiny-money/tree/master/scripts/"
    click CI_CD "https://github.com/mwpro/tiny-money/blob/master/azure-pipelines-backend.yml"
    click CI_CD "https://github.com/mwpro/tiny-money/blob/master/azure-pipelines.front.yml"
    click Container "https://github.com/mwpro/tiny-money/blob/master/docker-compose.yml"
```
