# priyanshukumar016/trashclick architecture

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

- Interactive diagram: https://gitdiagram.com/priyanshukumar016/trashclick
- Repository: https://github.com/priyanshukumar016/trashclick

## Overview

This is a small browser-based issue-reporting site. Its visible workflow initializes a map, optionally centers it on the visitor’s location, and submits form data to an issue API. A separate Mongoose model defines issue fields, but the repository excerpt does not show an API implementation or connect that model to the submission flow. The map and submission behavior are both implemented in the same script; relationships below are limited to those shown in the excerpt.

Main entry points: [`js/raise_issue.js`](https://github.com/priyanshukumar016/trashclick/blob/master/js/raise_issue.js) (Map and location)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Site interface"]
  node_issue_page["Report page<br/>[raise_issue.html]"]
  node_navbar["Navbar behavior<br/>[main.js]"]
end

subgraph group_reporting["Issue reporting"]
  node_map["Map and location<br/>[raise_issue.js]"]
  node_issue_form["Issue submission<br/>[raise_issue.js]"]
  node_issue_api["Issue API"]
end

subgraph group_data["Issue data"]
  node_issue_model["Issue model<br/>[Issue.js]"]
end

node_visitor(("Visitor"))
node_osm["OpenStreetMap tiles"]
node_geo["Browser geolocation"]

node_map -->|"loads tiles"| node_osm
node_map -->|"requests location"| node_geo
node_issue_form -->|"posts form data"| node_issue_api

click node_issue_page "https://github.com/priyanshukumar016/trashclick/blob/master/pages/raise_issue.html"
click node_navbar "https://github.com/priyanshukumar016/trashclick/blob/master/js/main.js"
click node_map "https://github.com/priyanshukumar016/trashclick/blob/master/js/raise_issue.js"
click node_issue_form "https://github.com/priyanshukumar016/trashclick/blob/master/js/raise_issue.js"
click node_issue_model "https://github.com/priyanshukumar016/trashclick/blob/master/models/Issue.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_issue_page,node_navbar,node_geo toneBlue
class node_map,node_issue_form,node_issue_api toneAmber
class node_issue_model toneMint
class node_visitor,node_osm toneIndigo
```

## Components

### Site interface

- [Report page](https://github.com/priyanshukumar016/trashclick/blob/master/pages/raise_issue.html): `pages/raise_issue.html`
- [Navbar behavior](https://github.com/priyanshukumar016/trashclick/blob/master/js/main.js): `js/main.js`

### Issue reporting

- [Map and location](https://github.com/priyanshukumar016/trashclick/blob/master/js/raise_issue.js): `js/raise_issue.js`
- [Issue submission](https://github.com/priyanshukumar016/trashclick/blob/master/js/raise_issue.js): `js/raise_issue.js`
- **Issue API**

### Issue data

- [Issue model](https://github.com/priyanshukumar016/trashclick/blob/master/models/Issue.js): `models/Issue.js`

### Other components

- **Visitor**
- **OpenStreetMap tiles**
- **Browser geolocation**

## Connections

- Map and location → OpenStreetMap tiles: loads tiles (evidence: `js/raise_issue.js`)
- Map and location → Browser geolocation: requests location (evidence: `js/raise_issue.js`)
- Issue submission → Issue API: posts form data (evidence: `js/raise_issue.js`)
