How thabadcode/propostacomerciav2 works
Proposta Comercial V2 is a static React application for preparing asphalt-supply and related-services proposals. The user enters customer and proposal details, adds and manages priced products, reviews the formatted A4 proposal, then prints it or saves it as PDF. Separate supporting capabilities include CNPJ lookup, browser draft recovery, and JSON import/export. The graph follows the sampled App orchestration and documented product features; some supporting modules were not excerpted, so uncertain links are omitted or marked unverified.
Main entry points: App.tsx Application orchestration · Preview.tsx A4 proposal preview · useMainForm.ts Proposal form state · MainForm.tsx Proposal details form
Components 25
Proposal authoring
- Application orchestration
src/App.tsx - Proposal details form
src/components/Forms/MainForm.tsx - Product editor
src/components/Forms/ProductForm.tsx - Header actions
src/components/Header/Header.tsx - Responsive product list
src/components/ProductCard/ProductCard.tsx - Product table
src/components/ui/Table/Table.tsx
Form and product state
- Proposal form state
src/core/hooks/useMainForm.ts - Validated form fields
src/core/hooks/useFormField.ts - Product form state
src/core/hooks/useProductForm.ts - Product collection and totals
src/core/hooks/useProducts.ts - Business validation rules
src/core/utils/rules.ts - Form options
src/core/constants/formOptions.ts - Proposal formatting
src/core/utils/formatter.ts
Proposal output
- A4 proposal preview
src/components/Preview/Preview.tsx - Preview pan and zoom
src/core/hooks/usePanZoom.ts - Browser print dialog
- Supplier information
src/core/constants/providerInfo.ts
Drafts and integrations
- Snapshot validation and storage
src/core/utils/snapshot.ts - Debounced draft saving
src/core/hooks/useAutoSave.ts - Browser localStorage
- JSON import and export
src/core/utils/exportImport.ts - CNPJ lookup
src/core/utils/searchCnpj.ts - BrasilAPI
- PWA service worker
public/sw.js
Other components
- Proposal author
Connections 35
- Proposal author → Application orchestration: uses
README.md - Application orchestration → Proposal details form: renders
src/App.tsx - Application orchestration → Product editor: renders
src/App.tsx - Application orchestration → Header actions: renders
src/App.tsx - Application orchestration → Proposal form state: initializes
src/App.tsx - Application orchestration → Product form state: initializes
src/App.tsx - Application orchestration → Product collection and totals: initializes
src/App.tsx - Proposal details form → Proposal form state: edits
src/components/Forms/MainForm.tsx - Product editor → Product form state: edits
src/components/Forms/ProductForm.tsx - Proposal form state → Validated form fields: builds fields
src/core/hooks/useMainForm.ts - Product form state → Validated form fields: builds fields
src/core/hooks/useProductForm.ts - Proposal form state → Business validation rules: validates with
src/core/hooks/useMainForm.ts - Product form state → Business validation rules: validates with
src/core/hooks/useProductForm.ts - Proposal details form → Form options: uses options
src/components/Forms/MainForm.tsx - Proposal details form → CNPJ lookup: looks up CNPJ
src/components/Forms/MainForm.tsx - CNPJ lookup → BrasilAPI: queries
src/core/utils/searchCnpj.ts - Application orchestration → Product table: renders on desktop
src/App.tsx - Application orchestration → Responsive product list: renders on mobile
src/App.tsx - Product table → Product collection and totals: reads and manages
src/components/ui/Table/Table.tsx - Responsive product list → Product collection and totals: reads and manages
src/components/ProductCard/ProductCard.tsx - Application orchestration → A4 proposal preview: renders
src/App.tsx - A4 proposal preview → Proposal form state: reads proposal data
src/components/Preview/Preview.tsx - A4 proposal preview → Product collection and totals: reads product data
src/components/Preview/Preview.tsx - A4 proposal preview → Proposal formatting: formats display
src/components/Preview/Preview.tsx - A4 proposal preview → Supplier information: displays supplier data
src/components/Preview/Preview.tsx - A4 proposal preview → Preview pan and zoom: controls viewport
src/components/Preview/Preview.tsx - Application orchestration → Browser print dialog: opens for printing
src/App.tsx - Application orchestration → Snapshot validation and storage: loads draft
src/App.tsx - Application orchestration → Debounced draft saving: starts autosave
src/App.tsx - Debounced draft saving → Snapshot validation and storage: saves snapshot
src/core/hooks/useAutoSave.ts - Snapshot validation and storage → Browser localStorage: reads and writes
src/core/utils/snapshot.ts - Header actions → Application orchestration: triggers actions
src/App.tsx - Application orchestration → JSON import and export: handles JSON actions
src/App.tsx - JSON import and export → Snapshot validation and storage: validates snapshot
src/core/utils/exportImport.ts - Application orchestration → PWA service worker: enables PWA
README.md