# jmich7/controle-de-abastecimento architecture

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

- Interactive diagram: https://gitdiagram.com/jmich7/controle-de-abastecimento
- Repository: https://github.com/jmich7/controle-de-abastecimento

## Overview

This is a command-line fuel-refueling tracker. The user selects actions from a menu to register, list, search, edit, or delete refueling records; reporting features calculate fuel consumption and spending, and produce charts. The single Python file contains the menu, domain operations, file persistence, and error logging. The tree and excerpts show records stored in a text file and errors appended to another. Some report and menu code is omitted, so their internal call relationships are not asserted.

Main entry points: [`main.py`](https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py) (Record operations), [`abastecimentos.txt`](https://github.com/jmich7/controle-de-abastecimento/blob/main/abastecimentos.txt) (Refueling file), [`erros.txt`](https://github.com/jmich7/controle-de-abastecimento/blob/main/erros.txt) (Error log)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["CLI interaction"]
  node_menu["Menu and dispatch<br/>[main.py]"]
  node_error_logger["Error logging<br/>[main.py]"]
  node_error_file["Error log<br/>[erros.txt]"]
end

subgraph group_records["Refueling records"]
  node_crud["Record operations<br/>[main.py]"]
  node_storage[("Refueling file<br/>[abastecimentos.txt]")]
end

subgraph group_reports["Reports and charts"]
  node_analytics["Consumption and spending<br/>[main.py]"]
  node_charts["Charts<br/>[main.py]"]
end

node_user(("Terminal user"))
node_matplotlib["Matplotlib"]

node_user -->|"chooses action"| node_menu
node_menu -->|"dispatches CRUD"| node_crud
node_crud -->|"reads and writes"| node_storage
node_crud -->|"logs failures"| node_error_logger
node_error_logger -->|"appends errors"| node_error_file
node_analytics -->|"loads records"| node_storage
node_charts -->|"renders charts"| node_matplotlib

click node_menu "https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py"
click node_crud "https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py"
click node_storage "https://github.com/jmich7/controle-de-abastecimento/blob/main/abastecimentos.txt"
click node_error_logger "https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py"
click node_error_file "https://github.com/jmich7/controle-de-abastecimento/blob/main/erros.txt"
click node_analytics "https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py"
click node_charts "https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py"

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_menu,node_error_logger,node_error_file,node_user toneBlue
class node_crud,node_storage toneAmber
class node_analytics,node_charts toneMint
class node_matplotlib toneIndigo
```

## Components

### CLI interaction

- [Menu and dispatch](https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py): `main.py`
- [Error logging](https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py): `main.py`
- [Error log](https://github.com/jmich7/controle-de-abastecimento/blob/main/erros.txt): `erros.txt`

### Refueling records

- [Record operations](https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py): `main.py`
- [Refueling file](https://github.com/jmich7/controle-de-abastecimento/blob/main/abastecimentos.txt): `abastecimentos.txt`

### Reports and charts

- [Consumption and spending](https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py): `main.py`
- [Charts](https://github.com/jmich7/controle-de-abastecimento/blob/main/main.py): `main.py`

### Other components

- **Terminal user**
- **Matplotlib**

## Connections

- Terminal user → Menu and dispatch: chooses action (evidence: `main.py`)
- Menu and dispatch → Record operations: dispatches CRUD (evidence: `main.py`)
- Record operations → Refueling file: reads and writes (evidence: `main.py`)
- Record operations → Error logging: logs failures (evidence: `main.py`)
- Error logging → Error log: appends errors (evidence: `main.py`)
- Consumption and spending → Refueling file: loads records (evidence: `main.py`)
- Charts → Matplotlib: renders charts (evidence: `main.py`)
