# shibly/moneymate architecture

> Architecture diagram of the GitHub repository shibly/moneymate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shibly/moneymate
- Repository: https://github.com/shibly/moneymate

## Overview

1. MoneyMate is a Laravel 12 monolith for personal finance tracking. It serves HTML pages from Blade templates, persists relational finance data in MySQL, and ships as a traditional PHP app behind Apache/Nginx, with Docker support for local deployment.

2. The request path is layered: `routes/web.php` sends traffic to controllers, controllers delegate most business logic to services, services use repository interfaces, and repository implementations wrap Eloquent models. This is the main architectural boundary to draw.

3. Validation is isolated in many dedicated Form Request classes. That keeps controllers thin and separates input rules for create/update flows across accounts, budgets, debts, transfers, currencies, and translations.

4. The core domain is organized around finance entities: users, categories, currencies, banks, bank accounts, incomes, expenses, budgets, debt/borrow/lend/repayment records, and account transfers. These are stored as first-class Eloquent models with a shared user-scoped data model in migrations.

5. Money movement is the central data flow. Incomes and expenses feed dashboard totals, budget calculations, and reports; transfers move balances between accounts; debt/lend/borrow records track liabilities and repayments; currency conversion is handled in a dedicated service rather than spread through controllers.

6. Reporting is a separate concern. Expense and income report controllers work with report repositories and export classes, indicating both on-screen analytics and downloadable report output. This is where aggregation, filtering, and export formatting happen.

7. The UI layer lives in `resources/views` and is split into admin, auth, installer, and shared layout/includes. The app uses a dashboard shell with sidebar/topbar partials, plus dedicated pages for calendar, budgets, reports, languages, profile, and application settings.

8. Front-end behavior is bundled through Vite and `resources/js`, while `public/libs` and `public/js` carry a large set of vendor assets. The interface depends on Tabler/Bootstrap styling, ApexCharts for graphs, FullCalendar for timeline views, DataTables for tabular management, and several form/UI helpers like Select2, Litepicker, Dropzone, SweetAlert, TinyMCE, and Tom Select.

9. Internationalization is a real subsystem, not an afterthought. `Language`, `Translation`, and related controllers/repositories support runtime language management, and there are database seeders for default languages, translations, currencies, options, and the initial user.

10. Installation is built into the application. `InstallationController`, `resources/views/installer`, and the public installer assets show a first-run setup flow that likely initializes configuration and seed data before the app becomes usable.

11. Cross-cutting persistence and audit concerns are visible in migrations and config. The app includes an activity log table and `config/activitylog.php`, suggesting recorded user actions, while `Option`/settings tables provide app-level configuration stored in the database rather than environment-only settings.

12. For an architecture diagram, the key boundaries are: browser/UI assets on one side; Blade views and controllers in the presentation layer; services as business orchestration; repositories as data-access abstraction; Eloquent/MySQL as persistence; and a small set of supporting subsystems for installation, localization, reporting, and dashboard analytics.

Main entry points: [`app/Http/Controllers`](https://github.com/shibly/moneymate/tree/main/app/Http/Controllers) (Controllers), [`app/Services`](https://github.com/shibly/moneymate/tree/main/app/Services) (Finance services), [`app/Repositories/Contracts`](https://github.com/shibly/moneymate/tree/main/app/Repositories/Contracts) (Repo contracts), [`app/Models`](https://github.com/shibly/moneymate/tree/main/app/Models) (Models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_routes_web["Web routes<br/>http routing<br/>[web.php]"]
  node_controllers["Controllers"]
  node_form_requests["Form requests<br/>validation"]
  node_views["Blade views<br/>UI templates"]
  node_frontend_assets["Frontend assets<br/>vite/public assets"]
end

subgraph group_domain["Domain"]
  node_finance_services["Finance services<br/>business services"]
  node_currency_service(("FX service<br/>conversion service"))
end

subgraph group_data["Data"]
  node_repositories_contracts["Repo contracts<br/>abstraction interfaces"]
  node_repositories_eloquent["Eloquent repos<br/>data adapters"]
  node_models[("Models")]
  node_migrations["Migrations<br/>schema history"]
end

subgraph group_support["Support"]
  node_dashboard(("Dashboard<br/>analytics shell"))
  node_seeders["Seeders<br/>bootstrap data"]
  node_reports["Reports<br/>analytics/export"]
  node_exports["Exports<br/>report exporters"]
  node_install(("Installer<br/>setup flow"))
  node_i18n(("Localization<br/>language system"))
  node_settings(("Settings<br/>app configuration"))
end

node_routes_web -->|"dispatches"| node_controllers
node_controllers -->|"validates with"| node_form_requests
node_controllers -->|"orchestrates"| node_finance_services
node_controllers -->|"serves"| node_reports
node_controllers -->|"serves"| node_install
node_controllers -->|"serves"| node_i18n
node_controllers -->|"serves"| node_settings
node_controllers -->|"renders"| node_dashboard
node_controllers -->|"renders"| node_views
node_views -->|"loads"| node_frontend_assets
node_finance_services -->|"depends on"| node_repositories_contracts
node_repositories_contracts -->|"implemented by"| node_repositories_eloquent
node_repositories_eloquent -->|"wraps"| node_models
node_models -->|"persisted by"| node_migrations
node_seeders -->|"bootstraps"| node_models
node_dashboard -->|"aggregates"| node_finance_services
node_currency_service -->|"supports"| node_finance_services
node_reports -->|"queries via"| node_repositories_contracts
node_reports -->|"exports"| node_exports
node_install -->|"initializes"| node_seeders
node_i18n -->|"uses"| node_repositories_contracts
node_settings -->|"stores via"| node_models

click node_routes_web "https://github.com/shibly/moneymate/blob/main/routes/web.php"
click node_controllers "https://github.com/shibly/moneymate/tree/main/app/Http/Controllers"
click node_form_requests "https://github.com/shibly/moneymate/tree/main/app/Http/Requests"
click node_views "https://github.com/shibly/moneymate/tree/main/resources/views"
click node_frontend_assets "https://github.com/shibly/moneymate/tree/main/resources/js"
click node_dashboard "https://github.com/shibly/moneymate/blob/main/app/Http/Controllers/DashboardController.php"
click node_finance_services "https://github.com/shibly/moneymate/tree/main/app/Services"
click node_currency_service "https://github.com/shibly/moneymate/blob/main/app/Services/CurrencyConversionService.php"
click node_repositories_contracts "https://github.com/shibly/moneymate/tree/main/app/Repositories/Contracts"
click node_repositories_eloquent "https://github.com/shibly/moneymate/tree/main/app/Repositories/Eloquent"
click node_models "https://github.com/shibly/moneymate/tree/main/app/Models"
click node_migrations "https://github.com/shibly/moneymate/tree/main/database/migrations"
click node_seeders "https://github.com/shibly/moneymate/tree/main/database/seeders"
click node_reports "https://github.com/shibly/moneymate/blob/main/app/Http/Controllers/ExpenseReportController.php"
click node_exports "https://github.com/shibly/moneymate/tree/main/app/Exports"
click node_install "https://github.com/shibly/moneymate/blob/main/app/Http/Controllers/InstallationController.php"
click node_i18n "https://github.com/shibly/moneymate/blob/main/app/Http/Controllers/LanguageController.php"
click node_settings "https://github.com/shibly/moneymate/blob/main/app/Http/Controllers/SettingController.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routes_web,node_controllers,node_form_requests,node_views,node_frontend_assets toneBlue
class node_finance_services,node_currency_service toneAmber
class node_repositories_contracts,node_repositories_eloquent,node_models,node_migrations toneMint
class node_dashboard,node_seeders,node_reports,node_exports,node_install,node_i18n,node_settings toneRose
```

## Components

### Presentation

HTTP entrypoints, controllers, Blade views, and frontend assets.

- [Web routes](https://github.com/shibly/moneymate/blob/main/routes/web.php): http routing · Main browser request entrypoint and route definitions. · `routes/web.php`
- [Controllers](https://github.com/shibly/moneymate/tree/main/app/Http/Controllers): presentation controllers · Thin HTTP controllers for dashboard, finance flows, auth, profile, settings, and installer. · `app/Http/Controllers`
- [Form requests](https://github.com/shibly/moneymate/tree/main/app/Http/Requests): validation · Dedicated request validators for create and update flows. · `app/Http/Requests`
- [Blade views](https://github.com/shibly/moneymate/tree/main/resources/views): UI templates · Admin, auth, installer, layout, and shared Blade templates. · `resources/views`
- [Frontend assets](https://github.com/shibly/moneymate/tree/main/resources/js): vite/public assets · Bundled app JavaScript plus vendor UI libraries and static assets. · `resources/js`

### Domain

Core finance entities and business orchestration.

- [Finance services](https://github.com/shibly/moneymate/tree/main/app/Services): business services · Orchestration for accounts, budgets, categories, incomes, expenses, debts, and transfers. · `app/Services`
- [FX service](https://github.com/shibly/moneymate/blob/main/app/Services/CurrencyConversionService.php): conversion service · Central currency conversion logic used across finance flows. · `app/Services/CurrencyConversionService.php`

### Data

Repositories, Eloquent models, migrations, and seed data.

- [Repo contracts](https://github.com/shibly/moneymate/tree/main/app/Repositories/Contracts): abstraction interfaces · Repository interfaces that define the data-access boundary. · `app/Repositories/Contracts`
- [Eloquent repos](https://github.com/shibly/moneymate/tree/main/app/Repositories/Eloquent): data adapters · Eloquent-backed repository implementations. · `app/Repositories/Eloquent`
- [Models](https://github.com/shibly/moneymate/tree/main/app/Models): Eloquent models · Finance, localization, settings, and user models. · `app/Models`
- [Migrations](https://github.com/shibly/moneymate/tree/main/database/migrations): schema history · Relational schema for user-scoped finance data and activity log. · `database/migrations`

### Support

Installation, localization, reporting, and operational subsystems.

- [Dashboard](https://github.com/shibly/moneymate/blob/main/app/Http/Controllers/DashboardController.php): analytics shell · Home dashboard, widgets, and summary finance totals. · `app/Http/Controllers/DashboardController.php`
- [Seeders](https://github.com/shibly/moneymate/tree/main/database/seeders): bootstrap data · Initial currencies, languages, translations, options, and user data. · `database/seeders`
- [Reports](https://github.com/shibly/moneymate/blob/main/app/Http/Controllers/ExpenseReportController.php): analytics/export · Income and expense reporting plus export formatting. · `app/Http/Controllers/ExpenseReportController.php`
- [Exports](https://github.com/shibly/moneymate/tree/main/app/Exports): report exporters · Downloadable report output classes for income and expense data. · `app/Exports`
- [Installer](https://github.com/shibly/moneymate/blob/main/app/Http/Controllers/InstallationController.php): setup flow · First-run installation controller, pages, and public assets. · `app/Http/Controllers/InstallationController.php`
- [Localization](https://github.com/shibly/moneymate/blob/main/app/Http/Controllers/LanguageController.php): language system · Runtime language and translation management. · `app/Http/Controllers/LanguageController.php`
- [Settings](https://github.com/shibly/moneymate/blob/main/app/Http/Controllers/SettingController.php): app configuration · Database-backed options and application settings. · `app/Http/Controllers/SettingController.php`

## Connections

- Web routes → Controllers: dispatches · Browser routes resolve to presentation controllers.
- Controllers → Form requests: validates with · Controllers delegate input validation to form requests.
- Controllers → Finance services: orchestrates · Finance controllers hand business work to services.
- Controllers → Reports: serves · Report controllers coordinate analytics pages.
- Controllers → Installer: serves · Installation controller handles first-run setup.
- Controllers → Localization: serves · Language and translation controllers manage localization.
- Controllers → Settings: serves · Settings controller manages app configuration.
- Controllers → Dashboard: renders · Dashboard controller feeds the app shell and widgets.
- Controllers → Blade views: renders · Controllers return Blade templates.
- Blade views → Frontend assets: loads · Templates depend on bundled JS and vendor assets.
- Finance services → Repo contracts: depends on · Services program against repository interfaces.
- Repo contracts → Eloquent repos: implemented by · Eloquent classes provide the concrete repository layer.
- Eloquent repos → Models: wraps · Repositories operate through Eloquent models.
- Models → Migrations: persisted by · Model structures correspond to the schema history.
- Seeders → Models: bootstraps · Seeders create initial reference and user data.
- Dashboard → Finance services: aggregates · Dashboard summaries are built from core finance services.
- FX service → Finance services: supports · Currency conversion is used by finance orchestration.
- Reports → Repo contracts: queries via · Reports use dedicated report repositories and filtering queries.
- Reports → Exports: exports · Report controllers hand off downloadable output formatting.
- Installer → Seeders: initializes · Installer likely seeds the application during setup.
- Localization → Repo contracts: uses · Localization management relies on repository-backed persistence.
- Settings → Models: stores via · Settings are stored in database-backed option models.
