# jandelson/tdd-php architecture

> Architecture diagram of the GitHub repository jandelson/tdd-php, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jandelson/tdd-php
- Repository: https://github.com/jandelson/tdd-php

## Overview

##### Project type and purpose
- This is a small PHP domain-library for auction (“leilão”) evaluation. There is no UI or web layer. Its purpose is to model auctions, bids (“Lance”), users, and provide a service that determines winning bids.

##### File structure
- Top-level files:
- composer.json / composer.lock – project dependencies & autoloading
- .gitignore
- teste-avaliador.php – example script showing how to run the evaluation
- src/Model – contains domain entities:
- Usuario.php (bidder)
- Leilao.php (auction)
- Lance.php (bid)
- src/Service – contains business logic:
- Avaliador.php (evaluates bids, finds highest, lowest, top-3 bids, etc.)
- tests/Service/AvaliadorTest.php – PHPUnit tests for Avaliador service

##### (empty) README
- No additional architecture notes. All insights come from code & structure.

## Diagram (Mermaid)

```mermaid
graph TB

    subgraph "Domain Model"
        LM["Leilao"]:::domain
        LN["Lance"]:::domain
        US["Usuario"]:::domain
    end

    subgraph "Service Layer"
        AV["Avaliador"]:::service
    end

    subgraph "Execution & Tests"
        CLI["teste-avaliador.php"]:::external
        TST["AvaliadorTest"]:::external
    end

    subgraph "Infrastructure"
        COMP["Composer (autoload)"]:::infra
        GIT[".gitignore"]:::infra
        RD["readme.md"]:::infra
    end

    CLI -->|"instantiates"| US
    CLI -->|"instantiates"| LM
    CLI -->|"instantiates"| LN
    CLI -->|"calls evaluate()"| AV

    AV -->|"uses"| LM
    AV -->|"uses"| LN
    AV -->|"uses"| US

    TST -->|"tests"| AV
    TST -->|"uses"| LM
    TST -->|"uses"| LN
    TST -->|"uses"| US

    COMP -->|"loads classes via PSR-4"| AV
    COMP -->|"loads classes via PSR-4"| LM
    COMP -->|"loads classes via PSR-4"| LN
    COMP -->|"loads classes via PSR-4"| US

    click LM "https://github.com/jandelson/tdd-php/blob/main/src/Model/Leilao.php"
    click LN "https://github.com/jandelson/tdd-php/blob/main/src/Model/Lance.php"
    click US "https://github.com/jandelson/tdd-php/blob/main/src/Model/Usuario.php"
    click AV "https://github.com/jandelson/tdd-php/blob/main/src/Service/Avaliador.php"
    click CLI "https://github.com/jandelson/tdd-php/blob/main/teste-avaliador.php"
    click TST "https://github.com/jandelson/tdd-php/blob/main/tests/Service/AvaliadorTest.php"
    click COMP "https://github.com/jandelson/tdd-php/blob/main/composer.json"
    click GIT "https://github.com/jandelson/tdd-php/blob/main/.gitignore"
    click RD "https://github.com/jandelson/tdd-php/blob/main/readme.md"

    classDef domain fill:#BBDEFB,stroke:#0D47A1,color:#0D47A1
    classDef service fill:#C8E6C9,stroke:#1B5E20,color:#1B5E20
    classDef external fill:#FFF9C4,stroke:#F57F17,color:#F57F17
    classDef infra fill:#E0E0E0,stroke:#424242,color:#424242
```
