# kaustubh-hub/go-green architecture

> Architecture diagram of the GitHub repository kaustubh-hub/go-green, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kaustubh-hub/go-green
- Repository: https://github.com/kaustubh-hub/go-green

## Overview

Go Green is a static sustainability website centered on helping visitors understand and reduce personal environmental impact. Its main interactive workflow is entering electricity, gas, and driving use in the footprint calculator, viewing a calculated monthly and annual result with category breakdowns and tailored tips, and optionally retaining the latest result in browser storage. Other documented capabilities include emission statistics, general green tips, and SDG information. The available evidence shows calculator and shared authentication behavior; page-to-page wiring for the other capabilities is not established.

Main entry points: [`calculator.js`](https://github.com/kaustubh-hub/go-green/blob/main/calculator.js) (Calculate and display), [`CAL.html`](https://github.com/kaustubh-hub/go-green/blob/main/CAL.html) (Calculator page), [`login.html`](https://github.com/kaustubh-hub/go-green/blob/main/login.html) (Login and signup), [`user.js`](https://github.com/kaustubh-hub/go-green/blob/main/user.js) (Shared auth state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_footprint["Footprint tracking"]
  node_calculator_page["Calculator page<br/>[CAL.html]"]
  node_calculator_logic["Calculate and display<br/>[calculator.js]"]
  node_footprint_storage[("Latest footprint")]
  node_emission_stats["Emission statistics"]
end

subgraph group_account["Account state"]
  node_auth_pages["Login and signup<br/>[login.html]"]
  node_auth_state["Shared auth state<br/>[user.js]"]
end

subgraph group_guidance["Sustainability guidance"]
  node_green_tips["Green tips<br/>[tips.html]"]
  node_sdg_info["SDG information<br/>[sdg.html]"]
  node_topic_pages["Sustainability topics<br/>[agriculture.html]"]
end

node_visitor(("Visitor"))

node_visitor -->|"enters data"| node_calculator_page
node_calculator_page -->|"submits form"| node_calculator_logic
node_calculator_logic -->|"renders results"| node_calculator_page
node_calculator_logic -->|"stores result"| node_footprint_storage
node_auth_pages -.->|"renders auth state"| node_auth_state
node_visitor -.->|"uses account pages"| node_auth_pages

click node_calculator_page "https://github.com/kaustubh-hub/go-green/blob/main/CAL.html"
click node_calculator_logic "https://github.com/kaustubh-hub/go-green/blob/main/calculator.js"
click node_emission_stats "https://github.com/kaustubh-hub/go-green/blob/main/emission-stats.html"
click node_auth_pages "https://github.com/kaustubh-hub/go-green/blob/main/login.html"
click node_auth_state "https://github.com/kaustubh-hub/go-green/blob/main/user.js"
click node_green_tips "https://github.com/kaustubh-hub/go-green/blob/main/tips.html"
click node_sdg_info "https://github.com/kaustubh-hub/go-green/blob/main/sdg.html"
click node_topic_pages "https://github.com/kaustubh-hub/go-green/blob/main/agriculture.html"

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_calculator_page,node_calculator_logic,node_footprint_storage,node_emission_stats toneBlue
class node_auth_pages,node_auth_state toneAmber
class node_green_tips,node_sdg_info,node_topic_pages toneMint
class node_visitor toneIndigo
```

## Components

### Footprint tracking

- [Calculator page](https://github.com/kaustubh-hub/go-green/blob/main/CAL.html): `CAL.html`
- [Calculate and display](https://github.com/kaustubh-hub/go-green/blob/main/calculator.js): `calculator.js`
- **Latest footprint**
- [Emission statistics](https://github.com/kaustubh-hub/go-green/blob/main/emission-stats.html): `emission-stats.html`

### Account state

- [Login and signup](https://github.com/kaustubh-hub/go-green/blob/main/login.html): `login.html`
- [Shared auth state](https://github.com/kaustubh-hub/go-green/blob/main/user.js): `user.js`

### Sustainability guidance

- [Green tips](https://github.com/kaustubh-hub/go-green/blob/main/tips.html): `tips.html`
- [SDG information](https://github.com/kaustubh-hub/go-green/blob/main/sdg.html): `sdg.html`
- [Sustainability topics](https://github.com/kaustubh-hub/go-green/blob/main/agriculture.html): `agriculture.html`

### Other components

- **Visitor**

## Connections

- Visitor → Calculator page: enters data
- Calculator page → Calculate and display: submits form (evidence: `calculator.js`)
- Calculate and display → Calculator page: renders results (evidence: `calculator.js`)
- Calculate and display → Latest footprint: stores result (evidence: `calculator.js`)
- Login and signup → Shared auth state: renders auth state
- Visitor → Login and signup: uses account pages
