# fudgeebohr/eco-hat architecture

> Architecture diagram of the GitHub repository fudgeebohr/eco-hat, 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/fudgeebohr/eco-hat
- Repository: https://github.com/fudgeebohr/eco-hat

## Overview

ECO-HAT is a React sustainability portal: students and administrators enter through role-specific routes, then use dashboards for recycling, rewards, account settings, and campus operations. The frontend sends requests through a shared Axios client to a separately hosted backend. The tree and excerpts cover only the frontend; backend processing, persistence, and hardware behavior are not represented as repository components.

Main entry points: [`src/App.jsx`](https://github.com/fudgeebohr/eco-hat/blob/master/src/App.jsx) (Route Application), [`src/api.js`](https://github.com/fudgeebohr/eco-hat/blob/master/src/api.js) (Axios API Client), [`src/pages/Dashboard.jsx`](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Dashboard.jsx) (Student Dashboard), [`src/components/IdleLogoutTimeout.jsx`](https://github.com/fudgeebohr/eco-hat/blob/master/src/components/IdleLogoutTimeout.jsx) (Idle Session Guard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App Navigation"]
  node_app["Route Application<br/>[App.jsx]"]
  node_role["Role Selection<br/>[RoleSelection.jsx]"]
end

subgraph group_student["Student Portal"]
  node_student_auth["Student Access<br/>[Login.jsx]"]
  node_student_register["Student Registration<br/>[Register.jsx]"]
  node_forgot["Password Recovery<br/>[ForgotPassword.jsx]"]
  node_dashboard["Student Dashboard<br/>[Dashboard.jsx]"]
  node_profile["Profile and Reports<br/>[Profile.jsx]"]
  node_rewards["Rewards Checkout<br/>[Rewards.jsx]"]
  node_kiosk["Kiosk Control<br/>[KioskControl.jsx]"]
end

subgraph group_admin["Administration"]
  node_admin_auth["Admin Login<br/>[AdminLogin.jsx]"]
  node_admin_register["Admin Registration<br/>[AdminRegister.jsx]"]
  node_admin_dashboard["Admin Operations<br/>[AdminDashboard.jsx]"]
end

subgraph group_integration["Security and API"]
  node_idle["Idle Session Guard"]
  node_api["Axios API Client<br/>[api.js]"]
end

node_visitor(("Visitor"))
node_backend{{"Hosted Backend API"}}

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_role
node_app -->|"routes to"| node_student_auth
node_app -->|"routes to"| node_student_register
node_app -->|"routes to"| node_forgot
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_kiosk
node_app -->|"routes to"| node_admin_auth
node_app -->|"routes to"| node_admin_register
node_app -->|"routes to"| node_admin_dashboard
node_app -->|"wraps routes"| node_idle
node_dashboard -->|"renders"| node_profile
node_dashboard -->|"renders"| node_rewards
node_student_auth -->|"submits login"| node_api
node_student_register -->|"submits registration"| node_api
node_profile -->|"updates profile"| node_api
node_rewards -->|"checks out cart"| node_api
node_kiosk -->|"sends commands"| node_api
node_api -->|"sends HTTP requests"| node_backend
node_idle -->|"redirects on timeout"| node_student_auth
node_idle -->|"redirects on timeout"| node_admin_auth

click node_app "https://github.com/fudgeebohr/eco-hat/blob/master/src/App.jsx"
click node_role "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/RoleSelection.jsx"
click node_student_auth "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Login.jsx"
click node_student_register "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Register.jsx"
click node_forgot "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/ForgotPassword.jsx"
click node_dashboard "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Dashboard.jsx"
click node_profile "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Profile.jsx"
click node_rewards "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Rewards.jsx"
click node_kiosk "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/KioskControl.jsx"
click node_admin_auth "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/AdminLogin.jsx"
click node_admin_register "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/AdminRegister.jsx"
click node_admin_dashboard "https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/AdminDashboard.jsx"
click node_idle "https://github.com/fudgeebohr/eco-hat/blob/master/src/components/IdleLogoutTimeout.jsx"
click node_api "https://github.com/fudgeebohr/eco-hat/blob/master/src/api.js"

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_app,node_role toneBlue
class node_student_auth,node_student_register,node_forgot,node_dashboard,node_profile,node_rewards,node_kiosk toneAmber
class node_admin_auth,node_admin_register,node_admin_dashboard,node_backend toneMint
class node_idle,node_api toneRose
class node_visitor toneIndigo
```

## Components

### App Navigation

- [Route Application](https://github.com/fudgeebohr/eco-hat/blob/master/src/App.jsx): `src/App.jsx`
- [Role Selection](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/RoleSelection.jsx): `src/pages/RoleSelection.jsx`

### Student Portal

- [Student Access](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Student Registration](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Register.jsx): `src/pages/Register.jsx`
- [Password Recovery](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/ForgotPassword.jsx): `src/pages/ForgotPassword.jsx`
- [Student Dashboard](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Profile and Reports](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Profile.jsx): `src/pages/Profile.jsx`
- [Rewards Checkout](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/Rewards.jsx): `src/pages/Rewards.jsx`
- [Kiosk Control](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/KioskControl.jsx): `src/pages/KioskControl.jsx`

### Administration

- [Admin Login](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/AdminLogin.jsx): `src/pages/AdminLogin.jsx`
- [Admin Registration](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/AdminRegister.jsx): `src/pages/AdminRegister.jsx`
- [Admin Operations](https://github.com/fudgeebohr/eco-hat/blob/master/src/pages/AdminDashboard.jsx): `src/pages/AdminDashboard.jsx`

### Security and API

- [Idle Session Guard](https://github.com/fudgeebohr/eco-hat/blob/master/src/components/IdleLogoutTimeout.jsx): `src/components/IdleLogoutTimeout.jsx`
- [Axios API Client](https://github.com/fudgeebohr/eco-hat/blob/master/src/api.js): `src/api.js`

### Other components

- **Visitor**
- **Hosted Backend API**

## Connections

- Visitor → Route Application: opens
- Route Application → Role Selection: routes to (evidence: `src/App.jsx`)
- Route Application → Student Access: routes to (evidence: `src/App.jsx`)
- Route Application → Student Registration: routes to (evidence: `src/App.jsx`)
- Route Application → Password Recovery: routes to (evidence: `src/App.jsx`)
- Route Application → Student Dashboard: routes to (evidence: `src/App.jsx`)
- Route Application → Kiosk Control: routes to (evidence: `src/App.jsx`)
- Route Application → Admin Login: routes to (evidence: `src/App.jsx`)
- Route Application → Admin Registration: routes to (evidence: `src/App.jsx`)
- Route Application → Admin Operations: routes to (evidence: `src/App.jsx`)
- Route Application → Idle Session Guard: wraps routes (evidence: `src/App.jsx`)
- Student Dashboard → Profile and Reports: renders (evidence: `src/pages/Dashboard.jsx`)
- Student Dashboard → Rewards Checkout: renders (evidence: `src/pages/Dashboard.jsx`)
- Student Access → Axios API Client: submits login (evidence: `src/pages/Login.jsx`)
- Student Registration → Axios API Client: submits registration (evidence: `src/pages/Register.jsx`)
- Profile and Reports → Axios API Client: updates profile (evidence: `src/pages/Profile.jsx`)
- Rewards Checkout → Axios API Client: checks out cart (evidence: `src/pages/Rewards.jsx`)
- Kiosk Control → Axios API Client: sends commands (evidence: `src/pages/KioskControl.jsx`)
- Axios API Client → Hosted Backend API: sends HTTP requests (evidence: `src/api.js`)
- Idle Session Guard → Student Access: redirects on timeout (evidence: `src/components/IdleLogoutTimeout.jsx`)
- Idle Session Guard → Admin Login: redirects on timeout (evidence: `src/components/IdleLogoutTimeout.jsx`)
