Skip to content

Add North Carolina and Texas civic data scrapers#181

Draft
ThatXliner wants to merge 8 commits into
migration-based-drizzlefrom
codex/nc-tx-scrapers-consolidated
Draft

Add North Carolina and Texas civic data scrapers#181
ThatXliner wants to merge 8 commits into
migration-based-drizzlefrom
codex/nc-tx-scrapers-consolidated

Conversation

@ThatXliner

Copy link
Copy Markdown
Collaborator

Summary

  • add current-cycle NCSBE candidate, referendum, and result ingestion
  • add current-cycle Texas SOS/TLC election ingestion and current-session Texas Legislature bulk ingestion
  • add Durham City OnBase, Durham County BOCC, and Cedar Park City Council meeting ingestion
  • consolidate all three local sources onto one provider-neutral meeting/document/agenda-item/vote schema and tRPC reader
  • keep election ingestion intentionally limited to the current cycle, with deterministic parsing and source provenance

Verification

  • pnpm --filter @acme/scraper test (26 tests)
  • pnpm --filter @acme/scraper typecheck
  • pnpm --filter @acme/scraper build
  • pnpm --filter @acme/api test (17 tests)
  • pnpm --filter @acme/api typecheck
  • pnpm --filter @acme/api lint
  • pnpm --filter @acme/db typecheck
  • pnpm --filter @acme/expo typecheck
  • pnpm --filter @acme/expo lint
  • git diff --check

Closes #165
Closes #166
Closes #167
Closes #168
Closes #169
Closes #170

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
billion-nextjs Ready Ready Preview, Comment Jul 22, 2026 4:05pm

@ThatXliner

Copy link
Copy Markdown
Collaborator Author

Deployment note: before enabling these scrapers in production, apply the included database migrations and ensure the scraper runtime has outbound network access to the official public source hosts. No new API keys are required; OPEN_STATES_API_KEY is optional for Texas Legislature identity matching.

@ThatXliner

Copy link
Copy Markdown
Collaborator Author

Source inventory and app-presentation follow-up

Official sources added

  • NCSBE: current-cycle candidate CSVs, referendum PDFs, and election-result ZIP/TSV files, with exact provenance and certification state.
  • Texas SOS: structured Civix feeds for contests, candidates, propositions, county totals, turnout, reporting status, and outcomes.
  • Texas Legislative Council: constitutional-amendment analysis PDFs with ballot language, neutral analysis, fiscal effects, and supporter/opponent arguments with page citations.
  • Texas Legislature bulk service: current-session history XML and bill text, analyses, fiscal notes, sponsors, subjects, actions, documents, and published votes.
  • Durham County Legistar: BOCC meetings, items, actions, documents, cancellations/revisions, and named votes.
  • Durham OnBase: City Council meetings, agenda/minutes outlines, item detail, attachments, and official action text.
  • Cedar Park CivicEngage/Municode: Council meetings, agendas, packets, minutes, motions/outcomes, and votes.

These are public official sources. Only POSTGRES_URL is required; OPEN_STATES_API_KEY is optional for Texas bill identity matching.

Backend and operations

This adds civic.getNcElectionData, civic.getTexasCurrentElection, content.texasBills, and provider-neutral localGovernment readers. The scrapers are registered in the CLI and all, but this PR does not deploy a production cron; continuous collection still needs scheduled jobs.

Current app integration: partial

Upcoming meetings use the new API, and Texas official measure data can enrich Civic measures at the API layer. However:

  • Expo still explicitly blocks ballots outside California.
  • NC/Texas election readers and content.texasBills have no direct Expo consumer.
  • “Local Bills” still uses the older live Legistar route.
  • Meeting cards link out instead of rendering stored agenda items/votes.
  • Meetings are not scoped from the saved address.

Proposed presentation

  1. Your Ballot: keep Google Civic for address resolution/ballot order, then merge matching official NC/Texas rows. Show source, freshness, certification, and field-level citations.
  2. Results: only show the same election cycle/date; label unofficial vs. certified and reject stale results.
  3. Your State Legislature: add a separate bills surface with session/chamber/status filters and detail for sponsors, actions, votes, text, analyses, and fiscal notes.
  4. City & County Meetings: address-scope the jurisdiction and add a detail screen for agenda items, outcomes, named votes, and official documents.
  5. Operations: schedule each source and expose last-success/freshness diagnostics.

Recommendation: keep state legislation and council agenda items as distinct destinations because their lifecycles and user expectations differ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment