Explore and compare U.S. local laws with full-text search, filters, jurisdiction aggregates, and an interactive map. The current corpus is LOCUS-v1, covering roughly 2.2 million local ordinances.
With Docker running:
docker compose upThis starts Postgres and the app, applies migrations, loads the default sample on a fresh database, and serves the app at http://localhost:3000.
Useful Docker commands:
pnpm up # same as docker compose up
pnpm up:build # rebuild before starting
pnpm db:down # stop the database and appIf you move or rename the repository directory, recreate the containers:
docker compose up -d --force-recreateRun Postgres in Docker and the app on your machine:
pnpm install
cp .env.example .env.local
pnpm db:up
pnpm prisma:deploy
pnpm devPrefer pnpm prisma:deploy to apply existing migrations. Use pnpm prisma:migrate only when creating a new migration.
Load the default sample:
pnpm seed --limit 25000Load the complete corpus:
pnpm db:up
pnpm seedYou can also seed from the app container:
docker compose exec app pnpm seedHelpful options:
pnpm seed --fresh # reset and reseed
pnpm seed --limit 1000 # small local sample
pnpm seed --shards 0,1 # selected data shards
pnpm seed --shards '' # rebuild aggregates, city fills and fines (no corpus COPY)The default 25k sample is Alaska-only (start of shard 0). On a disposable local database,
replace it with Colorado (Pagosa Springs, El Paso County) using the following.
--fresh deletes existing laws and derived data:
pnpm seed --fresh --shards 1 --limit 25000New imports resume from database-owned progress; rerun without --fresh to continue.
--limit caps the total stored laws, not additional rows. Older partial imports may
require reconciliation; the seeder will stop rather than guess a resume position.
After applying the city-index migration on a database that already has laws, recompute county aggregates:
pnpm seed --shards ''pnpm seed also loads the LOCUS-Fines
supplement, which annotates laws with the fines they state. To (re)build just that layer on a
database that already has laws:
pnpm prisma:deploy
pnpm build:finesOnly annotated rows are stored, so a law with no fine record was not checked — not that it carries no fine. Amounts are checked against the source text; the surrounding labels are not.
pnpm dev
pnpm build
pnpm typecheck
pnpm lint
pnpm test
pnpm db:studioAdditional regression checks:
All tests live in tests/: unit/ mirrors source paths, integration/ contains
database fixtures, and browser/ contains Playwright specs. pnpm test discovers
unit tests automatically; the other suites run separately.
pnpm test:integration # Docker required; disposable database only
pnpm exec playwright install chromium # once
pnpm build && pnpm test:browser # mocked APIs, localhost:3100This project uses the LOCUS-v1 corpus.
@article{peskoff2026freeing,
title={Freeing the Law with LOCUS: A Local Ordinance Corpus for the United States},
author={Peskoff, Denis and Barrow, Joe and Vu, Christopher and Davenport, Diag},
journal={arXiv preprint arXiv:2606.19334},
year={2026}
}Contribution guidance is in CONTRIBUTING.md.
Licensed under Business Source License 1.1 (BUSL-1.1); see LICENSE.