# phani05040/summerpro architecture

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

- Interactive diagram: https://gitdiagram.com/phani05040/summerpro
- Repository: https://github.com/phani05040/summerpro

## Overview

EcoTrack is a carbon-footprint and sustainable-habit tracker. Its intended user journey spans footprint calculation, daily habit logging, history and settings, personalized suggestions, and badges. The frontend currently contains placeholder pages; the sampled code does not show those pages calling the API client, so the graph shows the available client/server wiring without asserting a complete UI workflow. The backend route implementations and external-service calls are sampled; frontend feature wiring beyond routing is uncertain.

Main entry points: [`backend/app.py`](https://github.com/phani05040/summerpro/blob/main/backend/app.py) (Flask app), [`backend/routes/habits.py`](https://github.com/phani05040/summerpro/blob/main/backend/routes/habits.py) (Habit records), [`backend/routes/suggestions.py`](https://github.com/phani05040/summerpro/blob/main/backend/routes/suggestions.py) (Suggestion generation), [`backend/routes/carbon_interface.py`](https://github.com/phani05040/summerpro/blob/main/backend/routes/carbon_interface.py) (Carbon estimates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_webapp["Page routing<br/>[app.jsx]"]
  node_webentry["React entry<br/>[main.jsx]"]
  node_apiclient["API client<br/>[api.js]"]
  node_badges["Badge evaluation<br/>[badges.js]"]
end

subgraph group_backend["Backend API"]
  node_server["Flask app<br/>[app.py]"]
  node_calculator["Footprint calculator<br/>[calculator.py]"]
  node_habits["Habit records<br/>[habits.py]"]
  node_suggestions["Suggestion generation<br/>[suggestions.py]"]
  node_carbon["Carbon estimates"]
end

subgraph group_integrations["External services"]
  node_firestore[("Firestore")]
  node_groq["Groq API"]
  node_carboninterface["Carbon Interface"]
end

node_user(("User"))

node_user -->|"navigates"| node_webapp
node_webentry -->|"renders"| node_webapp
node_apiclient -->|"HTTP requests"| node_server
node_server -->|"dispatches"| node_calculator
node_server -->|"dispatches"| node_habits
node_server -->|"dispatches"| node_suggestions
node_server -->|"dispatches"| node_carbon
node_habits -->|"reads and writes"| node_firestore
node_suggestions -->|"requests completions"| node_groq
node_carbon -->|"requests estimates"| node_carboninterface

click node_webapp "https://github.com/phani05040/summerpro/blob/main/frontend/src/app.jsx"
click node_webentry "https://github.com/phani05040/summerpro/blob/main/frontend/src/main.jsx"
click node_apiclient "https://github.com/phani05040/summerpro/blob/main/frontend/src/api.js"
click node_badges "https://github.com/phani05040/summerpro/blob/main/frontend/src/badges.js"
click node_server "https://github.com/phani05040/summerpro/blob/main/backend/app.py"
click node_calculator "https://github.com/phani05040/summerpro/blob/main/backend/routes/calculator.py"
click node_habits "https://github.com/phani05040/summerpro/blob/main/backend/routes/habits.py"
click node_suggestions "https://github.com/phani05040/summerpro/blob/main/backend/routes/suggestions.py"
click node_carbon "https://github.com/phani05040/summerpro/blob/main/backend/routes/carbon_interface.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_webapp,node_webentry,node_apiclient,node_badges,node_user toneBlue
class node_server,node_calculator,node_habits,node_suggestions,node_carbon toneAmber
class node_firestore,node_groq,node_carboninterface toneMint
```

## Components

### Web interface

- [Page routing](https://github.com/phani05040/summerpro/blob/main/frontend/src/app.jsx): `frontend/src/app.jsx`
- [React entry](https://github.com/phani05040/summerpro/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [API client](https://github.com/phani05040/summerpro/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Badge evaluation](https://github.com/phani05040/summerpro/blob/main/frontend/src/badges.js): `frontend/src/badges.js`

### Backend API

- [Flask app](https://github.com/phani05040/summerpro/blob/main/backend/app.py): `backend/app.py`
- [Footprint calculator](https://github.com/phani05040/summerpro/blob/main/backend/routes/calculator.py): `backend/routes/calculator.py`
- [Habit records](https://github.com/phani05040/summerpro/blob/main/backend/routes/habits.py): `backend/routes/habits.py`
- [Suggestion generation](https://github.com/phani05040/summerpro/blob/main/backend/routes/suggestions.py): `backend/routes/suggestions.py`
- [Carbon estimates](https://github.com/phani05040/summerpro/blob/main/backend/routes/carbon_interface.py): `backend/routes/carbon_interface.py`

### External services

- **Firestore**
- **Groq API**
- **Carbon Interface**

### Other components

- **User**

## Connections

- User → Page routing: navigates
- React entry → Page routing: renders
- API client → Flask app: HTTP requests
- Flask app → Footprint calculator: dispatches
- Flask app → Habit records: dispatches
- Flask app → Suggestion generation: dispatches
- Flask app → Carbon estimates: dispatches
- Habit records → Firestore: reads and writes
- Suggestion generation → Groq API: requests completions
- Carbon estimates → Carbon Interface: requests estimates
