← Status board  /  Phase 9

Phase 9 — Dashboard · React + Vite An English-language page that first explains what SECOP is, then shows it: six KPIs and ten charts over eleven API endpoints. Every figure changes only when the user asks — no interval, no refetch on focus, one button.

Status complete Charts 10 Endpoints 11 Build 763 kB · 253 kB gzip Next Phase 10 · Packaging

1 Explaining SECOP to someone who has never heard of it

The page is in English on purpose: a reader in Nairobi or Manila should be able to open it cold and understand what they are looking at before they see a single chart.

CardWhat it tells the reader
The registrySistema Electrónico de Contratación Pública. Since 2002 every Colombian public body — ministries, municipalities, public hospitals, state universities — must publish what it buys, for how much and from whom.
Two systems, one datasetSECOP I is the older, mostly declarative platform: spreadsheets and free text. SECOP II is transactional, in use since 2015. Both live in the same table here, which is why the stacked chart has two colours.
The moneyValues are in Colombian pesos, unconverted. B = thousands of millions (10⁹), T = millions of millions (10¹²) — explicitly not the Spanish billón, which is 10¹² and confuses every English reader who meets it.
What this page isA 1-in-13 sample: 1,309,594 contracts of the 17 million in the registry, chosen by a hash so no year or entity is favoured. A laboratory, not the official record.

Below the explainer, a caveat block closes the loop: a sample not the registry, dates are the weak field, values are heavily skewed, supplier names are not normalised. Four paragraphs, each one a way this page could mislead someone who did not read them.

2 What it shows

BlockContent
Six KPIs1,309,594 contracts · $8,681.2 T total · 13,183 public buyers · 844,213 suppliers · $10.8 M median contract · 9.2 % without a usable date.
Volume over timeContracts per year, with the year 0 drawn as s/f — 120,778 contracts with no date.
By system, stackedSECOP I and II per year, showing the handover around 2019.
Share of the sampleDonut: 65.4 % SECOP I, 34.6 % SECOP II by contract count.
Value per yearArea line on a log axis, undated contracts excluded.
When contracts are signedSeasonality across the calendar year, over rows that carry a signature date.
How big is a contractHistogram of six value bands, from under a million pesos to over ten billion.
Biggest buyersTop entity codes by value for a selected year.
Where the money goesTop departments for the same year.
MunicipalitiesTreemap, area proportional to value.
ConcentrationTop 10 suppliers as bars, with the cumulative share of the whole sample as a line.

3 The API had to grow from four endpoints to eleven

A dashboard with ten charts cannot be built on four queries. Seven consolidations were added to Phase 8's surface, all read-only and all on the same JdbcTemplate:

New endpointFeeds
/consolidados/resumenThe six KPIs, including percentile_approx(valor, 0.5) for the median.
/consolidados/por-fuenteThe donut.
/consolidados/por-anio-fuenteThe stacked chart.
/consolidados/por-mesSeasonality, over rows with a signature date only.
/consolidados/por-rango-valorThe value histogram, six bands.
/consolidados/por-contratistaConcentration.
/consolidados/por-municipioThe treemap.

Refreshing the page now fires eleven requests, all with refresh=true, all answered in well under a second each because the heaviest consolidation was measured at 334 ms in Phase 5.

4 What the data says — and what it refuses to say

Building the charts surfaced three facts that the timing benchmark could not see:

The median contract is $10.8 M COP

Half of the 1.3 million contracts are worth less than about 10.8 million pesos. The largest in the sample is $2,540 T — 235 million times the median. Any average over this distribution is a fiction, which is why the page shows medians, bands and log axes instead of means.

SECOP II's undated rows hold 99.2 % of its value

7.1 % of SECOP II contracts (32,370 rows) carry no usable year, and those rows concentrate $8.49 T of the $8.56 T recorded for that system. A handful of extreme entries. The value chart therefore excludes s/f and says so in its subtitle.

A third, smaller finding: the registry contains a contract dated 2097 (one row) and others dated before 2000. They stretch a timeline over 130 years and compress the real one, so the charts drop years outside 2000–2026 and keep the s/f bucket, which is the honest place for a row whose date cannot be trusted.

5 "No refresh" is implemented, not just promised

SettingEffect
staleTime: 5 minA panel revisited within five minutes comes from the client cache.
refetchOnWindowFocus: falseAlt-tabbing away and back does not trigger a query — the behaviour most dashboards get wrong.
no refetchIntervalNo timer anywhere in the app.
RefreshThe only trigger: eleven requests, all with refresh=true, bypassing the server's 60-second cache.

6 With the API stopped

Could not load the data
Layer: the API is not answering · HTTP —
Could not reach the API at http://127.0.0.1:8080

The panel names the layer that failed, distinguishes a dead API from a dead engine, and replaces the panels rather than blanking them. No stale numbers survive a reload, the status dot turns red, and the Refresh button returns to its idle state instead of sticking on "Querying…".

7 What QA changed — thirteen defects, none of them crashes

Every item below was found by looking at the rendered page, not by a failing test. That is the point of ending each phase with a browser pass.

DefectFix
Bundle 1,226 kB for one chart typeecharts/core with four chart types; now 763 kB / 253 kB gzip including line, pie and treemap.
KPI wrapped to two lines ("$8,681,219.6" / "B")Total shown in trillions: $8,681.2 T, with the unit spelled out underneath.
Explainer read "pesos(10⁹ COP)"Sentence rewritten around the unit definitions instead of a parenthesis.
Department label clipped to "istrito Capital de Bogotá"Names shortened (Distrito Capital de → Bogotá) and the axis widened.
Axis ticks collided: "100,000,000,200000,000,…"One shortener for every axis: B below a trillion, T above.
Supplier names cut to "ROLANDO VIVER…"Labels wrap on two lines instead of truncating; and the leftmost one lost its first letter at the canvas edge until the grid was padded.
Treemap tiles with unreadable half-namesA tile under 3 % of the area shows no label at all.
Value bands out of orderThe engine returns groups unordered; the chart now imposes the six bands itself.
A contract dated 2097 on the x-axisYears outside 2000–2026 dropped from the timeline, s/f kept.
Concentration axis read "30000000B"Same shortener as everywhere: T.
Final state

Ten canvases painted, zero console messages at any level, zero out-of-range years on any axis, and a hard reload shows the same numbers as the API. Verdict from the last pass: PASS.

8 Gate

Gate met

Ten charts and six KPIs, all fed by the API and identical to it; a reader who has never heard of SECOP gets the four-card explainer before the first chart; the refresh button is the only thing that changes a number and it sends refresh=true on all eleven requests; with the API down the page names the layer instead of showing an empty chart; console clean; build passes tsc --noEmit.

Not in this phase: authentication, and any form of streaming. Phase 10 packages the API and this bundle into one command.