# patillokesh9356/detect-carbon-footprint-tracker- architecture

> Architecture diagram of the GitHub repository patillokesh9356/detect-carbon-footprint-tracker-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/patillokesh9356/detect-carbon-footprint-tracker-
- Repository: https://github.com/patillokesh9356/detect-carbon-footprint-tracker-

## Overview

Carbon Footprint Tracker lets users register or log in, record category-based activities, and review emissions, history, and monthly trends; it also provides reduction suggestions and reduction goals. The React app communicates with a Flask API, which calculates emissions and reads or writes Supabase data. The graph separates the API’s domain responsibilities, though those handlers share one source file. Frontend request wiring for goals and suggestions is not shown in the sampled excerpt, so those links are omitted.

Main entry points: [`backend/app.py`](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py) (Flask API), [`backend/supabase_client.py`](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/supabase_client.py) (Supabase client), [`frontend/src/main.jsx`](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/frontend/src/main.jsx) (React entry), [`frontend/src/App.jsx`](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/frontend/src/App.jsx) (Dashboard and forms)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_entry["React entry<br/>[main.jsx]"]
  node_app["Dashboard and forms<br/>[App.jsx]"]
end

subgraph group_api["API workflows"]
  node_api_routes["Flask API<br/>[app.py]"]
  node_auth["Registration and login<br/>[app.py]"]
  node_activity["Activity tracking<br/>[app.py]"]
  node_analytics["Emission summaries<br/>[app.py]"]
  node_goals["Reduction goals<br/>[app.py]"]
  node_suggestions_route["Suggestions endpoint<br/>[app.py]"]
end

subgraph group_domain["Emission guidance"]
  node_factors["Emission factors"]
  node_guidance["Category guidance<br/>[suggestions.py]"]
end

subgraph group_persistence["Persistence"]
  node_supabase_client["Supabase client<br/>[supabase_client.py]"]
  node_supabase[("Supabase store")]
end

node_user(("Tracker user"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"HTTP requests"| node_api_routes
node_api_routes -->|"dispatches auth"| node_auth
node_api_routes -->|"dispatches activities"| node_activity
node_api_routes -->|"dispatches summaries"| node_analytics
node_api_routes -->|"dispatches goals"| node_goals
node_api_routes -->|"dispatches tips"| node_suggestions_route
node_activity -->|"calculates emissions"| node_factors
node_activity -->|"gets tips"| node_guidance
node_suggestions_route -->|"gets tips"| node_guidance
node_analytics -->|"queries activities"| node_supabase_client
node_activity -->|"stores and reads"| node_supabase_client
node_auth -->|"checks and stores users"| node_supabase_client
node_goals -->|"stores and reads goals"| node_supabase_client
node_supabase_client -->|"queries"| node_supabase

click node_entry "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/frontend/src/main.jsx"
click node_app "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/frontend/src/App.jsx"
click node_api_routes "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py"
click node_auth "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py"
click node_activity "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py"
click node_analytics "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py"
click node_goals "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py"
click node_suggestions_route "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py"
click node_factors "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/emission_factors.py"
click node_guidance "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/suggestions.py"
click node_supabase_client "https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/supabase_client.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_entry,node_app,node_user toneBlue
class node_api_routes,node_auth,node_activity,node_analytics,node_goals,node_suggestions_route toneAmber
class node_factors,node_guidance toneMint
class node_supabase_client,node_supabase toneRose
```

## Components

### User interface

- [React entry](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Dashboard and forms](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### API workflows

- [Flask API](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py): `backend/app.py`
- [Registration and login](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py): `backend/app.py`
- [Activity tracking](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py): `backend/app.py`
- [Emission summaries](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py): `backend/app.py`
- [Reduction goals](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py): `backend/app.py`
- [Suggestions endpoint](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/app.py): `backend/app.py`

### Emission guidance

- [Emission factors](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/emission_factors.py): `backend/emission_factors.py`
- [Category guidance](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/suggestions.py): `backend/suggestions.py`

### Persistence

- [Supabase client](https://github.com/patillokesh9356/detect-carbon-footprint-tracker-/blob/main/backend/supabase_client.py): `backend/supabase_client.py`
- **Supabase store**

### Other components

- **Tracker user**

## Connections

- Tracker user → React entry: opens app
- React entry → Dashboard and forms: renders
- Dashboard and forms → Flask API: HTTP requests
- Flask API → Registration and login: dispatches auth
- Flask API → Activity tracking: dispatches activities
- Flask API → Emission summaries: dispatches summaries
- Flask API → Reduction goals: dispatches goals
- Flask API → Suggestions endpoint: dispatches tips
- Activity tracking → Emission factors: calculates emissions
- Activity tracking → Category guidance: gets tips
- Suggestions endpoint → Category guidance: gets tips
- Emission summaries → Supabase client: queries activities
- Activity tracking → Supabase client: stores and reads
- Registration and login → Supabase client: checks and stores users
- Reduction goals → Supabase client: stores and reads goals
- Supabase client → Supabase store: queries
