# adiorany3/bbternak architecture

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

- Interactive diagram: https://gitdiagram.com/adiorany3/bbternak
- Repository: https://github.com/adiorany3/bbternak

## Overview

Sapi Weight Predictor is a Streamlit application for estimating livestock weight from chest girth and body length, then interpreting the estimate for target weight, carcass yield, and market decisions. The main workflow is measurement input → breed-specific calculation → results and business analysis → save or review records. The current app is a large monolithic source file; the graph separates its documented product stages without implying separate implementation modules. Earlier V2.1, V2.2, and V3 applications are represented as independent historical implementations. Some README features are documented but their internal call structure was not sampled.

Main entry points: [`sapi_weight_predictor.py`](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Input and results"]
  node_main_app["Streamlit app"]
  node_measurements["Animal measurements"]
end

subgraph group_estimation["Weight estimation"]
  node_weight_calc["Weight estimate"]
  node_breed_profiles["Breed profiles"]
  node_accuracy["Accuracy and BCS"]
end

subgraph group_analysis["Business analysis"]
  node_targets["Weight targets"]
  node_carcass["Carcass yield"]
  node_economics["Economic analysis"]
  node_butcher["Butcher analysis"]
  node_trader["Trader analysis"]
  node_insights["Insights"]
  node_ai_prompt["AI prompt generator"]
  node_visualizations["Charts and comparisons"]
end

subgraph group_archive["Reports and archive"]
  node_history_downloads["History and downloads"]
  node_bulk_mode["Multiple-animal mode"]
  node_pdf_reports["PDF and CSV reports"]
end

subgraph group_history["Earlier versions"]
  node_v21["V2.1 app"]
  node_v22["V2.2 app"]
  node_v3["V3 app<br/>[app.py]"]
end

node_farmer(("Livestock user"))

node_farmer -->|"enters measurements"| node_main_app
node_main_app -->|"collects input"| node_measurements
node_main_app -->|"calculates weight"| node_weight_calc
node_main_app -->|"calculates yield"| node_carcass
node_main_app -->|"shows target analysis"| node_targets
node_main_app -->|"shows economic analysis"| node_economics
node_main_app -->|"shows butcher analysis"| node_butcher
node_main_app -->|"shows trader analysis"| node_trader
node_main_app -->|"shows insights"| node_insights
node_main_app -->|"generates prompts"| node_ai_prompt
node_main_app -->|"shows comparisons"| node_visualizations
node_main_app -->|"provides archive"| node_history_downloads
node_main_app -->|"provides batch mode"| node_bulk_mode
node_main_app -->|"offers report downloads"| node_pdf_reports
node_weight_calc -->|"uses breed factors"| node_breed_profiles
node_main_app -->|"displays caveats"| node_accuracy

click node_main_app "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_measurements "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_weight_calc "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_breed_profiles "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_accuracy "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_targets "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_carcass "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_economics "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_butcher "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_trader "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_insights "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_ai_prompt "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_visualizations "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_history_downloads "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_bulk_mode "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_pdf_reports "https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py"
click node_v21 "https://github.com/adiorany3/bbternak/blob/main/version/V2.1/sapi_weight_predictor.py"
click node_v22 "https://github.com/adiorany3/bbternak/blob/main/version/V2.2/sapi_weight_predictor.py"
click node_v3 "https://github.com/adiorany3/bbternak/blob/main/version/V3/app.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_main_app,node_measurements,node_farmer toneBlue
class node_weight_calc,node_breed_profiles,node_accuracy toneAmber
class node_targets,node_carcass,node_economics,node_butcher,node_trader,node_insights,node_ai_prompt,node_visualizations toneMint
class node_history_downloads,node_bulk_mode,node_pdf_reports toneRose
class node_v21,node_v22,node_v3 toneIndigo
```

## Components

### Input and results

- [Streamlit app](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [Animal measurements](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`

### Weight estimation

- [Weight estimate](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [Breed profiles](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [Accuracy and BCS](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`

### Business analysis

- [Weight targets](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [Carcass yield](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [Economic analysis](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [Butcher analysis](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [Trader analysis](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [Insights](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [AI prompt generator](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [Charts and comparisons](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`

### Reports and archive

- [History and downloads](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [Multiple-animal mode](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`
- [PDF and CSV reports](https://github.com/adiorany3/bbternak/blob/main/sapi_weight_predictor.py): `sapi_weight_predictor.py`

### Earlier versions

- [V2.1 app](https://github.com/adiorany3/bbternak/blob/main/version/V2.1/sapi_weight_predictor.py): `version/V2.1/sapi_weight_predictor.py`
- [V2.2 app](https://github.com/adiorany3/bbternak/blob/main/version/V2.2/sapi_weight_predictor.py): `version/V2.2/sapi_weight_predictor.py`
- [V3 app](https://github.com/adiorany3/bbternak/blob/main/version/V3/app.py): `version/V3/app.py`

### Other components

- **Livestock user**

## Connections

- Livestock user → Streamlit app: enters measurements (evidence: `README.md`)
- Streamlit app → Animal measurements: collects input (evidence: `README.md`)
- Streamlit app → Weight estimate: calculates weight (evidence: `sapi_weight_predictor.py`)
- Streamlit app → Carcass yield: calculates yield (evidence: `sapi_weight_predictor.py`)
- Streamlit app → Weight targets: shows target analysis (evidence: `README.md`)
- Streamlit app → Economic analysis: shows economic analysis (evidence: `README.md`)
- Streamlit app → Butcher analysis: shows butcher analysis (evidence: `README.md`)
- Streamlit app → Trader analysis: shows trader analysis (evidence: `README.md`)
- Streamlit app → Insights: shows insights (evidence: `README.md`)
- Streamlit app → AI prompt generator: generates prompts (evidence: `sapi_weight_predictor.py`)
- Streamlit app → Charts and comparisons: shows comparisons (evidence: `sapi_weight_predictor.py`)
- Streamlit app → History and downloads: provides archive (evidence: `README.md`)
- Streamlit app → Multiple-animal mode: provides batch mode (evidence: `README.md`)
- Streamlit app → PDF and CSV reports: offers report downloads (evidence: `README.md`)
- Weight estimate → Breed profiles: uses breed factors (evidence: `sapi_weight_predictor.py`)
- Streamlit app → Accuracy and BCS: displays caveats (evidence: `sapi_weight_predictor.py`)
