# pedroleandro/moneta architecture

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

- Interactive diagram: https://gitdiagram.com/pedroleandro/moneta
- Repository: https://github.com/pedroleandro/moneta

## Overview

Moneta is a web app for organizing personal finances, not a bank or payment processor. Users register or sign in, then manage accounts, transactions, cards and invoices, shared expenses, installment purchases, recurring entries, transfers, debts and loans. The README documents an MVC structure; the sampled transaction and invoice models show user-scoped financial data and invoice totals. The graph preserves major README capabilities, but several domain controllers and route files were not sampled, so their internal wiring is left unasserted.

Main entry points: [`app/Core/AbstractModel.php`](https://github.com/pedroleandro/moneta/blob/main/app/Core/AbstractModel.php) (Model base), [`app/Models/Transaction.php`](https://github.com/pedroleandro/moneta/blob/main/app/Models/Transaction.php) (Transactions), [`app/Models/BankAccount.php`](https://github.com/pedroleandro/moneta/blob/main/app/Models/BankAccount.php) (Bank accounts), [`routes/auth.php`](https://github.com/pedroleandro/moneta/blob/main/routes/auth.php) (Access routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and access"]
  node_entry["Web entry<br/>[index.php]"]
  node_router["Route registry<br/>[web.php]"]
  node_authroutes["Access routes<br/>[auth.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_social["Social sign-in"]
  node_verification["Login verification"]
end

subgraph group_money["Accounts and activity"]
  node_account["Bank accounts<br/>[BankAccount.php]"]
  node_transactions["Transactions<br/>[Transaction.php]"]
  node_transfer["Account transfers"]
  node_categories["Categories<br/>[Category.php]"]
end

subgraph group_cards["Cards and sharing"]
  node_cards["Credit cards<br/>[CreditCard.php]"]
  node_invoices["Card invoices<br/>[CardInvoice.php]"]
  node_cardusers["Shared card users<br/>[CardUser.php]"]
  node_splits["Transaction splits"]
end

subgraph group_planning["Planning and obligations"]
  node_installments["Installment purchases"]
  node_recurrences["Recurring entries<br/>[Recurrence.php]"]
  node_recurrencejob["Recurrence runner"]
  node_debts["Debts<br/>[DebtController.php]"]
  node_loans["Loans<br/>[LoanController.php]"]
end

subgraph group_core["Application core"]
  node_controller["MVC controller base<br/>[Controller.php]"]
  node_modelbase["Model base<br/>[AbstractModel.php]"]
  node_database[("MySQL database")]
  node_session["Session and auth<br/>[Auth.php]"]
  node_audit["Audit logging<br/>[AuditLog.php]"]
  node_logger["Application logger<br/>[Logger.php]"]
end

node_person(("User"))

node_person -->|"uses"| node_entry
node_entry -->|"loads routes"| node_router
node_router -->|"loads"| node_authroutes
node_router -->|"registers access"| node_authroutes
node_authroutes -->|"routes to"| node_auth
node_authroutes -->|"routes to"| node_social
node_authroutes -->|"routes to"| node_verification
node_auth -->|"uses"| node_session
node_auth -.->|"extends"| node_controller
node_transactions -->|"extends"| node_modelbase
node_account -->|"extends"| node_modelbase
node_cards -->|"extends"| node_modelbase
node_invoices -->|"extends"| node_modelbase
node_cardusers -->|"extends"| node_modelbase
node_categories -->|"extends"| node_modelbase
node_splits -->|"extends"| node_modelbase
node_installments -->|"extends"| node_modelbase
node_recurrences -->|"extends"| node_modelbase
node_modelbase -->|"reads and writes"| node_database
node_account -->|"queries"| node_database
node_transactions -->|"joins account data"| node_account
node_transactions -->|"joins invoice data"| node_invoices
node_invoices -->|"recalculates totals"| node_database
node_cards -->|"uses invoices"| node_invoices
node_cardusers -->|"validates linked cards"| node_cards
node_debts -->|"uses"| node_account
node_debts -->|"uses"| node_transactions
node_loans -->|"uses"| node_account
node_loans -->|"uses"| node_transactions
node_recurrencejob -->|"processes"| node_recurrences
node_recurrencejob -->|"creates entries"| node_transactions
node_recurrencejob -->|"uses"| node_account
node_recurrencejob -->|"logs"| node_logger
node_audit -->|"writes audit records"| node_database
node_audit -->|"logs failures"| node_logger
node_controller -.->|"renders views"| node_controller
node_controller -.->|"uses models"| node_database

click node_entry "https://github.com/pedroleandro/moneta/blob/main/index.php"
click node_router "https://github.com/pedroleandro/moneta/blob/main/routes/web.php"
click node_authroutes "https://github.com/pedroleandro/moneta/blob/main/routes/auth.php"
click node_auth "https://github.com/pedroleandro/moneta/blob/main/app/Controllers/AuthController.php"
click node_social "https://github.com/pedroleandro/moneta/blob/main/app/Controllers/SocialAuthController.php"
click node_verification "https://github.com/pedroleandro/moneta/blob/main/app/Controllers/LoginVerificationController.php"
click node_account "https://github.com/pedroleandro/moneta/blob/main/app/Models/BankAccount.php"
click node_transactions "https://github.com/pedroleandro/moneta/blob/main/app/Models/Transaction.php"
click node_transfer "https://github.com/pedroleandro/moneta/blob/main/app/Controllers/AccountTransferController.php"
click node_categories "https://github.com/pedroleandro/moneta/blob/main/app/Models/Category.php"
click node_cards "https://github.com/pedroleandro/moneta/blob/main/app/Models/CreditCard.php"
click node_invoices "https://github.com/pedroleandro/moneta/blob/main/app/Models/CardInvoice.php"
click node_cardusers "https://github.com/pedroleandro/moneta/blob/main/app/Models/CardUser.php"
click node_splits "https://github.com/pedroleandro/moneta/blob/main/app/Models/TransactionSplit.php"
click node_installments "https://github.com/pedroleandro/moneta/blob/main/app/Models/InstallmentPurchase.php"
click node_recurrences "https://github.com/pedroleandro/moneta/blob/main/app/Models/Recurrence.php"
click node_recurrencejob "https://github.com/pedroleandro/moneta/blob/main/bin/run-recurrences.php"
click node_debts "https://github.com/pedroleandro/moneta/blob/main/app/Controllers/DebtController.php"
click node_loans "https://github.com/pedroleandro/moneta/blob/main/app/Controllers/LoanController.php"
click node_controller "https://github.com/pedroleandro/moneta/blob/main/app/Core/Controller.php"
click node_modelbase "https://github.com/pedroleandro/moneta/blob/main/app/Core/AbstractModel.php"
click node_session "https://github.com/pedroleandro/moneta/blob/main/app/Core/Auth.php"
click node_audit "https://github.com/pedroleandro/moneta/blob/main/app/Core/AuditLog.php"
click node_logger "https://github.com/pedroleandro/moneta/blob/main/app/Core/Logger.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_entry,node_router,node_authroutes,node_auth,node_social,node_verification,node_person toneBlue
class node_account,node_transactions,node_transfer,node_categories toneAmber
class node_cards,node_invoices,node_cardusers,node_splits toneMint
class node_installments,node_recurrences,node_recurrencejob,node_debts,node_loans toneRose
class node_controller,node_modelbase,node_database,node_session,node_audit,node_logger toneIndigo
```

## Components

### Web and access

- [Web entry](https://github.com/pedroleandro/moneta/blob/main/index.php): `index.php`
- [Route registry](https://github.com/pedroleandro/moneta/blob/main/routes/web.php): `routes/web.php`
- [Access routes](https://github.com/pedroleandro/moneta/blob/main/routes/auth.php): `routes/auth.php`
- [Authentication](https://github.com/pedroleandro/moneta/blob/main/app/Controllers/AuthController.php): `app/Controllers/AuthController.php`
- [Social sign-in](https://github.com/pedroleandro/moneta/blob/main/app/Controllers/SocialAuthController.php): `app/Controllers/SocialAuthController.php`
- [Login verification](https://github.com/pedroleandro/moneta/blob/main/app/Controllers/LoginVerificationController.php): `app/Controllers/LoginVerificationController.php`

### Accounts and activity

- [Bank accounts](https://github.com/pedroleandro/moneta/blob/main/app/Models/BankAccount.php): `app/Models/BankAccount.php`
- [Transactions](https://github.com/pedroleandro/moneta/blob/main/app/Models/Transaction.php): `app/Models/Transaction.php`
- [Account transfers](https://github.com/pedroleandro/moneta/blob/main/app/Controllers/AccountTransferController.php): `app/Controllers/AccountTransferController.php`
- [Categories](https://github.com/pedroleandro/moneta/blob/main/app/Models/Category.php): `app/Models/Category.php`

### Cards and sharing

- [Credit cards](https://github.com/pedroleandro/moneta/blob/main/app/Models/CreditCard.php): `app/Models/CreditCard.php`
- [Card invoices](https://github.com/pedroleandro/moneta/blob/main/app/Models/CardInvoice.php): `app/Models/CardInvoice.php`
- [Shared card users](https://github.com/pedroleandro/moneta/blob/main/app/Models/CardUser.php): `app/Models/CardUser.php`
- [Transaction splits](https://github.com/pedroleandro/moneta/blob/main/app/Models/TransactionSplit.php): `app/Models/TransactionSplit.php`

### Planning and obligations

- [Installment purchases](https://github.com/pedroleandro/moneta/blob/main/app/Models/InstallmentPurchase.php): `app/Models/InstallmentPurchase.php`
- [Recurring entries](https://github.com/pedroleandro/moneta/blob/main/app/Models/Recurrence.php): `app/Models/Recurrence.php`
- [Recurrence runner](https://github.com/pedroleandro/moneta/blob/main/bin/run-recurrences.php): `bin/run-recurrences.php`
- [Debts](https://github.com/pedroleandro/moneta/blob/main/app/Controllers/DebtController.php): `app/Controllers/DebtController.php`
- [Loans](https://github.com/pedroleandro/moneta/blob/main/app/Controllers/LoanController.php): `app/Controllers/LoanController.php`

### Application core

- [MVC controller base](https://github.com/pedroleandro/moneta/blob/main/app/Core/Controller.php): `app/Core/Controller.php`
- [Model base](https://github.com/pedroleandro/moneta/blob/main/app/Core/AbstractModel.php): `app/Core/AbstractModel.php`
- **MySQL database**
- [Session and auth](https://github.com/pedroleandro/moneta/blob/main/app/Core/Auth.php): `app/Core/Auth.php`
- [Audit logging](https://github.com/pedroleandro/moneta/blob/main/app/Core/AuditLog.php): `app/Core/AuditLog.php`
- [Application logger](https://github.com/pedroleandro/moneta/blob/main/app/Core/Logger.php): `app/Core/Logger.php`

### Other components

- **User**

## Connections

- User → Web entry: uses (evidence: `README.md`)
- Web entry → Route registry: loads routes (evidence: `index.php`)
- Route registry → Access routes: loads (evidence: `routes/web.php`)
- Route registry → Access routes: registers access (evidence: `routes/web.php`)
- Access routes → Authentication: routes to (evidence: `routes/auth.php`)
- Access routes → Social sign-in: routes to (evidence: `routes/auth.php`)
- Access routes → Login verification: routes to (evidence: `routes/auth.php`)
- Authentication → Session and auth: uses (evidence: `app/Core/Auth.php`)
- Authentication → MVC controller base: extends
- Transactions → Model base: extends (evidence: `app/Models/Transaction.php`)
- Bank accounts → Model base: extends (evidence: `app/Models/BankAccount.php`)
- Credit cards → Model base: extends (evidence: `app/Models/CreditCard.php`)
- Card invoices → Model base: extends (evidence: `app/Models/CardInvoice.php`)
- Shared card users → Model base: extends (evidence: `app/Models/CardUser.php`)
- Categories → Model base: extends (evidence: `app/Models/Category.php`)
- Transaction splits → Model base: extends (evidence: `app/Models/TransactionSplit.php`)
- Installment purchases → Model base: extends (evidence: `app/Models/InstallmentPurchase.php`)
- Recurring entries → Model base: extends (evidence: `app/Models/Recurrence.php`)
- Model base → MySQL database: reads and writes (evidence: `app/Core/AbstractModel.php`)
- Bank accounts → MySQL database: queries (evidence: `app/Models/BankAccount.php`)
- Transactions → Bank accounts: joins account data (evidence: `app/Models/Transaction.php`)
- Transactions → Card invoices: joins invoice data (evidence: `app/Models/Transaction.php`)
- Card invoices → MySQL database: recalculates totals (evidence: `app/Models/CardInvoice.php`)
- Credit cards → Card invoices: uses invoices (evidence: `app/Models/CreditCard.php`)
- Shared card users → Credit cards: validates linked cards (evidence: `app/Models/CardUser.php`)
- Debts → Bank accounts: uses (evidence: `app/Controllers/DebtController.php`)
- Debts → Transactions: uses (evidence: `app/Controllers/DebtController.php`)
- Loans → Bank accounts: uses (evidence: `app/Controllers/LoanController.php`)
- Loans → Transactions: uses (evidence: `app/Controllers/LoanController.php`)
- Recurrence runner → Recurring entries: processes (evidence: `bin/run-recurrences.php`)
- Recurrence runner → Transactions: creates entries (evidence: `bin/run-recurrences.php`)
- Recurrence runner → Bank accounts: uses (evidence: `bin/run-recurrences.php`)
- Recurrence runner → Application logger: logs (evidence: `bin/run-recurrences.php`)
- Audit logging → MySQL database: writes audit records (evidence: `app/Core/AuditLog.php`)
- Audit logging → Application logger: logs failures (evidence: `app/Core/AuditLog.php`)
- MVC controller base → MVC controller base: renders views (evidence: `app/Core/Controller.php`)
- MVC controller base → MySQL database: uses models
