Project scope
A static, interactive cost-modeling dashboard with four tabs: Overview, Expense Explorer, Cost Comparisons and Scenario Planner. Includes optional payroll and warehousing modules, client-side persistence, editable overrides, 3D-style SVG visualizations and a transparent methodology dialog.
System architecture
Version-controlled source CSVs and documented model assumptions → Python ETL (`etl_pipeline.py`) → relational SQLite reference tables (`schema.sql`) → SQL analytical inspection (`cost_analysis.sql`) → validated JSON export (`reference.json`) → browser JavaScript calculation engine (`app.js`) → responsive HTML/CSS and static Cloudflare Pages deployment. The deployed demo does not run Python or SQLite in the browser; those tools prepare its reference data.
Data ingestion and provenance
The ETL ingests and validates 51 state/DC 2025 commercial electricity price observations transcribed from a secondary EIA-derived table, converting cents/kWh into USD/kWh for the client-side model. Additional versioned CSVs define industry-specific property/insurance adjustments, regional ownership cost factors, cost sensitivity multipliers and nine warehousing model factors. The provenance manifest distinguishes observed state-level electricity prices from illustrative assumptions.
Relational modeling and SQL
SQLite stores reference datasets including state electricity prices, industry operating-model factors, regional owner-cost factors, cost sensitivity bands and warehouse assumptions. SQL supports inspection, joins and reconciliation. Python exports a compact, versioned JSON artifact; validation checks uniqueness, expected row counts, bounds and agreement between SQLite and JSON.
Electricity and facility formulas
Monthly electricity = square footage × modeled annual kWh per square foot × state commercial USD/kWh ÷ 12. Leased property uses modeled monthly rent per square foot with industry adjustment. Owned property uses modeled property tax, building insurance and maintenance reserve components, excluding mortgage debt service. Home-based incremental property cost defaults to zero; utility estimates still require business-only adjustment.
Payroll and warehouse formulas
Average-salary mode: monthly base payroll = annual average salary × employee count ÷ 12. Total-payroll mode: monthly base payroll = entered annual payroll ÷ 12. An optional employer-burden multiplier applies only when selected. In-house warehousing sums additional facility, labor, equipment and inventory carrying costs; 3PL sums pallet storage, order fulfillment, receiving and applicable inventory carrying allowances. Hybrid mode combines both. A warehouse-labor inclusion flag removes duplicated modeled warehouse labor when the payroll input already includes it.
Interactive analytical calculations
Monthly total is the sum of enabled, scenario-adjusted expense categories, honoring user actual overrides. Annual total = unrounded monthly total × 12. Monthly operating cost per employee = monthly total ÷ scenario-adjusted headcount. Annual operating cost per square foot = annual total ÷ entered area. Scenario impact = scenario total minus baseline total. Low/high planning envelopes apply category-specific multipliers only to modeled amounts; actual overrides remain fixed. Cost Comparisons uses modeled profile costs, not actual overrides.
UI and application engineering
Vanilla JavaScript renders expense distribution as SVG pie geometry with radial shading and clickable slices, plus cylindrical cost-driver bars. Expense editing, keyboard-operable expandable legend, optional payroll and warehouse controls, scenario sliders and responsive layouts support exploration. Browser localStorage persists settings on the same browser and origin; it is not an account-based data store.
Validation and testing
The documented V10.1 math audit passed 20 targeted calculations covering property, electricity, employee normalization, scenarios, 3PL, in-house and hybrid warehousing, overrides and sensitivity ranges. Later QA includes ETL, SQLite/JSON reconciliation, JavaScript syntax and interface contract tests. These are targeted tests, not exhaustive proof of every profile, browser or input combination. Hosted-origin persistence and real invoice benchmarking require separate verification.
Engineering tradeoffs
A static architecture avoids hosting a database or exposing API credentials, simplifies Cloudflare deployment and supports a free public demo. Its tradeoffs include browser-local rather than shared persistence, no live invoice ingestion, model assumptions that may not reflect local quotes, and no empirical uncertainty calibration. A future client engagement could introduce authenticated data connections and verified business-specific benchmarks.
Development evolution
V1–V4 established the dashboard and provenance; V5 integrated state electricity prices; V6 added sensitivity bands; V6.1 expanded the chart legend; V7 decomposed property and insurance models; V8 introduced warehouse/3PL costs; V9 improved reconciliation; V10–V10.1 hardened packaging and visuals; V10.2 introduced payroll and realism notes.
Portfolio significance
Demonstrates a reproducible Python ETL workflow, relational SQLite/SQL analysis, data validation, source transparency, deterministic business rules, interactive visualization and iterative quality assurance. The technical claim is that Python and SQL prepare and validate the reference layer—not that they power live client-side calculations.
Illustrative planning model. Electricity state averages do not represent utility quotes; other factors are modeled. No client outcomes or savings are claimed.