# jeanluis-dev/app-barato architecture

> Architecture diagram of the GitHub repository jeanluis-dev/app-barato, 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/jeanluis-dev/app-barato
- Repository: https://github.com/jeanluis-dev/app-barato

## Overview

App Barato is a browser-based price and quantity comparison app. The main user workflow is to enter product options, calculate comparable unit prices and savings, then optionally share or save the result for later review. Separate branches cover first-use onboarding and app information/support. The sampled App code shows it orchestrating these features; storage and browser-sharing behavior are visible in their helpers. Other implementation details were not sampled, so the graph avoids inferring additional calls.

Main entry points: [`src/App.tsx`](https://github.com/jeanluis-dev/app-barato/blob/main/src/App.tsx) (App controller), [`src/features/sharing/share.ts`](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/sharing/share.ts) (Share helper), [`src/features/about/AboutView.tsx`](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/about/AboutView.tsx) (About view), [`src/features/support/PixSupportAction.tsx`](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/support/PixSupportAction.tsx) (Pix support action)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["App controller<br/>[App.tsx]"]
  node_layout["App layout<br/>[AppLayout.tsx]"]
end

subgraph group_comparison["Price Comparison"]
  node_product_form["Product form<br/>[ProductForm.tsx]"]
  node_comparison_logic["Comparison engine<br/>[comparison.ts]"]
end

subgraph group_history["Saved Comparisons"]
  node_history_view["History view<br/>[HistoryView.tsx]"]
  node_history_storage["History storage<br/>[historyStorage.ts]"]
  node_browser_storage[("Browser local storage")]
end

subgraph group_engagement["Onboarding and Sharing"]
  node_welcome["Welcome view<br/>[WelcomeView.tsx]"]
  node_onboarding_storage["Onboarding storage"]
  node_sharing["Share helper<br/>[share.ts]"]
  node_share_apis["Share and clipboard APIs"]
end

subgraph group_info["App Information"]
  node_about["About view<br/>[AboutView.tsx]"]
  node_app_info["App information<br/>[appInfo.ts]"]
  node_pix_action["Pix support action"]
  node_pix_copy["Pix copy helper<br/>[copyPix.ts]"]
end

node_user(("App user"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_layout
node_app -->|"renders"| node_product_form
node_app -->|"calculates with"| node_comparison_logic
node_app -->|"renders"| node_history_view
node_app -->|"loads and saves"| node_history_storage
node_history_storage -->|"reads and writes"| node_browser_storage
node_app -->|"renders"| node_welcome
node_app -->|"checks and marks"| node_onboarding_storage
node_app -->|"shares text"| node_sharing
node_sharing -->|"parses values"| node_comparison_logic
node_sharing -->|"uses app URL"| node_app_info
node_sharing -->|"uses browser APIs"| node_share_apis
node_app -->|"renders"| node_about
node_about -->|"displays details"| node_app_info
node_about -->|"renders"| node_pix_action
node_pix_action -->|"uses Pix key"| node_app_info
node_pix_action -->|"copies key"| node_pix_copy

click node_entry "https://github.com/jeanluis-dev/app-barato/blob/main/src/main.tsx"
click node_app "https://github.com/jeanluis-dev/app-barato/blob/main/src/App.tsx"
click node_layout "https://github.com/jeanluis-dev/app-barato/blob/main/src/layouts/AppLayout.tsx"
click node_product_form "https://github.com/jeanluis-dev/app-barato/blob/main/src/features/comparison/ProductForm.tsx"
click node_comparison_logic "https://github.com/jeanluis-dev/app-barato/blob/main/src/features/comparison/comparison.ts"
click node_history_view "https://github.com/jeanluis-dev/app-barato/blob/main/src/features/history/HistoryView.tsx"
click node_history_storage "https://github.com/jeanluis-dev/app-barato/blob/main/src/features/history/historyStorage.ts"
click node_welcome "https://github.com/jeanluis-dev/app-barato/blob/main/src/features/onboarding/WelcomeView.tsx"
click node_onboarding_storage "https://github.com/jeanluis-dev/app-barato/blob/main/src/features/onboarding/onboardingStorage.ts"
click node_sharing "https://github.com/jeanluis-dev/app-barato/blob/main/src/features/sharing/share.ts"
click node_about "https://github.com/jeanluis-dev/app-barato/blob/main/src/features/about/AboutView.tsx"
click node_app_info "https://github.com/jeanluis-dev/app-barato/blob/main/src/config/appInfo.ts"
click node_pix_action "https://github.com/jeanluis-dev/app-barato/blob/main/src/features/support/PixSupportAction.tsx"
click node_pix_copy "https://github.com/jeanluis-dev/app-barato/blob/main/src/features/support/copyPix.ts"

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_entry,node_app,node_layout,node_user toneBlue
class node_product_form,node_comparison_logic toneAmber
class node_history_view,node_history_storage,node_browser_storage toneMint
class node_welcome,node_onboarding_storage,node_sharing,node_share_apis toneRose
class node_about,node_app_info,node_pix_action,node_pix_copy toneIndigo
```

## Components

### App Shell

- [React entry](https://github.com/jeanluis-dev/app-barato/blob/main/src/main.tsx): `src/main.tsx`
- [App controller](https://github.com/jeanluis-dev/app-barato/blob/main/src/App.tsx): `src/App.tsx`
- [App layout](https://github.com/jeanluis-dev/app-barato/blob/main/src/layouts/AppLayout.tsx): `src/layouts/AppLayout.tsx`

### Price Comparison

- [Product form](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/comparison/ProductForm.tsx): `src/features/comparison/ProductForm.tsx`
- [Comparison engine](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/comparison/comparison.ts): `src/features/comparison/comparison.ts`

### Saved Comparisons

- [History view](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/history/HistoryView.tsx): `src/features/history/HistoryView.tsx`
- [History storage](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/history/historyStorage.ts): `src/features/history/historyStorage.ts`
- **Browser local storage**

### Onboarding and Sharing

- [Welcome view](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/onboarding/WelcomeView.tsx): `src/features/onboarding/WelcomeView.tsx`
- [Onboarding storage](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/onboarding/onboardingStorage.ts): `src/features/onboarding/onboardingStorage.ts`
- [Share helper](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/sharing/share.ts): `src/features/sharing/share.ts`
- **Share and clipboard APIs**

### App Information

- [About view](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/about/AboutView.tsx): `src/features/about/AboutView.tsx`
- [App information](https://github.com/jeanluis-dev/app-barato/blob/main/src/config/appInfo.ts): `src/config/appInfo.ts`
- [Pix support action](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/support/PixSupportAction.tsx): `src/features/support/PixSupportAction.tsx`
- [Pix copy helper](https://github.com/jeanluis-dev/app-barato/blob/main/src/features/support/copyPix.ts): `src/features/support/copyPix.ts`

### Other components

- **App user**

## Connections

- App user → React entry: opens app
- React entry → App controller: renders (evidence: `src/main.tsx`)
- App controller → App layout: renders (evidence: `src/App.tsx`)
- App controller → Product form: renders (evidence: `src/App.tsx`)
- App controller → Comparison engine: calculates with (evidence: `src/App.tsx`)
- App controller → History view: renders (evidence: `src/App.tsx`)
- App controller → History storage: loads and saves (evidence: `src/App.tsx`)
- History storage → Browser local storage: reads and writes (evidence: `src/features/history/historyStorage.ts`)
- App controller → Welcome view: renders (evidence: `src/App.tsx`)
- App controller → Onboarding storage: checks and marks (evidence: `src/App.tsx`)
- App controller → Share helper: shares text (evidence: `src/App.tsx`)
- Share helper → Comparison engine: parses values (evidence: `src/features/sharing/share.ts`)
- Share helper → App information: uses app URL (evidence: `src/features/sharing/share.ts`)
- Share helper → Share and clipboard APIs: uses browser APIs (evidence: `src/features/sharing/share.ts`)
- App controller → About view: renders (evidence: `src/App.tsx`)
- About view → App information: displays details (evidence: `src/features/about/AboutView.tsx`)
- About view → Pix support action: renders (evidence: `src/features/about/AboutView.tsx`)
- Pix support action → App information: uses Pix key (evidence: `src/features/support/PixSupportAction.tsx`)
- Pix support action → Pix copy helper: copies key (evidence: `src/features/support/PixSupportAction.tsx`)
