Research
Most complex buildPrototypeA product research system
A research tool for architects. Give it an address and it works out which Building Code rules apply to a product on that site, then compares 855 real products on the proof their suppliers have published. It draws on 111 separate data sources.
Built forA new venture in the construction industry.
- 111
- data sources mapped, each with its own rules
- 855
- real products loaded
- 192
- product types, each with its own set of requirements
- 140,000
- rule combinations, worked out on the spot instead of stored
The process, mapped
- 1
Find the address
- 2
Work out the site's zones
- 3
Describe the building
- 4
Choose the product type
- 5
Ask how it will be used
- 6
Work out which rules apply
- 7
Check each product's proof
The problem
When an architect chooses a product such as cladding or windows, they have to work out which parts of the Building Code apply to it on that particular site. Then they have to check whether the supplier can prove the product meets them.
The answer changes with almost everything: where the site is, how exposed it is to wind and salt air, how tall the building is, what it is used for, and how the product will be used on it. The same cladding can be fine on one site and need a different route to approval on the next.
The information needed to answer it is spread across government maps, the Building Code and its supporting documents, published standards, certificate registers, and hundreds of supplier pages and PDFs.
The process
This is the hardest thing I have built. Most of the work was mapping, long before there were any screens.
I started by building a register of every piece of information the tool would need. It came to 111 separate data sources in ten groups, from address lookups and climate zones to certificate registers and supplier documents. Each one has its own answer to the same questions: where does it come from, what is its licence, how often does it change, and what rules apply to it?
Then I mapped the questions an architect works through, in order: where is the site, what is the building, what kind of product, how will it be used, which rules apply, and what proof exists.
One principle shaped everything. The tool never interprets the Building Code itself and never guesses. It applies rules that have already been published, shows its working, and says so plainly when something can't be worked out.
What I built
Working out the site
- The architect types an address and picks it from a live government address search.
- From the address, the tool works out the council, the climate zone, how far the site is from the coast (which sets the corrosion zone) and how high it sits.
- Some zones only exist inside licensed standards that can't be copied into software. For those, the architect states the zone and the tool marks it as stated, to be checked before consent.
Working out which rules apply
- Each of the 192 product types starts with its own set of Building Code clauses.
- The site and the building then change that set. For weathertightness, the tool calculates a risk score from the wind zone and five facts about the building, the same way the published method does.
- The score decides which route to approval is open. Above ten metres, for example, the standard route closes and the tool says so.
- The rules are stored as conditions and worked out on the spot. Listing every combination would have taken about 140,000 rows.
- Every rule is tied to the exact version of the official document it came from, so it can't go out of date without anyone noticing.
Asking how the product will be used
- Before searching, the architect answers a few questions about how the product will be used. For example: will this cladding be within one metre of a boundary?
- Each answer adds or removes requirements. Answering yes to the boundary question adds two fire clauses, and every product is then checked against them.
- Questions left unanswered change nothing. The tool never assumes.
Comparing products on their evidence
- 855 real products are loaded, each with its supplier's own compliance statement.
- For every product and every clause, the tool works out one of five answers: claimed in detail, claimed in general, not claimed, no statement, or depends on the design.
- Nothing is ever marked as a fail. A supplier not claiming something is not proof that the product doesn't comply.
- Certificates are checked against the government register, and expired ones are flagged.
Showing where every figure came from
- Every figure on a product page links to the exact document it was read from.
- Where nothing has been published, the tool shows a dash. It never fills a gap with a guess.
- Supplier documents are stored separately from the facts read out of them. When the reading improves, every document can be read again without fetching it again.
Keeping track of every data source
- All 111 data sources sit in one register, each with where it comes from, its licence, how often it changes and the rules that apply to it.
- Each source's status is worked out live from the data it actually holds: populated, partly populated, empty or blocked. Nobody types a status in.
- The register shows what is holding things up, such as a data agreement that is still being negotiated.
- Some sources were retired on purpose, with the reason recorded, so the decision can be checked later.
Where it's at
It is a working prototype covering cladding, glazing and the other products that make up the outside of a building.
It runs on real products and real rules. The parts still waiting on outside data are clearly marked as such.
How it was built
Techniques
- Data source register
- A register of all 111 sources that works out its own status from the live data, and doubles as the specification for the build.
- Geospatial database (PostGIS)
- Site lookups ask the database which zone a point on the map falls inside.
- Government mapping data (API)
- Addresses, coastline and elevation come live from the national mapping service. Each answer is saved, so the same site is never looked up twice.
- Rules engine
- Rules are stored as conditions and evaluated when needed, not as one enormous lookup table.
- Version-stamped rules
- Every rule records the version of the official document it came from. A rule can't be confirmed without one.
- Document extraction
- Facts are read out of supplier pages and PDFs, each with a confidence score and a link back to its source.
- Value-level source tracking (provenance)
- Every single value records where it came from.
- Fixed vocabularies (database enums)
- The allowed values are enforced by the database itself, so the same zone can never be stored three different ways.
Tools
- Next.js
- Supabase
- PostGIS
- MapLibre
- LINZ mapping data
Next project
A review reply system→