HomeCase studiesEnterprise ESG Carbon Footprint Tracking SaaS Built...

Case study · Oslo, Norway

Enterprise ESG Carbon Footprint Tracking SaaS Built with Python, React, and Auditable PostgreSQL Ledgers

ESG Scope 1-3 Emissions Accounting

Corporate sustainability teams preparing CSRD and GHG Protocol disclosures often drown in brittle spreadsheets where emission factors change silently and Scope 3 supplier estimates cannot be traced back to source invoices. We engineered a multi-tenant carbon footprint tracking SaaS in Oslo using Python, React, and PostgreSQL to turn utility bills, fleet fuel logs, and procurement records into auditable Scope 1, 2, and 3 inventories. Every calculated tonne of CO2e links deterministically to versioned emission-factor registries, unit-conversion trails, and immutable calculation snapshots ready for third-party assurance.

Industry
ESG Scope 1-3 Emissions Accounting
Solution
A multi-tenant web SaaS platform built with Python, React, and PostgreSQL that automates Scope 1-3 activity data ingestion, versioned emission-factor calculation, and assurance-ready ESG reporting.
Platforms
Web & API
Stack
Python · React · PostgreSQL · FastAPI · TypeScript · Celery
Location
Oslo, Norway · delivered remotely
Role
Engineering, with the team behind for mobile and QA

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.

01 — Questions

asked about this kind of project

How does PostgreSQL guarantee that historical carbon reports stay reproducible when emission factors update annually?

Emission factors (such as grid carbon intensity from DEFRA or national electricity registries) are stored as immutable temporal rows with valid_from, valid_to, and source_version metadata. Each calculated emission entry records the exact factor ID and unit-conversion path used, ensuring last year's audited inventory never shifts silently.

How do you handle mixed units—liters of diesel, megawatt-hours, ton-kilometers, and spend-based currencies—without rounding errors?

Python ingestion pipelines pass every activity record through strict Pint physical-unit validation and decimal arithmetic before multiplication. Unsupported unit conversions fail loudly in an ingestion quarantine queue rather than silently dropping records or mis-scaling kilograms into metric tonnes.

Why isolate tenant data with PostgreSQL Row-Level Security in a multi-tenant ESG SaaS?

Sustainability disclosures include sensitive facility energy consumption, supplier spend, and operational structures. Enforcing tenant_id predicates at the PostgreSQL RLS layer guarantees isolation even across complex recursive organizational hierarchy queries.

How does the platform distinguish between primary supplier activity data and spend-based Scope 3 estimates?

Every Scope 3 line item carries a standardized data-quality tier (primary metered, secondary physical average, or spend-based EEIO) stored alongside uncertainty bounds. React dashboards surface exact coverage ratios so ESG teams track their transition from spend estimates to verified supplier figures.

Can external assurance auditors inspect calculations without gaining permission to modify tenant records?

Yes. Tenant admins issue time-boxed, read-only auditor roles scoped to specific reporting periods. Auditors click any aggregated Scope 1, 2, or 3 total in React to trace the full lineage back to raw uploaded invoices, conversion formulas, and factor citations.

How are corporate acquisitions, divestitures, and base-year recalculations modeled?

The PostgreSQL organization graph tracks entity ownership percentages and effective dates over time. When a subsidiary is divested or acquired, Python rollup engines recalculate base-year pro-forma baselines in parallel while preserving the original published historical snapshot for audit comparison.

03 — Similar project?

describe what is different about yours

Build yours.

Tell me what exists, what you need and the deadline. Fixed price for a defined scope, or $55/day (8–9 hours work) with a written plan first.

Solitaire Corporate Park, Makarba, Ahmedabad, Gujarat 380015, India · IST (UTC+5:30) · --:-- IST · Mon–Fri 09:00–18:00 IST · US & EU overlap daily

No newsletter, no CRM. Just a reply.