How ekennabiz/estimator-app works
1. This is a client-side React application built with Vite. There is no visible backend, API layer, or database in the repo, so the architecture is primarily a single-page UI that manages estimating and proposal data in memory and renders derived views from that state.
2. The root app composition lives in src/App.jsx, with src/main.jsx as the entry point. App likely owns the top-level state and orchestrates the major regions of the screen: navigation/chrome, the estimate editor, AI assistance, analytics, and proposal preview.
3. The UI is organized into small feature components under src/components, which suggests a modular form-based workflow rather than a page-per-route app. The major user-facing sections are:
- project metadata: ProjectInfo
- estimate inputs: LaborSection, MaterialsSection, EquipmentSection, DeliverySection, ChargesSection
- settings and controls: SettingsSection, Tabs, Sidebar, Topbar, ThemeToggle
- summary and outputs: SummarySection, StatsBar, AnalyticsChart, ProposalPreview, EstimateHistory
- AI features: AiPanel, AiProposal, Notification
4. The estimate itself appears to be structured as several cost domains, each likely capturing line items and totals. Those sections feed a shared calculation layer rather than acting independently. src/utils/calculations.js is the central boundary for turning raw user-entered values into totals, margins, subtotals, and other derived financial figures.
5. Presentation formatting is separated from computation. src/utils/formatters.js likely standardizes currency, percentages, dates, and similar display concerns so that charts, summary cards, history, and proposal output remain consistent even though they consume the same underlying estimate state.
6. There is a dedicated AI subsystem, but it appears to be local/embedded logic rather than a networked integration. src/utils/aiEngine.js and src/utils/aiSuggestions.js imply rule-based or heuristic generation of recommendations and proposal text, which the AiPanel and AiProposal components surface to the user. This makes AI a feature boundary on top of the estimate state, not a separate service.
7. Templates are stored in src/data/templates.js, indicating the app can preload or switch between predefined estimate/proposal shapes. That makes templates a seed/input layer for the editor, likely influencing defaults in the project info, section contents, and proposal preview.
8. The output side of the app is more than a simple form summary. ProposalPreview, AnalyticsChart, StatsBar, and SummarySection indicate the same estimate data is transformed into multiple views: a human-readable proposal, numeric dashboards, and trend/visual analytics. These are all downstream consumers of the same core state and calculations.
9. The layout and interaction chrome are handled by reusable shell components such as Header, Topbar, Sidebar, Tabs, CollapsibleSection, and ThemeToggle. This suggests the app is designed as a dense workspace with section switching and collapsible panels rather than a linear wizard.
10. EstimateHistory indicates the app tracks previous estimates or revisions within the client experience. Since no persistence layer is visible, this is likely local/session state or browser storage, meaning history is a UI concern attached to the same app state rather than a separate service.
11. Styling is centralized in src/styles.css, with Vite and ESLint providing the build/dev and code-quality tooling. There are no signs of server rendering, routing infrastructure, or external state-management libraries, so the architecture is intentionally lightweight and front-end only.
12. For an architecture diagram, the key flow is: user edits project and cost sections -> shared estimate state updates -> calculation utilities derive totals and metrics -> formatting utilities prepare display values -> output components render summary, analytics, proposal, and history -> AI utilities generate suggestions/proposal assistance from the same state. The important boundary is between raw editable inputs and derived presentation/AI outputs.
Main entry points: App.jsx App · calculations.js Calculations · aiEngine.js AI engine · ProjectInfo.jsx Project info
Components 28
App shell
Entry point and shared chrome for the single-page workspace.
- main · Vite entry that mounts the React app.
src/main.jsx - App · Top-level state and screen composition.
src/App.jsx - Header · Main workspace header.
src/components/Header.jsx - Topbar · Primary controls and navigation bar.
src/components/Topbar.jsx - Sidebar · Secondary navigation and workspace controls.
src/components/Sidebar.jsx - Tabs · Section switching for the dense editor.
src/components/Tabs.jsx - Theme · Theme switching control.
src/components/ThemeToggle.jsx - Collapsible · Reusable expandable section wrapper.
src/components/CollapsibleSection.jsx - Notification · Transient user feedback messages.
src/components/Notification.jsx
Estimate editor
User-editable project and cost sections.
- Project info · Project metadata inputs.
src/components/ProjectInfo.jsx - Labor · Labor line items and totals.
src/components/LaborSection.jsx - Materials · Materials line items and totals.
src/components/MaterialsSection.jsx - Equipment · Equipment line items and totals.
src/components/EquipmentSection.jsx - Delivery · Delivery and logistics costs.
src/components/DeliverySection.jsx - Charges · Fees, charges, and adjustments.
src/components/ChargesSection.jsx - Settings · Estimate and proposal configuration.
src/components/SettingsSection.jsx
Outputs
Derived views rendered from the shared estimate state.
- Summary · High-level estimate summary.
src/components/SummarySection.jsx - Stats bar · Compact KPI display.
src/components/StatsBar.jsx - Analytics · Visual analytics of the estimate.
src/components/AnalyticsChart.jsx - Proposal · Human-readable proposal preview.
src/components/ProposalPreview.jsx - History · Past estimates or revisions within the client UI.
src/components/EstimateHistory.jsx
AI assist
Local suggestion and proposal generation features.
- AI panel · Surface for generated suggestions and guidance.
src/components/AiPanel.jsx - AI proposal · Generated proposal text or phrasing assistance.
src/components/AiProposal.jsx - AI engine · Local recommendation and proposal generation logic.
src/utils/aiEngine.js - Suggestions · Prompt and suggestion rules for the AI layer.
src/utils/aiSuggestions.js
Core logic
Computation, formatting, and seeded template data.
- Calculations · Derives totals, margins, subtotals, and other metrics.
src/utils/calculations.js - Formatters · Currency, percentage, and date formatting.
src/utils/formatters.js - Templates · Predefined estimate and proposal templates.
src/data/templates.js
Connections 40
- main → App: mounts · Entry point renders the root application.
- App → Header: composes · App includes shared header chrome.
- App → Topbar: composes · App includes the top-level control bar.
- App → Sidebar: composes · App includes sidebar workspace navigation.
- App → Tabs: switches · App coordinates the active editor section.
- App → Theme: controls · Theme is managed from the shell.
- App → Project info: hosts · Project metadata feeds the shared estimate state.
- App → Labor: hosts · Labor inputs are edited in the main workspace.
- App → Materials: hosts · Materials inputs are edited in the main workspace.
- App → Equipment: hosts · Equipment inputs are edited in the main workspace.
- App → Delivery: hosts · Delivery inputs are edited in the main workspace.
- App → Charges: hosts · Charges inputs are edited in the main workspace.
- App → Settings: hosts · Settings influence estimate behavior and outputs.
- App → Summary: renders · App shows summary from derived estimate state.
- App → Stats bar: renders · App shows compact metrics from the estimate.
- App → Analytics: renders · App shows analytics derived from the estimate.
- App → Proposal: renders · App shows proposal output from shared state.
- App → History: renders · App shows prior estimates or revisions.
- App → AI panel: surfaces · App exposes AI assistance controls.
- App → AI proposal: surfaces · App exposes generated proposal text.
- App → Notification: notifies · App displays transient feedback messages.
- App → Collapsible: uses · Workspace sections can collapse and expand.
- Labor → Calculations: feeds · Cost sections contribute raw values into calculations.
- Materials → Calculations: feeds · Cost sections contribute raw values into calculations.
- Equipment → Calculations: feeds · Cost sections contribute raw values into calculations.
- Delivery → Calculations: feeds · Cost sections contribute raw values into calculations.
- Charges → Calculations: feeds · Cost sections contribute raw values into calculations.
- Project info → Templates: seeds · Templates provide starting project and proposal shapes.
- Settings → Templates: selects · Settings can apply predefined templates.
- Calculations → Formatters: uses · Computed values are formatted for display.
- Calculations → Summary: drives · Summary displays derived totals and margins.
- Calculations → Stats bar: drives · Stats bar presents computed KPIs.
- Calculations → Analytics: drives · Analytics chart visualizes calculated data.
- Calculations → Proposal: drives · Proposal content is based on calculated estimate values.
- Calculations → History: populates · History records prior calculated snapshots.
- AI panel → AI engine: invokes · AI panel requests recommendations from local logic.
- AI proposal → AI engine: generates · Proposal assistance is produced by the AI logic.
- AI engine → Suggestions: uses · AI logic relies on rule or prompt suggestions.
- AI engine → Calculations: consumes · AI features read the current estimate state and metrics.
- AI engine → Formatters: formats · AI output is prepared for presentation.