# elvioamaral/alura_php-projeto-banco-oo architecture

> Architecture diagram of the GitHub repository elvioamaral/alura_php-projeto-banco-oo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/elvioamaral/alura_php-projeto-banco-oo
- Repository: https://github.com/elvioamaral/alura_php-projeto-banco-oo

## Overview

The repository is an object-oriented PHP banking example, with account operations as its clearest user-to-result workflow: the bank demo creates a customer and account, deposits and withdraws funds, then prints account details. Separate examples cover authentication and employee bonuses. The README describes file handling and exceptions, but the sampled application code does not show a file-handling workflow; this map reflects the banking code that is present. Some entry-script relationships are only indicated by the source index, so those links are marked unverified.

Main entry points: [`banco.php`](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/banco.php) (Bank demo), [`src/Modelo/Funcionario/Funcionario.php`](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/Funcionario.php) (Employee), [`src/Modelo/Pessoa.php`](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Pessoa.php) (Person), [`src/Modelo/Conta/Conta.php`](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/Conta.php) (Account operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts"]
  node_account["Account operations<br/>[Conta.php]"]
  node_checking["Checking account<br/>[ContaCorrente.php]"]
  node_savings["Savings account<br/>[ContaPoupanca.php]"]
  node_insufficient["Insufficient funds"]
end

subgraph group_people["People"]
  node_holder["Account holder<br/>[Titular.php]"]
  node_person["Person<br/>[Pessoa.php]"]
  node_cpf["CPF identity<br/>[CPF.php]"]
  node_address["Address<br/>[Endereco.php]"]
  node_property_access["Property access"]
  node_invalid_name["Invalid name"]
  node_auth_contract["Login contract<br/>[Autenticavel.php]"]
end

subgraph group_staff["Employees"]
  node_employee["Employee<br/>[Funcionario.php]"]
  node_director["Director<br/>[Diretor.php]"]
  node_manager["Manager<br/>[Gerente.php]"]
  node_developer["Developer<br/>[Desenvolvedor.php]"]
  node_video_editor["Video editor<br/>[EditorVideo.php]"]
end

subgraph group_services["Application services"]
  node_auth_demo["Authentication demo<br/>[autenticacao.php]"]
  node_auth_service["Authenticator<br/>[Autenticador.php]"]
  node_bonus_demo["Bonus demo<br/>[bonificacoes.php]"]
  node_bonus_service["Bonus controller"]
end

node_user(("User"))
node_bank_demo["Bank demo<br/>[banco.php]"]
node_autoload["Class loader<br/>[autoload.php]"]

node_user -.->|"runs"| node_bank_demo
node_bank_demo -->|"requires"| node_autoload
node_bank_demo -->|"creates"| node_address
node_bank_demo -->|"creates"| node_cpf
node_bank_demo -->|"creates"| node_holder
node_bank_demo -->|"creates"| node_checking
node_bank_demo -->|"creates"| node_savings
node_bank_demo -->|"deposits and withdraws"| node_account
node_account -->|"reads holder"| node_holder
node_account -->|"throws"| node_insufficient
node_checking -.->|"extends"| node_account
node_savings -->|"extends"| node_account
node_holder -->|"extends"| node_person
node_holder -->|"stores"| node_address
node_person -->|"stores"| node_cpf
node_person -->|"throws"| node_invalid_name
node_person -->|"uses"| node_property_access
node_address -->|"uses"| node_property_access
node_employee -->|"extends"| node_person
node_director -->|"extends"| node_employee
node_manager -->|"extends"| node_employee
node_developer -->|"extends"| node_employee
node_video_editor -->|"extends"| node_employee
node_auth_demo -.->|"uses"| node_auth_service
node_auth_service -->|"accepts"| node_auth_contract
node_director -->|"implements"| node_auth_contract
node_manager -.->|"implements"| node_auth_contract
node_bonus_demo -.->|"uses"| node_bonus_service
node_bonus_service -->|"calculates bonuses"| node_employee

click node_bank_demo "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/banco.php"
click node_autoload "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/autoload.php"
click node_account "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/Conta.php"
click node_checking "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/ContaCorrente.php"
click node_savings "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/ContaPoupanca.php"
click node_insufficient "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/SaldoInsuficienteException.php"
click node_holder "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/Titular.php"
click node_person "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Pessoa.php"
click node_cpf "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/CPF.php"
click node_address "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Endereco.php"
click node_property_access "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/AcessoPropriedades.php"
click node_invalid_name "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/NomeInvalidoException.php"
click node_auth_contract "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Autenticavel.php"
click node_employee "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/Funcionario.php"
click node_director "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/Diretor.php"
click node_manager "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/Gerente.php"
click node_developer "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/Desenvolvedor.php"
click node_video_editor "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/EditorVideo.php"
click node_auth_demo "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/autenticacao.php"
click node_auth_service "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Service/Autenticador.php"
click node_bonus_demo "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/bonificacoes.php"
click node_bonus_service "https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Service/ControladorDeBonificacoes.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_account,node_checking,node_savings,node_insufficient,node_user toneBlue
class node_holder,node_person,node_cpf,node_address,node_property_access,node_invalid_name,node_auth_contract toneAmber
class node_employee,node_director,node_manager,node_developer,node_video_editor toneMint
class node_auth_demo,node_auth_service,node_bonus_demo,node_bonus_service toneRose
class node_bank_demo,node_autoload toneTeal
```

## Components

### Accounts

- [Account operations](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/Conta.php): `src/Modelo/Conta/Conta.php`
- [Checking account](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/ContaCorrente.php): `src/Modelo/Conta/ContaCorrente.php`
- [Savings account](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/ContaPoupanca.php): `src/Modelo/Conta/ContaPoupanca.php`
- [Insufficient funds](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/SaldoInsuficienteException.php): `src/Modelo/Conta/SaldoInsuficienteException.php`

### People

- [Account holder](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Conta/Titular.php): `src/Modelo/Conta/Titular.php`
- [Person](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Pessoa.php): `src/Modelo/Pessoa.php`
- [CPF identity](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/CPF.php): `src/Modelo/CPF.php`
- [Address](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Endereco.php): `src/Modelo/Endereco.php`
- [Property access](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/AcessoPropriedades.php): `src/Modelo/AcessoPropriedades.php`
- [Invalid name](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/NomeInvalidoException.php): `src/Modelo/NomeInvalidoException.php`
- [Login contract](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Autenticavel.php): `src/Modelo/Autenticavel.php`

### Employees

- [Employee](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/Funcionario.php): `src/Modelo/Funcionario/Funcionario.php`
- [Director](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/Diretor.php): `src/Modelo/Funcionario/Diretor.php`
- [Manager](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/Gerente.php): `src/Modelo/Funcionario/Gerente.php`
- [Developer](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/Desenvolvedor.php): `src/Modelo/Funcionario/Desenvolvedor.php`
- [Video editor](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Modelo/Funcionario/EditorVideo.php): `src/Modelo/Funcionario/EditorVideo.php`

### Application services

- [Authentication demo](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/autenticacao.php): `autenticacao.php`
- [Authenticator](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Service/Autenticador.php): `src/Service/Autenticador.php`
- [Bonus demo](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/bonificacoes.php): `bonificacoes.php`
- [Bonus controller](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/src/Service/ControladorDeBonificacoes.php): `src/Service/ControladorDeBonificacoes.php`

### Other components

- **User**
- [Bank demo](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/banco.php): `banco.php`
- [Class loader](https://github.com/elvioamaral/alura_php-projeto-banco-oo/blob/master/autoload.php): `autoload.php`

## Connections

- User → Bank demo: runs
- Bank demo → Class loader: requires (evidence: `banco.php`)
- Bank demo → Address: creates (evidence: `banco.php`)
- Bank demo → CPF identity: creates (evidence: `banco.php`)
- Bank demo → Account holder: creates (evidence: `banco.php`)
- Bank demo → Checking account: creates (evidence: `banco.php`)
- Bank demo → Savings account: creates (evidence: `banco.php`)
- Bank demo → Account operations: deposits and withdraws (evidence: `banco.php`)
- Account operations → Account holder: reads holder (evidence: `src/Modelo/Conta/Conta.php`)
- Account operations → Insufficient funds: throws (evidence: `src/Modelo/Conta/Conta.php`)
- Checking account → Account operations: extends
- Savings account → Account operations: extends (evidence: `src/Modelo/Conta/ContaPoupanca.php`)
- Account holder → Person: extends (evidence: `src/Modelo/Conta/Titular.php`)
- Account holder → Address: stores (evidence: `src/Modelo/Conta/Titular.php`)
- Person → CPF identity: stores (evidence: `src/Modelo/Pessoa.php`)
- Person → Invalid name: throws (evidence: `src/Modelo/Pessoa.php`)
- Person → Property access: uses (evidence: `src/Modelo/Pessoa.php`)
- Address → Property access: uses (evidence: `src/Modelo/Endereco.php`)
- Employee → Person: extends (evidence: `src/Modelo/Funcionario/Funcionario.php`)
- Director → Employee: extends (evidence: `src/Modelo/Funcionario/Diretor.php`)
- Manager → Employee: extends (evidence: `src/Modelo/Funcionario/Gerente.php`)
- Developer → Employee: extends (evidence: `src/Modelo/Funcionario/Desenvolvedor.php`)
- Video editor → Employee: extends (evidence: `src/Modelo/Funcionario/EditorVideo.php`)
- Authentication demo → Authenticator: uses (evidence: `autenticacao.php`)
- Authenticator → Login contract: accepts (evidence: `src/Service/Autenticador.php`)
- Director → Login contract: implements (evidence: `src/Modelo/Funcionario/Diretor.php`)
- Manager → Login contract: implements (evidence: `src/Modelo/Funcionario/Gerente.php`)
- Bonus demo → Bonus controller: uses (evidence: `bonificacoes.php`)
- Bonus controller → Employee: calculates bonuses (evidence: `src/Service/ControladorDeBonificacoes.php`)
