# ananyapt2005/sofa-cost-estimation architecture

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

- Interactive diagram: https://gitdiagram.com/ananyapt2005/sofa-cost-estimation
- Repository: https://github.com/ananyapt2005/sofa-cost-estimation

## Overview

This repository combines sofa-request intake and image packaging with separate CAD and cost-estimation utilities. The sampled request workflow collects an image and dimensions, validates and packages them, and writes request metadata. Cost scripts analyze component quantities and calculate or update sofa costs; the Fusion script builds CAD bodies from a scaled-CSV input. The README is empty, and the available source does not establish a complete connection between request intake, scaling, CAD generation, and costing.

Main entry points: [`data/calculate_cost.py`](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/calculate_cost.py) (Cost calculation), [`data/update_cost.py`](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/update_cost.py) (Cost update), [`scripts/request_package.py`](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/request_package.py) (Request packaging), [`scripts/request_form.py`](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/request_form.py) (Request form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_request["Request intake"]
  node_request_form["Request form<br/>[request_form.py]"]
  node_request_package["Request packaging<br/>[request_package.py]"]
  node_request_files[("Request records")]
end

subgraph group_cad["CAD modeling"]
  node_scale_step["Seat transform<br/>[scale_step.py]"]
  node_fusion_builder["Fusion body builder"]
  node_scaled_csv["Scaled body input"]
end

subgraph group_cost["Cost estimation"]
  node_component_map[("Component quantities")]
  node_material_cost[("Material costs<br/>[material_cost.csv]")]
  node_component_analysis["Component analysis"]
  node_prepare_dataset["Dataset preparation<br/>[prepare_dataset.py]"]
  node_sofa_dataset[("Sofa cost dataset")]
  node_calculate_cost["Cost calculation<br/>[calculate_cost.py]"]
  node_update_cost["Cost update<br/>[update_cost.py]"]
  node_cost_output[("Component cost output")]
  node_train_check["Training readiness check"]
end

node_customer(("Requester"))

node_customer -->|"enters details"| node_request_form
node_request_package -->|"gets request"| node_request_form
node_request_form -->|"returns request"| node_request_package
node_request_package -->|"writes image and metadata"| node_request_files
node_scale_step -->|"transforms solid"| node_scale_step
node_fusion_builder -->|"reads body data"| node_scaled_csv
node_component_analysis -->|"reads quantities"| node_component_map
node_prepare_dataset -->|"reads quantities"| node_component_map
node_prepare_dataset -->|"writes dataset"| node_sofa_dataset
node_calculate_cost -->|"reads quantities"| node_component_map
node_calculate_cost -->|"reads prices"| node_material_cost
node_calculate_cost -->|"writes costs"| node_cost_output
node_update_cost -->|"reads prices"| node_material_cost
node_update_cost -->|"writes costs"| node_cost_output
node_update_cost -->|"updates total"| node_sofa_dataset
node_train_check -->|"reads records"| node_sofa_dataset

click node_request_form "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/request_form.py"
click node_request_package "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/request_package.py"
click node_request_files "https://github.com/ananyapt2005/sofa-cost-estimation/tree/main/outputs/requests"
click node_scale_step "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/scaling/scale_step.py"
click node_fusion_builder "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/fusion_scripts/fusion_build_sofa.py"
click node_component_map "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/fusion_scripts/fusion_component_map.csv"
click node_material_cost "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/fusion_scripts/material_cost.csv"
click node_component_analysis "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/component_analysis.py"
click node_prepare_dataset "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/prepare_dataset.py"
click node_sofa_dataset "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/sofa_cost_dataset.csv"
click node_calculate_cost "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/calculate_cost.py"
click node_update_cost "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/update_cost.py"
click node_cost_output "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/final_cost_output.csv"
click node_train_check "https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/train_cost_model.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_request_form,node_request_package,node_request_files toneBlue
class node_scale_step,node_fusion_builder,node_scaled_csv toneAmber
class node_component_map,node_material_cost,node_component_analysis,node_prepare_dataset,node_sofa_dataset,node_calculate_cost,node_update_cost,node_cost_output,node_train_check,node_customer toneMint
```

## Components

### Request intake

- [Request form](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/request_form.py): `scripts/request_form.py`
- [Request packaging](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/request_package.py): `scripts/request_package.py`
- [Request records](https://github.com/ananyapt2005/sofa-cost-estimation/tree/main/outputs/requests): `outputs/requests`

### CAD modeling

- [Seat transform](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/scaling/scale_step.py): `scripts/scaling/scale_step.py`
- [Fusion body builder](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/fusion_scripts/fusion_build_sofa.py): `scripts/fusion_scripts/fusion_build_sofa.py`
- **Scaled body input**

### Cost estimation

- [Component quantities](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/fusion_scripts/fusion_component_map.csv): `scripts/fusion_scripts/fusion_component_map.csv`
- [Material costs](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/scripts/fusion_scripts/material_cost.csv): `scripts/fusion_scripts/material_cost.csv`
- [Component analysis](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/component_analysis.py): `data/component_analysis.py`
- [Dataset preparation](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/prepare_dataset.py): `data/prepare_dataset.py`
- [Sofa cost dataset](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/sofa_cost_dataset.csv): `data/sofa_cost_dataset.csv`
- [Cost calculation](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/calculate_cost.py): `data/calculate_cost.py`
- [Cost update](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/update_cost.py): `data/update_cost.py`
- [Component cost output](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/final_cost_output.csv): `data/final_cost_output.csv`
- [Training readiness check](https://github.com/ananyapt2005/sofa-cost-estimation/blob/main/data/train_cost_model.py): `data/train_cost_model.py`

### Other components

- **Requester**

## Connections

- Requester → Request form: enters details
- Request packaging → Request form: gets request
- Request form → Request packaging: returns request
- Request packaging → Request records: writes image and metadata
- Seat transform → Seat transform: transforms solid
- Fusion body builder → Scaled body input: reads body data
- Component analysis → Component quantities: reads quantities
- Dataset preparation → Component quantities: reads quantities
- Dataset preparation → Sofa cost dataset: writes dataset
- Cost calculation → Component quantities: reads quantities
- Cost calculation → Material costs: reads prices
- Cost calculation → Component cost output: writes costs
- Cost update → Material costs: reads prices
- Cost update → Component cost output: writes costs
- Cost update → Sofa cost dataset: updates total
- Training readiness check → Sofa cost dataset: reads records
