Portfolio piece

How it's built

What's behind the dashboard, and why

Fleet Pulse is a portfolio piece by Eric Blanchard: role-based dashboards on ClickHouse, packaged with Docker so the same stack runs in the cloud or on-prem. Everything below runs on sample data.

Where the data comes from

Every number on this site is synthetic. Real plant data is confidential, so a seeded generator builds a fleet, simulates its weather and output, breaks things on purpose, and writes down what each fault cost. In production the same tables would be fed by the plants' SCADA systems and data loggers, weather stations or satellite irradiance, and the offtaker's contract prices.

  1. 1 · lib/fleet/fleet.ts · regions.ts

    A fictional fleet in real places

    16 made-up sites, each placed within about 30 km of a real solar region in Canada or the US (Brooks AB, Sarnia ON, Pecos TX, Mojave CA…). Each gets 6 to 24 inverters of 2.5 to 4 MW, 16 to 24 strings per inverter, a DC/AC ratio of 1.15 to 1.35, and a PPA price for its region, roughly $35 to $80 per MWh.

  2. 2 · lib/fleet/solar.ts · weather.ts

    The sun and the weather

    Sun position comes from NOAA's solar-position equations and clear-sky irradiance from the Haurwitz model, for every site and 5-minute interval. Each day gets a random clearness, mostly sunny, with clouds drifting between half-hour anchor points. Rain follows each region's climate (about five heavy-rain days a month on the Prairies and in Ontario, almost none in the desert Southwest), and rainy days are overcast. Air temperature follows latitude, season and time of day.

  3. 3 · lib/fleet/physics.ts

    What a healthy plant produces

    String DC power = capacity × irradiance ÷ 1000 × a temperature penalty (−0.35% per °C above 25 °C) × a hidden per-string mismatch × 3% wiring loss. The inverter converts at 97.5% and clips at its AC rating, which is where clipping comes from.

  4. 4 · lib/fleet/soiling.ts

    Dust, the Kimber way

    Ordinary dust builds up every dry day at a regional rate: about 0.05% of output a day in Ontario, 0.1% on Prairie farmland, up to 0.3% in the desert (the range Kimber et al. measured). A day with 6 mm of rain washes it off, the ground stays damp for 14 days, and losses cap at 30%. Desert owners already wash on a schedule, every 60 to 120 days.

  5. 5 · lib/fleet/fleet.ts

    Planted faults

    About three per site per month: strings offline (2 to 20 days), strings degraded by 12 to 35% (10 to 90 days), inverter outages (2 to 72 hours), sticky soiling that rain doesn't lift (cemented dust, pollen, droppings; 3 to 8% until the next scheduled wash), a pyranometer reading 4 to 10% high (3 to 20 days), curtailment to 30 to 70% around solar noon (2 to 6 hours), and communication outages that leave gaps (1 to 12 hours).

  6. 6 · lib/fleet/telemetry.ts

    What monitoring would see

    Readings like a SCADA system reports them, with a little sensor noise: weather (irradiance, air and module temperature), each inverter's AC output and any power limit from the plant controller, each string's DC output, and a soiling station's ratio. Daily rainfall comes separately, as it would from a rain gauge or weather service, with 60 days of history. The faults themselves are never in the readings; the analysis has to infer them.

  7. 7 · truth_ tables · lib/graphql/energy.ts

    The answer key and the money

    The generator records the true cost of every fault in separate truth_ tables that only tests read. Lost revenue on the dashboard is lost energy × the site's PPA price. Cleaning costs are estimated from published per-panel contractor rates plus a mobilization fee. The seed is fixed (4, chosen because its last week shows every kind of recommendation), so every install gets exactly the same 30 days: June 2026 at 5-minute resolution, about 40 million readings.

Load it yourself with npm run db:seed; flags change the number of sites, days, interval and seed.

Why every site has a soiling station

A soiling station is two small reference modules side by side: one is cleaned every day, the other is left to get as dirty as the rest of the plant. The ratio of their currents is the soiling ratio: 100% is clean, 92% means soiling is costing 8% of output. It's cheap next to a single wash of a large site, and it changes the decisions this dashboard can make.

  • Dirt or sensor?

    If the pyranometer reads 6% high, the model expects 6% more than the sun delivered and every string looks 6% short: exactly what dust looks like. With a station reading 100%, the dashboard says "check the sensor" and nobody pays for a wash that recovers nothing.

  • How fast it's building

    The station's day-by-day trend gives the build-up rate, so a wash decision counts the dust still to come, not just today's loss. A site at 97% that's losing 0.3% a day is a different decision from one that's holding steady.

  • Did the rain work?

    After a heavy rain the ratio should jump back towards 100%. If it doesn't, the soiling is the sticky kind, waiting for the next storm is pointless, and it's a crew's job.

  • Proof for the client

    A wash recommendation backed by a measured ratio, and a before-and-after reading once it's done, is something an asset manager can take to the owner. The savings on the overview come from those numbers.

From reading to page

  1. 1 · lib/fleet

    Generate

    A seeded, synthetic fleet: sites, inverters and strings, with minute-level weather and output from a simplified PV model. Faults are planted, and an answer key records what each one cost.

  2. 2 · lib/fleet/attribution.ts

    Attribute

    From the readings alone, explain the gap between expected and actual: outages, curtailment, soiling, offline and degraded strings, plus an unexplained residual.

  3. 3 · ClickHouse · db/migrations

    Store

    Raw telemetry, the attribution per inverter and interval, a daily per-site rollup kept current as rows arrive, and an executive snapshot ClickHouse recomputes every morning.

  4. 4 · GraphQL · lib/graphql

    Serve

    A typed, read-only API over the SQL. DataLoader batches lookups so a page costs a fixed number of queries; depth and range limits cap what one request can ask for.

  5. 5 · Next.js server components

    Render

    Pages run their GraphQL query in-process at request time and send finished HTML. The browser only runs the chart tooltips, the chart/table toggles and the deck.gl map.

The back end, right now

Read live from ClickHouse's own system tables through the GraphQL API (open it in GraphiQL).

Fleet

16 sites

206 inverters · 4,422 strings

Readings stored

40.1M

Jun 1 – 29, 2026

On disk

116 MB

All tables, compressed

Database

ClickHouse 25.8

Columnar, MergeTree engines

Tables

Rows, size on disk and compression, largest first.

ClickHouse tables
TableRowsOn diskUncompressedCompression
string_readings38.2M87 MB472 MB5.4×
inverter_attribution1.8M23.8 MB73.8 MB3.1×
inverter_readings1.8M4.1 MB27.2 MB6.7×
weather_readings138,2401.4 MB2.9 MB2.1×
pv_strings4,42234.4 KB166 KB4.8×
site_daily49618.2 KB28.9 KB1.6×
site_budget_daily4804.1 KB5.3 KB1.3×
rain_daily1,4403.5 KB9.9 KB2.8×
inverters2062.1 KB8.2 KB4.0×
truth_faults471.8 KB2.3 KB1.3×
exec_snapshot71.6 KB1.1 KB0.7×
exec_month_close71.6 KB1.1 KB0.7×
sites161.6 KB1.6 KB1.0×
exec_trend_daily291.1 KB1.1 KB0.9×

Rendered from ClickHouse via GraphQL: 7 SQL queries reading 7.1M rows, 1041 ms end to end (1345 ms of query time, some of it in parallel). How this works

Decisions and trade-offs

One dashboard per role

Four tabs on the home page, for the asset manager, the PV engineer, operations and the executive, each built around the decisions that person makes. The assumptions behind each are written down on the Who it's for page.

Why
The same data answers different questions depending on who's asking, and each question has its own grain and freshness: an executive needs six numbers by morning, an engineer needs every string. Splitting the views lets each one query only what it needs, so the light views stay fast while the heavy one scans raw data.
Trade-off
Four views to keep consistent instead of one. People who wear two hats switch tabs. The roles are assumptions until they're tested with real users.

Precompute what executives read

ClickHouse refreshable materialized views run the executive queries every morning at 09:00 UTC (05:00 in Toronto) and on the 1st of each month, and write a few dozen rows into small tables. The executive tab reads only those, and shows when they were computed.

Why
Executives open it first thing, often on a phone, and nothing they decide changes by the hour. The morning run reads millions of rows once so every page view reads tens. The database runs the schedule itself: no cron job or worker to deploy, and a refresh swaps the table atomically, so nobody sees half a snapshot. Month closes are kept, so the number reported to the board doesn't move.
Trade-off
The view is up to a day old, by design. A refresh that fails leaves yesterday's numbers in place (the computed-at time shows it). The schedule is in UTC, so the run lands at 04:00 in Toronto in winter.

A budget from the same model

Report the executive view against a P50 budget: the fault-free physics model run over 15 simulated weather years, less a 2% allowance, for every site and local day.

Why
Executives compare against budget, not the model. Building the budget from the same physics means the gap splits cleanly in two: budget to expected is the weather, expected to actual is operations. The bridge on the executive tab balances to the dollar.
Trade-off
A real budget comes from a pre-construction yield study (PVsyst or similar) with decades of satellite weather, not 15 synthetic years.

ClickHouse for telemetry

Store every reading in a columnar database, sorted by site, then device, then time, in monthly partitions.

Why
Dashboards scan a few columns across millions of rows. Column codecs keep a string reading to about 2 bytes, and the site-first sort key lets a one-site query skip the rest of the table (a test checks this with EXPLAIN).
Trade-off
It's not for transactional data like users or settings; those would live in Postgres beside it. Updates are expensive, so the data model is append-only.

Roll up on insert, by local day

A materialized view sums each site's energy and losses per local calendar day as data arrives.

Why
Summaries read hundreds of rollup rows instead of tens of millions of readings, in about 10 ms. Using the site's own day, not UTC, keeps a western site's evening on the right date.
Trade-off
A second copy of the numbers that must stay consistent. A test asserts the rollup equals aggregating the raw rows.

GraphQL with a code-first schema

Pothos builds the schema from TypeScript; GraphQL Yoga serves it at /api/graphql.

Why
The data is naturally nested (fleet → site → inverter → string) and each screen needs a different slice. Types flow from the SQL rows through the resolvers to the pages.
Trade-off
The N+1 query trap: fixed with DataLoader, and a test proves a deep query costs the same 5 SQL queries for one site or all of them. HTTP caching is harder than with REST.

Pages query GraphQL in-process

Server components execute the schema directly instead of calling the HTTP endpoint or shipping a data client to the browser.

Why
No network hop and no client-side fetching code, while pages still go through the same resolvers, batching and limits as the public API.
Trade-off
Pages render per request rather than being cached as static files. At this data size that costs tens of milliseconds.

A synthetic fleet with an answer key

Generate the data, including planted faults, and keep the true cost of every fault in separate truth_ tables.

Why
Real plant data can't be published. With an answer key, tests can measure the loss analysis: within 8% of the truth fleet-wide for every cause, under 0.2% of energy blamed on faults that don't exist, and a drifting sensor never mistaken for soiling.
Trade-off
The physics is deliberately simple (clear-sky irradiance with clouds). It isn't a full 3D, physics-based performance model, and doesn't pretend to be.

Every kWh of the gap is accounted for

Attribute losses in a fixed order (outage, curtailment, soiling, offline strings, degraded strings) and keep a residual.

Why
Expected − actual = losses + residual holds exactly for every record, so totals always reconcile. Data gaps are reported as unmeasured, never as loss.
Trade-off
When faults overlap, the order decides which one gets the credit.

Judge strings against their siblings

Flag a string when its output per kW falls below 93% of the median of its siblings on the same inverter.

Why
Siblings share weather, soiling, clipping and curtailment, so comparing them cancels all of that. It runs in SQL alone, straight on the raw readings.
Trade-off
A string fault is invisible while its whole inverter is down, because every sibling reads zero. The inverter-level analysis catches the outage instead.

Accessibility over the draft palette

Start from a navy-and-purple palette, and change any pairing that fails WCAG 2.2 AA.

Why
The draft's 30% grey labels measured 1.9:1, and purple focus rings on navy 2.1:1. Both were changed to the nearest passing value in the same palette.
Trade-off
Labels are a little heavier than the draft. The Storybook audit shows each change side by side with the measured ratios.

Charts drawn by hand, each with a table

Small SVG charts with a validated palette, a keyboard-operable tooltip, and a table view of every value.

Why
No charting library to ship. Colours are checked by a validator rather than by eye, and no value is reachable only by hovering.
Trade-off
Fewer chart types than a library offers. The map is the exception, because it needs pan, zoom and picking on WebGL.

Washing is a payback decision

Wash when the soiling it removes, before the next heavy rain or scheduled wash, is worth more than the wash. Count the dust still to come, from the station's build-up rate. Review every scheduled wash due in the next two weeks the same way, and say when to skip it.

Why
Washing a 100 MW site costs six figures and rain does it for free, so "dirty" isn't enough of a reason, and neither is "it's on the calendar". Soiling that has already sat through a heavy rain won't wash off, so it's judged over 90 days instead of waiting for rain that won't help.
Trade-off
The wait for rain comes from climate, not a forecast. The build-up rate is trusted for 30 days, then held flat, so the savings shown are conservative. The cost is an estimate until an operator types in a quote.

Measure soiling, don't infer it

Give every site a soiling station and attribute soiling from its reading. Without one, fall back to inferring it from every string being low together.

Why
Inference can't tell dust from a pyranometer reading high: both make every string look short by the same amount. The station can, so a drifting sensor becomes "check the sensor" instead of a six-figure wash. Measured soiling also matches the answer key within 8%, where inference missed the early build-up.
Trade-off
One station is one spot: if it sits by a dirt road or in a corner that never gets dusty, the whole site is judged by it. Its clean reference module has to be kept clean, daily, which is its own maintenance job.

A deck.gl map with no tile service

Draw the fleet map with deck.gl over a bundled Natural Earth outline of provinces and states (about 75 KB), instead of Mapbox or MapLibre tiles.

Why
No API key, no third-party requests, and it works on an air-gapped on-prem install. Circle area, not radius, is proportional to lost revenue, so a site losing twice as much looks twice as big.
Trade-off
No streets or satellite imagery. deck.gl layers drop onto a Mapbox or MapLibre basemap unchanged when that's wanted. The canvas isn't keyboard-operable, so the table view carries the same data.

How it's tested

Unit and property tests
Physics, solar geometry, loss attribution, formatting. Random-input tests check invariants: losses always sum to the gap, and slices of the data match longer runs.
Against the answer key
The loss analysis and the SQL string detector are scored against the planted faults in summer, winter and autumn scenarios.
Against real ClickHouse
SQL rollups and rankings must equal the TypeScript reference to 1e-9. The GraphQL API is tested end to end, including its query count.
Every component, in a browser
Each Storybook story runs in Chromium with interaction tests and axe accessibility checks.
On every push
CI runs lint, types, unit, story and database tests (with a ClickHouse service) and a full build. Dependabot proposes updates; CI decides.

The component library, including the accessibility audit, is published with the site.

Not built yet

  • Sign-in and per-customer data access.
  • Street or satellite basemap tiles under the fleet map.
  • A weather forecast for the rain window, instead of climate averages.
  • Streaming ingestion; the data is loaded in batches today.
  • Alerts pushed to operators, and a streaming “latest state” table so the operations tab is minutes old, not a day.
  • Year-to-date and quarterly executive views; the sample holds one month.

Back to the dashboards