# otthonleao/python-cotacao-frete-api architecture

> Architecture diagram of the GitHub repository otthonleao/python-cotacao-frete-api, 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/otthonleao/python-cotacao-frete-api
- Repository: https://github.com/otthonleao/python-cotacao-frete-api

## Overview

This repository implements a small FastAPI shipping-quote endpoint: a site submits product dimensions and weight, the endpoint passes the product to two carrier-specific validators, and returns the eligible quote dictionaries. The validators hold carrier parameters and calculate shipping prices. The README describes the intended carrier limits, prices, and delivery times; the sampled root modules implement the quote path. The separate shippingPriceAPI package is a skeletal app scaffold with no demonstrated connection to that path, so it is omitted. Source evidence is limited to the excerpts and README provided.

Main entry points: [`main.py`](https://github.com/otthonleao/python-cotacao-frete-api/blob/main/main.py) (Shipping Endpoint), [`inputProduct.py`](https://github.com/otthonleao/python-cotacao-frete-api/blob/main/inputProduct.py) (Product Payload), [`alternativeShipping.py`](https://github.com/otthonleao/python-cotacao-frete-api/blob/main/alternativeShipping.py) (Ninja Quote), [`customShipping.py`](https://github.com/otthonleao/python-cotacao-frete-api/blob/main/customShipping.py) (Standard Quote)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Quote API"]
  node_endpoint["Shipping Endpoint<br/>[main.py]"]
end

subgraph group_contract["Product Input"]
  node_product["Product Payload<br/>[inputProduct.py]"]
end

subgraph group_carriers["Carrier Rules"]
  node_ninja["Ninja Quote"]
  node_standard["Standard Quote<br/>[customShipping.py]"]
end

node_site(("KaBuM Site"))

node_site -->|"posts product"| node_endpoint
node_endpoint -->|"parses payload"| node_product
node_endpoint -->|"validates and quotes"| node_ninja
node_endpoint -->|"validates and quotes"| node_standard
node_ninja -->|"reads fields"| node_product
node_standard -->|"reads fields"| node_product
node_endpoint -->|"returns eligible quotes"| node_site

click node_endpoint "https://github.com/otthonleao/python-cotacao-frete-api/blob/main/main.py"
click node_product "https://github.com/otthonleao/python-cotacao-frete-api/blob/main/inputProduct.py"
click node_ninja "https://github.com/otthonleao/python-cotacao-frete-api/blob/main/alternativeShipping.py"
click node_standard "https://github.com/otthonleao/python-cotacao-frete-api/blob/main/customShipping.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_endpoint toneBlue
class node_product toneAmber
class node_ninja,node_standard toneMint
class node_site toneIndigo
```

## Components

### Quote API

- [Shipping Endpoint](https://github.com/otthonleao/python-cotacao-frete-api/blob/main/main.py): `main.py`

### Product Input

- [Product Payload](https://github.com/otthonleao/python-cotacao-frete-api/blob/main/inputProduct.py): `inputProduct.py`

### Carrier Rules

- [Ninja Quote](https://github.com/otthonleao/python-cotacao-frete-api/blob/main/alternativeShipping.py): `alternativeShipping.py`
- [Standard Quote](https://github.com/otthonleao/python-cotacao-frete-api/blob/main/customShipping.py): `customShipping.py`

### Other components

- **KaBuM Site**

## Connections

- KaBuM Site → Shipping Endpoint: posts product (evidence: `README.md`)
- Shipping Endpoint → Product Payload: parses payload (evidence: `main.py`)
- Shipping Endpoint → Ninja Quote: validates and quotes (evidence: `main.py`)
- Shipping Endpoint → Standard Quote: validates and quotes (evidence: `main.py`)
- Ninja Quote → Product Payload: reads fields (evidence: `alternativeShipping.py`)
- Standard Quote → Product Payload: reads fields (evidence: `customShipping.py`)
- Shipping Endpoint → KaBuM Site: returns eligible quotes (evidence: `main.py`)
