<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: DP PHONG</title>
    <description>The latest articles on DEV Community by DP PHONG (@dp_phong_edb7dfb4e72a9ed4).</description>
    <link>https://dev.to/dp_phong_edb7dfb4e72a9ed4</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4199734%2F650ef718-9261-4c3c-a9b2-6f4072013866.png</url>
      <title>DEV Community: DP PHONG</title>
      <link>https://dev.to/dp_phong_edb7dfb4e72a9ed4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dp_phong_edb7dfb4e72a9ed4"/>
    <language>en</language>
    <item>
      <title>Engineering a UK Council Tax Analytics Engine: Normalizing 363 Authorities &amp; 1991 HPI Deflators</title>
      <dc:creator>DP PHONG</dc:creator>
      <pubDate>Sun, 29 Nov 2026 09:30:40 +0000</pubDate>
      <link>https://dev.to/dp_phong_edb7dfb4e72a9ed4/engineering-a-uk-council-tax-analytics-engine-normalizing-363-authorities-1991-hpi-deflators-5b50</link>
      <guid>https://dev.to/dp_phong_edb7dfb4e72a9ed4/engineering-a-uk-council-tax-analytics-engine-normalizing-363-authorities-1991-hpi-deflators-5b50</guid>
      <description>&lt;p&gt;The UK Council Tax system is notoriously fragmented. Unlike a flat national property tax, every single one of the &lt;strong&gt;363 UK Local Authorities&lt;/strong&gt; sets its own Band D baseline, applies different statutory precept allocations (Police, Fire, Social Care), and operates under distinct valuation rules across England, Scotland, and Wales.&lt;/p&gt;

&lt;p&gt;When I set out to build &lt;a href="https://counciltaxcost.co.uk" rel="noopener noreferrer"&gt;CouncilTaxCost.co.uk&lt;/a&gt;, the goal wasn't just to build a static lookup table—it was to engineer a browser-based analytics and statutory calculation engine covering all &lt;strong&gt;2,977 UK postcode districts (outcodes)&lt;/strong&gt; for the 2026/27 fiscal year.&lt;/p&gt;

&lt;p&gt;Here is a breakdown of the data modeling challenges, statutory formulas, and client-side privacy architecture behind the project.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Normalizing Fragmented Government Datasets
&lt;/h2&gt;

&lt;p&gt;To calculate an exact bill for any UK postcode, you can't rely on a single API. You have to merge and normalize datasets from multiple public sector sources under the Open Government Licence v3.0:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MHCLG / DLUHC Live Tables&lt;/strong&gt; (England)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scottish Government Local Government Finance statistics&lt;/strong&gt; (Scotland)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;StatsWales Council Tax returns&lt;/strong&gt; (Wales)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Valuation Office Agency (VOA)&lt;/strong&gt; baseline band distributions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Band Multiplier Matrix
&lt;/h3&gt;

&lt;p&gt;Once a local authority's baseline &lt;strong&gt;Band D&lt;/strong&gt; charge is established, every other band is derived using statutory ratios—which differ by nation:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Nation&lt;/th&gt;
&lt;th&gt;Band A&lt;/th&gt;
&lt;th&gt;Band B&lt;/th&gt;
&lt;th&gt;Band C&lt;/th&gt;
&lt;th&gt;Band D (Base)&lt;/th&gt;
&lt;th&gt;Band E&lt;/th&gt;
&lt;th&gt;Band F&lt;/th&gt;
&lt;th&gt;Band G&lt;/th&gt;
&lt;th&gt;Band H&lt;/th&gt;
&lt;th&gt;Band I&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;England&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;6/9&lt;/td&gt;
&lt;td&gt;7/9&lt;/td&gt;
&lt;td&gt;8/9&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;9/9&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;11/9&lt;/td&gt;
&lt;td&gt;13/9&lt;/td&gt;
&lt;td&gt;15/9&lt;/td&gt;
&lt;td&gt;18/9&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scotland&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;240/360&lt;/td&gt;
&lt;td&gt;280/360&lt;/td&gt;
&lt;td&gt;320/360&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;360/360&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;473/360&lt;/td&gt;
&lt;td&gt;585/360&lt;/td&gt;
&lt;td&gt;705/360&lt;/td&gt;
&lt;td&gt;882/360&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Wales&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;6/9&lt;/td&gt;
&lt;td&gt;7/9&lt;/td&gt;
&lt;td&gt;8/9&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;9/9&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;11/9&lt;/td&gt;
&lt;td&gt;13/9&lt;/td&gt;
&lt;td&gt;15/9&lt;/td&gt;
&lt;td&gt;18/9&lt;/td&gt;
&lt;td&gt;21/9&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Mapping postcodes to billing authorities also required handling split postcodes—where a single outcode (like &lt;code&gt;CR0&lt;/code&gt; or &lt;code&gt;E14&lt;/code&gt;) spans multiple parishes or local precepts—ensuring the billing logic reflects exact local parish additions.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Solving the "1 April 1991" Valuation Problem
&lt;/h2&gt;

&lt;p&gt;In England and Scotland, Council Tax bands are still anchored to what a property would have sold for on &lt;strong&gt;1 April 1991&lt;/strong&gt; (or 1 April 2003 in Wales). For modern homebuyers, knowing whether a house is over-banded is nearly impossible without historical price indexing.&lt;/p&gt;

&lt;p&gt;To solve this, I built a &lt;a href="https://counciltaxcost.co.uk/tools" rel="noopener noreferrer"&gt;1991 Property Value &amp;amp; Band Overpayment Checker&lt;/a&gt; using regional House Price Index (HPI) deflators from 1991 through 2026:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;DeflationResult&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;estimated1991Value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;impliedBand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;TaxBand&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;isOverBanded&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;potentialBackdatedRefund&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;estimateHistoricalBand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;currentValue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;currentHpi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;baseline1991Hpi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;currentAnnualBill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;impliedAnnualBill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;yearsOccupied&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;DeflationResult&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Deflate modern valuation back to Q2 1991 baseline&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;estimated1991Value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;currentValue&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;baseline1991Hpi&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;currentHpi&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;impliedBand&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;mapValueToStatutoryBand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;estimated1991Value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;annualOverpayment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;currentAnnualBill&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;impliedAnnualBill&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;potentialBackdatedRefund&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;annualOverpayment&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;yearsOccupied&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;estimated1991Value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;estimated1991Value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;impliedBand&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;isOverBanded&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;annualOverpayment&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;potentialBackdatedRefund&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;potentialBackdatedRefund&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This lets users input a recent purchase price or Zoopla/Rightmove estimate, deflate it regionally, and immediately see if they are sitting in an over-banded bracket—along with the 5-to-10-year backdated refund exposure.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Zero-Backend Privacy for Legal Document Generation
&lt;/h2&gt;

&lt;p&gt;One strict architectural constraint I enforced across all utilities on the &lt;strong&gt;Free UK Council Tax Tools&lt;/strong&gt; hub was zero server-side storage of user financial or address data.&lt;/p&gt;

&lt;p&gt;When a user generates a formal representation letter to challenge their band with the VOA (citing &lt;code&gt;SI 2009/2270&lt;/code&gt; and the Local Government Finance Act 1992), the entire document assembly—including comparable neighbor address tables and statutory formatting—runs 100% client-side in the browser before exporting to PDF or clipboard. No PII ever hits a database.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Takeaways from Building Niche Civic Tech
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Public data is gold, but messy:&lt;/strong&gt; Government CSV/XLSX releases change column schemas every fiscal year. Writing strict TypeScript ingestion pipelines with validation checks saves hours of manual cleanup when updating for 2026/27.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client-side compute scales effortlessly:&lt;/strong&gt; Pre-compiling indexed JSON chunks per outcode keeps page loads fast and eliminates database bottlenecks during traffic spikes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you're working on civic data projects or programmatic SEO architectures in Next.js, feel free to test out the calculators on &lt;a href="https://counciltaxcost.co.uk" rel="noopener noreferrer"&gt;CouncilTaxCost.co.uk&lt;/a&gt; or drop questions about the data pipeline in the comments!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>How I Built an Interactive Water Hardness &amp; Appliance Calibration Tool with Next.js</title>
      <dc:creator>DP PHONG</dc:creator>
      <pubDate>Tue, 03 Nov 2026 10:04:36 +0000</pubDate>
      <link>https://dev.to/dp_phong_edb7dfb4e72a9ed4/how-i-built-an-interactive-water-hardness-appliance-calibration-tool-with-nextjs-13bh</link>
      <guid>https://dev.to/dp_phong_edb7dfb4e72a9ed4/how-i-built-an-interactive-water-hardness-appliance-calibration-tool-with-nextjs-13bh</guid>
      <description>&lt;h1&gt;
  
  
  Why Dishwashers Fail in the UK: Solving the Water Hardness Dial Disconnect
&lt;/h1&gt;

&lt;p&gt;Every year across the UK, thousands of dishwashers suffer premature heating element failure or leave cloudy calcium films on glassware. The culprit usually isn’t bad detergent—it’s an incorrectly configured ion-exchange water softener chamber.&lt;/p&gt;

&lt;p&gt;UK water hardness varies drastically across postal outcodes, ranging from ultra-soft mountain runoffs in Manchester (~45 PPM) to limestone-saturated groundwater in London (&amp;gt;270 PPM) and the South East.&lt;/p&gt;

&lt;p&gt;To solve this friction point, I built an interactive micro-tool that bridges raw chemical water metrics with real-world appliance dial settings: &lt;a href="https://waterhardness.uk/tools/dishwasher-salt-calculator" rel="noopener noreferrer"&gt;&lt;strong&gt;UK Dishwasher Salt Setting Calculator&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is a breakdown of how it works under the hood and how I tackled the data mapping challenge.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Core Problem: Units of Measurement Disconnect
&lt;/h2&gt;

&lt;p&gt;Appliance manufacturers do not use standardized units. Depending on whether an appliance is engineered in Germany, the UK, or Asia, the internal electronic menu expects different metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bosch / Siemens / Neff:&lt;/strong&gt; Digital register scales (e.g., &lt;code&gt;H:00&lt;/code&gt; to &lt;code&gt;H:07&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Miele:&lt;/strong&gt; German hardness degrees ($^\circ\text{dH}$) or Clark scale ($^\circ\text{Clark}$)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Beko / Indesit:&lt;/strong&gt; Mechanical or digital level selectors (Level 1 – 5)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Samsung:&lt;/strong&gt; Discrete steps (&lt;code&gt;H1&lt;/code&gt; to &lt;code&gt;H6&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Meanwhile, UK water testing data from the Drinking Water Inspectorate (DWI) and local utility companies provide hardness in parts per million (PPM or $\text{mg/L CaCO}_3$).&lt;/p&gt;

&lt;h3&gt;
  
  
  The Conversion Matrix
&lt;/h3&gt;

&lt;p&gt;To keep the UI responsive without server latency, the conversion runs entirely on the client side:&lt;/p&gt;

&lt;p&gt;$$1\text{ PPM} = 0.07016\ ^\circ\text{Clark} = 0.0560\ ^\circ\text{dH}$$&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;HardnessUnitValues&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;ppm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;clark&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;dh&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;convertFromPpm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ppm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nx"&gt;HardnessUnitValues&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ppm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;clark&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;ppm&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.07016&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
    &lt;span class="na"&gt;dh&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;ppm&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.056&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  2. Appliance Lookup &amp;amp; Dial Mapping Logic
&lt;/h2&gt;

&lt;p&gt;The appliance engine maps the calculated PPM against calibrated threshold intervals for each manufacturer.&lt;/p&gt;

&lt;p&gt;For instance, a Bosch machine in a hard water zone (e.g., $275\text{ PPM} \approx 19.3\ ^\circ\text{Clark}$) triggers regeneration at &lt;code&gt;H:05&lt;/code&gt;, requiring approximately $1.3\text{ – }1.6\text{ kg}$ of coarse granular sodium chloride per month:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;BoschSetting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:00&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:01&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:02&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:03&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:04&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:05&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:06&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:07&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getBoschSetting&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ppm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nx"&gt;BoschSetting&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ppm&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:00&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ppm&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:01&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ppm&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:02&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ppm&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:03&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ppm&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;320&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:05&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ppm&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:06&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;H:07&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. Architecture &amp;amp; Performance Decisions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero-Latency UI:&lt;/strong&gt; Built with client-side reactive sliders so users can either input an outcode (fetching the DWI benchmark) or fine-tune PPM manually with real-time dial adjustment feedback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Actionable Appliance Guides:&lt;/strong&gt; Instead of showing raw numbers, the tool outputs actual hardware button combinations (e.g., holding &lt;strong&gt;Setup 3s&lt;/strong&gt; or &lt;strong&gt;Programme A + Start&lt;/strong&gt;) to help non-technical users calibrate their specific model immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO &amp;amp; Structured Micro-Tools:&lt;/strong&gt; Designed as a standalone utility module integrated into the broader database at &lt;a href="https://waterhardness.uk" rel="noopener noreferrer"&gt;WaterHardness.uk&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It Out
&lt;/h2&gt;

&lt;p&gt;You can test the calculator directly here:&lt;br&gt;&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://waterhardness.uk/tools/dishwasher-salt-calculator" rel="noopener noreferrer"&gt;Live Dishwasher Salt Setting Tool&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Seeking Feedback On:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Adding more brand dial mappings (e.g., AEG, Zanussi, Hotpoint variations).&lt;/li&gt;
&lt;li&gt;UX improvements for mobile users checking under their kitchen sink.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How I Built a Programmatic SEO Engine Mapping Water Hardness Across 9,000+ UK Postcodes</title>
      <dc:creator>DP PHONG</dc:creator>
      <pubDate>Sun, 01 Nov 2026 04:33:28 +0000</pubDate>
      <link>https://dev.to/dp_phong_edb7dfb4e72a9ed4/london-tap-water-averages-an-eye-watering-290-ppm-of-chalk-and-calcium-carbonate-see-what-that-25bf</link>
      <guid>https://dev.to/dp_phong_edb7dfb4e72a9ed4/london-tap-water-averages-an-eye-watering-290-ppm-of-chalk-and-calcium-carbonate-see-what-that-25bf</guid>
      <description>&lt;p&gt;When building hyper-local programmatic SEO architectures, finding reliable open datasets and structuring them into high-intent landing pages is one of the most effective ways to drive organic search visibility.&lt;/p&gt;

&lt;p&gt;Recently, I designed and deployed an automated data platform mapping water quality indicators across the UK: &lt;a href="https://waterhardness.uk/guides/london-water-hardness-by-postcode" rel="noopener noreferrer"&gt;WaterHardness.uk&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is an architectural breakdown of how the data pipeline, schema modeling, and programmatic rendering work under the hood.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. The Engineering Challenge: Disjointed Datasets
&lt;/h3&gt;

&lt;p&gt;Across the UK, tap water metrics are published by dozens of regional water authorities (such as Thames Water, Severn Trent, and Scottish Water). The problem?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Metrics are distributed across incompatible formats (PPM, Clark Degrees, French Degrees, and German dH).&lt;/li&gt;
&lt;li&gt;Data granularity differs wildly: some providers expose outward postcode areas (e.g., &lt;code&gt;SW1&lt;/code&gt;), while others publish down to specific water treatment zones.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To build a uniform query interface, I built an automated ingest script to normalize all measurements into a unified schema:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
json
{
  "postcode_sector": "SW1A",
  "calcium_carbonate_ppm": 290,
  "clark_degrees": 20.3,
  "classification": "Very Hard",
  "primary_source": "Thames Water",
  "updated_at": "2026-10-01T00:00:00Z"
}
2. Static Generation vs. Dynamic Lookup
With over 9,000 UK postcode sectors, rendering pages on every user request introduces unnecessary database latency and server overhead.

Instead, I opted for an SSG (Static Site Generation) approach paired with ISR (Incremental Static Regeneration):

Core Authority Pages &amp;amp; Guides: Pre-rendered at build time with comprehensive contextual metrics. For example, the detailed breakdown for the capital can be viewed in the London Water Hardness Guide, combining local aquifer geology with appliance calibration formulas.

Micro-postcode Slugs: Generated dynamically on-demand and cached at edge CDN layers, keeping TTFB (Time to First Byte) under 50ms.

3. Programmatic Schema Markup for Search Intent
Backlink acquisition and on-page metadata only convert when search bots understand semantic entities. Each postcode page injects structured JSON-LD data:

Dataset schema referencing UK water authority disclosures.

FAQPage schema addressing specific household thresholds (e.g., limescale buildup rates and combi-boiler efficiency loss thresholds at 200+ PPM).

Key Takeaways
Clean Data Wins: Programmatic SEO fails if your data is noisy. Investing time upfront into cleaning and normalizing edge-case postcodes prevents massive 404 crawl budgets.

Combine Micro-Data with Macro Guides: Individual postcode lookup pages provide high search utility, but long-form regional hubs (like the London Water Hardness Dataset) act as the internal linking anchor that distributes PageRank throughout the cluster.

Have you built programmatic sites or local data tools using similar pipelines? Would love to hear your thoughts on caching strategies and data ingestion pipelines in the comments!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>UK Water Hardness and Postcode Limescale Guide: [AB10]</title>
      <dc:creator>DP PHONG</dc:creator>
      <pubDate>Thu, 29 Oct 2026 11:12:47 +0000</pubDate>
      <link>https://dev.to/dp_phong_edb7dfb4e72a9ed4/uk-water-hardness-and-postcode-limescale-guide-ab10-1kdp</link>
      <guid>https://dev.to/dp_phong_edb7dfb4e72a9ed4/uk-water-hardness-and-postcode-limescale-guide-ab10-1kdp</guid>
      <description>&lt;p&gt;If you live in or recently moved to [AB10], tap water mineral concentration can significantly affect combi boiler heating efficiency, appliance lifespan, and daily skincare. &lt;br&gt;
You can check your local area's official Drinking Water Inspectorate (DWI) PPM ratings, water supplier details, and manufacturer dishwasher salt settings on the live UK directory here: &lt;br&gt;
&lt;a href="https://waterhardness.uk/water-hardness/ab10" rel="noopener noreferrer"&gt;https://waterhardness.uk/water-hardness/ab10&lt;/a&gt;&lt;br&gt;
For nationwide comparisons across all 2,977 UK districts, visit the open directory at &lt;a href="https://waterhardness.uk/outcodes" rel="noopener noreferrer"&gt;https://waterhardness.uk/outcodes&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How I Engineered a Hyper-Local Water Hardness &amp; Appliance Calibration Tool for 9,000+ UK Postcodes</title>
      <dc:creator>DP PHONG</dc:creator>
      <pubDate>Thu, 22 Oct 2026 06:24:45 +0000</pubDate>
      <link>https://dev.to/dp_phong_edb7dfb4e72a9ed4/how-i-engineered-a-hyper-local-water-hardness-appliance-calibration-tool-for-9000-uk-postcodes-2obb</link>
      <guid>https://dev.to/dp_phong_edb7dfb4e72a9ed4/how-i-engineered-a-hyper-local-water-hardness-appliance-calibration-tool-for-9000-uk-postcodes-2obb</guid>
      <description>&lt;p&gt;Over 60% of homes in the UK suffer from hard or aggressively hard tap water. If you live in London, East Anglia, or the South East, dissolved calcium carbonate ($CaCO_3$) wrecks kettle elements, scales combi boiler heat exchangers, and clouds glassware.&lt;/p&gt;

&lt;p&gt;Most homeowners only find out their water hardness when a new appliance (like a Bosch or Miele dishwasher) asks for manual hardness calibration (H:00 to H:07) or salt dosage settings.&lt;/p&gt;

&lt;p&gt;To solve this, I built &lt;strong&gt;&lt;a href="https://waterhardness.uk" rel="noopener noreferrer"&gt;WaterHardness.uk&lt;/a&gt;&lt;/strong&gt; — an independent data platform and utility engine mapping water hardness metrics across 9,000+ UK postcode sectors.&lt;/p&gt;

&lt;p&gt;Here is a breakdown of the technical challenges, data normalization, and appliance calibration logic behind the project.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Core Architecture &amp;amp; Data Challenge
&lt;/h2&gt;

&lt;p&gt;The hardest part of building hyper-local utilities in the UK isn't the UI — it's &lt;strong&gt;geographical and data reconciliation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Non-Standard Catchments:&lt;/strong&gt; UK water suppliers (Thames Water, Severn Trent, Anglian Water, Scottish Water) do not supply water strictly by municipal boundaries; their water supply zones (WSZs) overlap across arbitrary boundaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unit Standardization:&lt;/strong&gt; Different water companies and appliance manuals report hardness using different scales: PPM ($mg/L\ CaCO_3$), English Clark degrees (°e), German degrees (°dH), or French degrees (°f).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Sources:&lt;/strong&gt; We aggregated public disclosures from the Drinking Water Inspectorate (DWI) and major regional utilities, cross-referencing outcode and sector coordinates to normalize hardness values into a unified relational schema.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Solving Appliance Calibration: The Dishwasher Salt Logic
&lt;/h2&gt;

&lt;p&gt;One feature users requested most was automated salt setting lookups. Most modern dishwashers rely on an internal ion-exchange resin tank that must be regenerated using coarse granular salt.&lt;/p&gt;

&lt;p&gt;Instead of flipping through paper manuals, we built dedicated logic matching regional PPM to manufacturer steps. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bosch / Siemens / Neff:&lt;/strong&gt; Hardness calibrated from &lt;code&gt;H:00&lt;/code&gt; (&amp;lt;50 PPM) to `H:07` (&amp;gt;380 PPM).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Beko:&lt;/strong&gt; Calibrated from &lt;code&gt;r1&lt;/code&gt; to &lt;code&gt;r5&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consumption Modeling:&lt;/strong&gt; Factoring average wash frequency to estimate monthly salt consumption in kilograms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can test the implementation on our &lt;strong&gt;&lt;a href="https://waterhardness.uk/guides" rel="noopener noreferrer"&gt;UK Dishwasher Salt Setting Calculator&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Tech Stack &amp;amp; Performance Tuning
&lt;/h2&gt;

&lt;p&gt;For this project, the priority was sub-second page loads and near-instant local lookups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; Modern statically-optimized architecture with localized outcode routing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DNS &amp;amp; Edge:&lt;/strong&gt; Proxied through Cloudflare edge caching for low-latency delivery across the UK.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Schema Markup:&lt;/strong&gt; Implemented rich JSON-LD structured data (&lt;code&gt;Dataset&lt;/code&gt;, &lt;code&gt;TechArticle&lt;/code&gt;, &lt;code&gt;LocalBusiness/Service&lt;/code&gt;) to make geographical datasets machine-readable for modern AI and search crawlers.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;We are currently expanding the calculation engine to include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Coffee machine descaling interval estimators (DeLonghi, Sage/Breville).&lt;/li&gt;
&lt;li&gt;Whole-house water softener capacity calculators based on household size and cubic meter water usage.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I would love to hear feedback from fellow engineers on data structuring, edge performance, or additional utility calculations that would be useful!&lt;/p&gt;

&lt;p&gt;👉 Live project: &lt;strong&gt;&lt;a href="https://waterhardness.uk" rel="noopener noreferrer"&gt;WaterHardness.uk&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
