Delivered remotely for a business based in Oslo, Norway. Names withheld by agreement.
Project Overview
Under European CSRD and global GHG Protocol mandates, corporate carbon accounting has shifted from voluntary marketing estimates to board-level financial-grade reporting. Yet most mid-market and enterprise sustainability teams still assemble Scope 1, 2, and 3 inventories inside sprawling linked spreadsheets—manually copying kWh utility totals, looking up PDF emission-factor tables, and losing track of which subsidiary boundary or currency rate applied to last quarter's numbers.
Engineered for Nordic and European enterprises from Oslo, this carbon footprint tracking SaaS replaces fragile spreadsheets with a deterministic Python calculation kernel, a responsive React disclosure workspace, and an auditable PostgreSQL data ledger. Finance, procurement, and ESG leads collaborate in one multi-tenant system where every tonne of CO2e remains traceable from boardroom summary down to source invoice and emission-factor citation.
Accounting & Audit Bottlenecks
Building software capable of surviving limited and reasonable external assurance exposes structural flaws in naive analytics tools:
- Silent factor drift: Overwriting last year's grid emission factor in a shared lookup table retroactively alters closed historical reports, failing external audit reproducibility checks.
- Unit and boundary mismatches: Combining facility electricity (kWh), fleet fuel (liters), maritime freight (tkm), and Scope 3 procurement spend across multiple currencies invites catastrophic factor-of-1,000 conversion bugs.
- Dynamic corporate structures: Mergers, leased-asset changes, and equity-share boundaries shift year over year, requiring pro-forma base-year restatements without erasing original disclosures.
- Opaque Scope 3 estimation: Procurement teams struggle to separate high-confidence primary supplier data from coarse economic input-output (EEIO) spend estimates inside aggregate dashboards.
Architectural Strategy
We treated carbon accounting with the rigor of a financial general ledger. Every emission calculation executes in Python using exact Decimal precision and explicit dimensional analysis, persisting immutable calculation entries alongside foreign keys to exact emission-factor versions and source evidence documents.
PostgreSQL manages both hierarchical organizational structures—supporting operational control and equity-share consolidation—and strict Row-Level Security (RLS) across tenants. React renders fast organizational drill-downs, scenario modeling, and data-quality waterfalls without duplicating any calculation math inside the browser.
Core Capabilities
- Automated Multi-Scope Activity Ingestion: Parses ERP procurement exports, fleet fuel cards, utility CSVs, and facility telemetry via mapped Celery pipelines with row-level error quarantine.
- Versioned Emission Factor Engine: Maintains curated, time-bounded DEFRA, EPA, IPCC, and regional electricity-grid factors supporting both location-based and market-based Scope 2 accounting (including Guarantee of Origin certificates).
- Hierarchical Entity Consolidation: Models complex parent-subsidiary trees, joint ventures, and reporting-period boundaries with automated base-year recalculation workflows.
- Scope 3 Data-Quality Tracking: Classifies every supply-chain emission entry by primary versus spend-based tier, guiding procurement teams toward high-impact supplier engagement.
- Interactive Auditor Drill-Down & Export Packs: Read-only assurance portal exposes complete calculation formulas, unit conversions, and source PDFs alongside ESRS E1 disclosure tables.
Technical Architecture
Tenant administrators and facility managers upload operational logs or connect ERP feeds through the React TypeScript web app. FastAPI validates schemas, stores raw evidence files in encrypted object storage, and enqueues bulk normalization tasks onto Redis-backed Celery workers.
Flow: React & TypeScript SaaS Portal → Python FastAPI Gateway → Celery & Redis Ingestion Workers → Python Unit & Factor Engine → PostgreSQL (RLS & Immutable GHG Ledger) → Audit Export & ESRS Disclosure Packs
During calculation runs, Python workers resolve the appropriate facility region, reporting timestamp, and accounting method (market vs. location), select the matching immutable emission-factor row in PostgreSQL, and write a self-contained ledger record capturing input value, unit conversion multiplier, gas breakdown (CO2, CH4, N2O, and total CO2e), and factor citation.
Technology Stack
| Category | Technology detail |
|---|---|
| SaaS Web Workspace | React 18 & TypeScript with interactive org-tree & drill-down analytics |
| Emissions Calculation Core | Python 3.12 with FastAPI, Pydantic, and Pint physical-unit conversion |
| Relational Ledger & Isolation | PostgreSQL 16 with Row-Level Security (RLS) and temporal factor tables |
| Async Ingestion & Rollups | Celery workers with Redis broker for bulk ERP/CSV normalization |
| Emission Factor Registry | Versioned DEFRA, EPA, IPCC, and ecoinvent-compatible factor tables |
| Authentication & SSO | OIDC / SAML 2.0 enterprise SSO with scoped RBAC & auditor read-only roles |
| Document & Evidence Store | Encrypted S3 object storage for utility invoices and assurance exports |
| Export & Disclosure Engine | Python generators for CSRD/ESRS E1 tables, XBRL-ready JSON, and audit packs |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Recalculating millions of Scope 3 procurement lines synchronously stalls UI updates | Offloaded bulk ingestion and entity-tree rollups to idempotent Celery workers updating materialized summary tables in PostgreSQL; introduces brief asynchronous refresh states while keeping the React UI responsive. |
| Floating-point math causes penny-like rounding discrepancies across subsidiary rollups | Enforced Python Decimal arithmetic end-to-end and stored fixed-precision NUMERIC columns in PostgreSQL; marginally heavier CPU cost per row in exchange for exact cross-table reconciliation. |
| Custom regional supplier emission factors conflict with standard public registries | Implemented a layered factor-resolution hierarchy (custom verified supplier factor → national registry → global default) with explicit precedence logs on every record. |
| External auditors require full visibility without risking accidental edits | Built dedicated read-only auditor tokens and immutable period-lock snapshots rather than exporting static disconnected spreadsheets. |
Security & Reliability
Enterprise sustainability platforms hold sensitive operational cost, supplier, and energy metrics. Authentication integrates directly with corporate OIDC and SAML 2.0 identity providers, issuing scoped tokens paired with granular facility-level permissions. At the database tier, PostgreSQL Row-Level Security enforces hard tenant isolation on every query session so application-layer bugs cannot leak cross-tenant emissions data.
Every period close locks calculated ledger partitions against silent mutation; subsequent corrections require explicit adjustment entries with reason codes, preserving a clean, chronological audit trail matching financial accounting standards.
Performance & Scale
Annual reporting deadlines concentrate bulk procurement uploads and multi-year scenario modeling into narrow calendar quarters. Celery worker pools partition large CSV and ERP batches into parallel chunks, validating units and resolving emission factors concurrently without exhausting FastAPI web workers.
To keep React dashboards snappy across conglomerates spanning hundreds of legal entities, PostgreSQL maintains pre-aggregated reporting-period rollup tables updated incrementally per entity change. Recursive CTE queries resolve equity-share ownership trees rapidly, allowing sustainability officers to slice emissions by scope, GHG category, country, or data-quality tier in real time.
Operational Outcomes
Moving corporate emissions management from disconnected spreadsheets onto a deterministic Python, React, and PostgreSQL platform transformed reporting cycles for sustainability and finance teams:
- Full lineage from summary to invoice: Sustainability controllers trace every reported metric back to exact source uploads, unit math, and versioned emission-factor citations during external assurance.
- Elimination of unit and factor-version errors: Automated physical-unit checks and immutable temporal factor tables prevent silent historical restatements or conversion slips.
- Clear visibility into Scope 3 maturity: Procurement teams distinguish measured supplier emissions from spend-based proxies, focusing engagement where data quality matters most.
- Streamlined multi-entity consolidation: Corporate boundary updates and base-year adjustments execute consistently across subsidiaries without rebuilding complex spreadsheet formulas.