# carbon-offset-open-platform/carbon-offset-open-platform.github.io architecture

> Architecture diagram of the GitHub repository carbon-offset-open-platform/carbon-offset-open-platform.github.io, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io
- Repository: https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io

## Overview

SCOOP is a static public-facing site for presenting its measurement work, backed by a read-only measurement API and a separate account system. The principal documented runtime path is a visitor requesting measurement summaries or emissions from the API, which reads the bundled SQLite snapshot. The site tree also indicates interactive 3D, timeline, feature and authentication experiences, but their wiring was not sampled, so those links are left unverified. Authentication supports Vercel OAuth and password accounts backed by Postgres. Relationships involving the frontend are limited by the available excerpts.

Main entry points: [`index.html`](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/index.html) (Landing page), [`api/auth.py`](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/auth.py) (Auth routes), [`api/index.py`](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/index.py) (Public API), [`api/db.py`](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/db.py) (User persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Public site"]
  node_site_entry["Landing page<br/>[index.html]"]
  node_features["Feature experience<br/>[features.js]"]
  node_globe["3D globe<br/>[globe.js]"]
  node_measured_viz["Measured 3D view<br/>[measured-3d.js]"]
  node_timeline["Earth timeline<br/>[earth-timeline.js]"]
  node_auth_ui["Auth interface<br/>[auth.js]"]
end

subgraph group_measurement["Measurement API"]
  node_api["Public API<br/>[index.py]"]
  node_snapshot[("Measurement snapshot<br/>[scoop_public.db]")]
end

subgraph group_accounts["Accounts"]
  node_auth["Auth routes<br/>[auth.py]"]
  node_passwords["Password and sessions<br/>[passwords.py]"]
  node_user_db[("User persistence<br/>[db.py]")]
end

node_visitor(("Visitor"))
node_vercel["Vercel identity"]
node_postgres[("Postgres")]

node_visitor -->|"opens"| node_site_entry
node_visitor -.->|"requests data"| node_api
node_site_entry -.->|"loads"| node_features
node_site_entry -.->|"loads"| node_globe
node_site_entry -.->|"loads"| node_measured_viz
node_site_entry -.->|"loads"| node_timeline
node_site_entry -.->|"loads"| node_auth_ui
node_api -->|"queries"| node_snapshot
node_api -->|"includes routes"| node_auth
node_auth -->|"reads and writes"| node_user_db
node_auth -->|"uses"| node_passwords
node_auth -->|"exchanges tokens"| node_vercel
node_auth -.->|"persists users"| node_postgres
node_user_db -->|"connects"| node_postgres

click node_site_entry "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/index.html"
click node_features "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/assets/features.js"
click node_globe "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/assets/globe.js"
click node_measured_viz "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/assets/measured-3d.js"
click node_timeline "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/assets/earth-timeline.js"
click node_auth_ui "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/assets/auth.js"
click node_api "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/index.py"
click node_snapshot "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/scoop_public.db"
click node_auth "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/auth.py"
click node_passwords "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/passwords.py"
click node_user_db "https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/db.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_site_entry,node_features,node_globe,node_measured_viz,node_timeline,node_auth_ui toneBlue
class node_api,node_snapshot,node_postgres toneAmber
class node_auth,node_passwords,node_user_db toneMint
class node_visitor,node_vercel toneIndigo
```

## Components

### Public site

- [Landing page](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/index.html): `index.html`
- [Feature experience](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/assets/features.js): `assets/features.js`
- [3D globe](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/assets/globe.js): `assets/globe.js`
- [Measured 3D view](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/assets/measured-3d.js): `assets/measured-3d.js`
- [Earth timeline](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/assets/earth-timeline.js): `assets/earth-timeline.js`
- [Auth interface](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/assets/auth.js): `assets/auth.js`

### Measurement API

- [Public API](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/index.py): `api/index.py`
- [Measurement snapshot](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/scoop_public.db): `api/scoop_public.db`

### Accounts

- [Auth routes](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/auth.py): `api/auth.py`
- [Password and sessions](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/passwords.py): `api/passwords.py`
- [User persistence](https://github.com/carbon-offset-open-platform/carbon-offset-open-platform.github.io/blob/main/api/db.py): `api/db.py`

### Other components

- **Visitor**
- **Vercel identity**
- **Postgres**

## Connections

- Visitor → Landing page: opens (evidence: `README.md`)
- Visitor → Public API: requests data
- Landing page → Feature experience: loads
- Landing page → 3D globe: loads
- Landing page → Measured 3D view: loads
- Landing page → Earth timeline: loads
- Landing page → Auth interface: loads
- Public API → Measurement snapshot: queries (evidence: `api/index.py`)
- Public API → Auth routes: includes routes (evidence: `api/index.py`)
- Auth routes → User persistence: reads and writes (evidence: `api/auth.py`)
- Auth routes → Password and sessions: uses (evidence: `api/auth.py`)
- Auth routes → Vercel identity: exchanges tokens (evidence: `api/auth.py`)
- Auth routes → Postgres: persists users
- User persistence → Postgres: connects (evidence: `api/db.py`)
