Skip to content

Latest commit

Β 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 CarbonTrail β€” Follow the Green Money

Climate spending intelligence for Canadian public funding. Track where ~$321B in green money goes, who lobbies for it, and what patterns emerge. Figures are approximate and as of the last data refresh.

GitHub Python Next.js DuckDB

Why This Exists

Canada spends an estimated ~$321B through climate-related departments, and roughly 70,000 lobbying registrations target these departments. These public datasets are normally siloed, and few tools connect them.

CarbonTrail cross-references procurement, grants, and lobbying data to make climate spending transparent. We are pro-climate β€” transparent spending builds public trust. Public trust protects climate budgets.

Features

πŸ“Š Analytics

Feature Description
Dashboard Live stats, top signals, spending timeline (Recharts)
Green Money Flow Sankey diagram: Department β†’ Program β†’ Recipient
Anomaly Detection Spending spikes, sole-source concentration, new vendor signals
Funding Gaps Interactive Canada map, provincial equity analysis

πŸ•΅οΈ Investigation

Feature Description
Lobby ↔ Funding Loops Orgs that lobby AND receive climate $ (2,262 detected)
Greenwash Radar Energy-tax nexus, broad spectrum lobbying patterns
Network Graph Force-directed visualization of org ↔ department connections
Entity Profiles Full dossier: grants, contracts, lobbying, timeline, AI analysis
Compare Side-by-side organization comparison

πŸ€– Intelligence

Feature Description
AI Chat Conversational data exploration (Bedrock/Claude + fallback)
AI Explanations One-click pattern analysis on every entity
Climate Programs Deep-dive into 100+ individual programs with charts

πŸ› οΈ Power Features

Feature Description
⌘K Command Palette Instant search across entities + page navigation
Watchlist Track organizations (localStorage)
CSV Export Download any table as CSV
Print Reports Print-friendly entity profiles
Keyboard Shortcuts Press ? for shortcut panel
Responsive Mobile hamburger menu, auto-collapse sidebar
Toast Notifications Feedback on watchlist, export, share actions

Data Sources

Source Records Coverage
PSPC Contracts 1,261,485 Federal procurement (258K climate-relevant)
Federal Grants 1,276,108 Grants & contributions (113K climate-relevant)
Lobbyist Registry 127,415 All registrations (70K target climate depts)
Lobbyist Subjects 996,271 Subject matter codes
T3010 Charities 83,581 Registered charities
Charity Directors 568,144 Board members

Total: 5.2M+ records analyzed, 747 MB DuckDB database

Tech Stack

Frontend:  Next.js 16 Β· TypeScript Β· Tailwind CSS Β· shadcn/ui Β· Recharts Β· d3-sankey Β· react-force-graph-2d
Backend:   Python FastAPI Β· DuckDB (embedded OLAP)
AI:        AWS Bedrock / Claude (with rule-based fallback)
Data:      Canadian Open Data (Open Government Licence)

Quick Start

# 1. Clone
git clone https://github.com/ctmakc/carbontrail
cd carbontrail

# 2. ETL (one-time β€” downloads nothing, uses local CSVs)
cd backend
pip install -r requirements.txt
python etl/ingest.py     # ~67 seconds, creates 747MB DuckDB

# 3. Backend
uvicorn app.main:app --port 8902

# 4. Frontend (new terminal)
cd frontend
npm install
npm run dev              # http://localhost:3000

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Next.js 16 (18pg) │────▢│   FastAPI (35 endpts)  β”‚
β”‚  Tailwind + shadcn  β”‚     β”‚   13 routers           β”‚
β”‚  Recharts Β· d3      β”‚     β”‚   AI service (Bedrock) β”‚
β”‚  react-force-graph  β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
                               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
                               β”‚  DuckDB (747MB)  β”‚
                               β”‚  17 tables       β”‚
                               β”‚  5.2M records    β”‚
                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Findings

All figures are approximate and as of the last data refresh. They are derived from public records and update whenever the ETL pipeline re-runs. Every item below is a review signal β€” a pattern that may warrant a closer look β€” not an allegation or a finding of wrongdoing. Lobbying is legal and often legitimate, and receiving public funding is not evidence of anything improper. Name cross-matching and keyword tagging are heuristic and can produce false positives, so each signal requires independent verification against the source records.

  • ~$321B tracked in climate-related public spending
  • ~2,262 lobby-to-funding loops detected (org-name cross-match; may include false positives)
  • ~3,559 dual recipients (grants + contracts from same departments)
  • ~$8.6B in contracts recorded as 100% sole-source (e.g. Chantier Davie) β€” a procurement pattern to review, not an irregularity in itself
  • ~2,776 greenwash review signals (anomalous lobbying-breadth patterns)
  • NextStar Energy: ~$14.5B grant alongside 6 lobbying registrations β€” a pattern shown for review, drawn from public records

Principles

🌱 Pro-climate β€” transparency protects green budgets πŸ” Review signals, not allegations β€” careful language always πŸ“Ž Source-linked β€” every finding traces to public records βš–οΈ Responsible β€” "pattern", "signal", "requires verification"

License

MIT


Built with conviction that climate action works better in the light. 🌍

About

🌍 CarbonTrail β€” Follow the Green Money. Climate spending intelligence for Canadian public funding.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages