← All works

Lex Terrae

Which laws apply here?

A library of Canadian law, sorted by where it applies. Name a place and Lex Terrae lists every document that covers it, from the local by-law up to federal statute.

Year
2026
Type
Web app
Built with
React, Cloudflare Workers, Neon Postgres
Status
Live
Lex Terrae showing what applies in Squamish, British Columbia: a panel for downloading an AI reference package, a search box, and the Squamish Building Bylaw listed under the district municipality.
Everything that applies in Squamish, grouped from the most local jurisdiction up.

One place for every layer of law

Canadian law comes in layers. Parliament makes federal law, the provinces and territories make their own, and regional districts, municipalities and First Nations add by-laws on top. Each government publishes on its own website, in its own way.

Lex Terrae puts those layers in one place and organizes them by geography. Pick a place and you see its own documents, then those of every jurisdiction that contains it: Squamish, then the Squamish-Lillooet Regional District, then British Columbia, then Canada.

Start from where you are

  • The place, not the government

    Most people know where they are, not which level of government regulates what. One search answers the question for every jurisdiction that matters there.

  • Nesting handled for you

    A British Columbia statute applies in Squamish; a Squamish by-law doesn’t apply in the rest of the province. Each document is tagged once, where it belongs, and shows up everywhere inside that jurisdiction.

  • Ready to hand to an AI

    One button bundles every applicable document into a single reference file for Claude, ChatGPT or Gemini, with an estimate of whether it’s small enough to read in full. The assistant answers from the actual text, not from memory.

  • Your location stays yours

    “Use my location” works out your jurisdiction inside the browser from the map boundaries. Only the jurisdiction is sent to the server, never your coordinates.

From a map to a reading list

  1. 01

    Find a place

    Search about 4,800 municipalities, regional districts, provinces, territories and First Nations, or let the browser find you. The list is built from Statistics Canada’s census boundaries.

    The Where are you? screen with a Use my location button and a search for Squamish returning the District of Squamish and the Squamish-Lillooet Regional District.
  2. 02

    Tag documents on the map

    Behind the scenes, editors upload a document (PDF, Word, Excel, plain text and more) and mark where it applies on a map of Canada. Federal law covers the whole country, and Quebec is set apart as the civil-law province. Anyone can look things up; only approved editors can add to the library.

    The editor's jurisdiction map of Canada with Federal and all of British Columbia selected, Quebec shaded as civil law, and a legend below.
  3. 03

    Drill down to the town

    Zoom into a province to tag a single region, municipality or Indigenous land. British Columbia alone has 630 of them. If one is missing, an editor can add it.

    A zoomed-in map of British Columbia showing municipal and Indigenous boundaries, with Squamish labelled as selected.

How it’s built

Front end
React and TypeScript, with D3 and TopoJSON drawing the maps
Back end
Hono on a single Cloudflare Worker that also serves the app
Data
Neon Postgres, with uploaded files in Cloudflare R2
Boundaries
Statistics Canada census subdivisions, under the Open Government Licence – Canada