# sean1-git/uc-merced-campus-parking architecture

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

- Interactive diagram: https://gitdiagram.com/sean1-git/uc-merced-campus-parking
- Repository: https://github.com/sean1-git/uc-merced-campus-parking

## Overview

Campus Parking is a small sample-data parking dashboard. The user opens the page, the browser loads lot counts from the Python server, and the dashboard computes totals and lets the user inspect a lot from either the list or map. A service worker supports offline use by caching the app shell and the latest counts; a separate browser script handles installation. The README documents the page, styles, and manifest roles, but those files were not sampled, so their relationships are shown only where explicitly documented.

Main entry points: [`public/app.js`](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/app.js) (Dashboard logic), [`public/sw.js`](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/sw.js) (Service worker), [`app.py`](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/app.py) (HTTP server and API), [`public/index.html`](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/index.html) (Page layout and map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data service"]
  node_server["HTTP server and API<br/>[app.py]"]
  node_lots["Sample lot data<br/>[app.py]"]
end

subgraph group_dashboard["Parking dashboard"]
  node_page["Page layout and map<br/>[index.html]"]
  node_styles["Responsive styles<br/>[styles.css]"]
  node_dashboard_logic["Dashboard logic<br/>[app.js]"]
  node_summary["Availability summary<br/>[app.js]"]
  node_selection["Lot selection details<br/>[app.js]"]
end

subgraph group_offline["Offline and install"]
  node_pwa["Install and setup<br/>[pwa.js]"]
  node_worker["Service worker<br/>[sw.js]"]
  node_app_cache[("App file cache<br/>[sw.js]")]
  node_count_cache[("Saved count cache<br/>[sw.js]")]
  node_manifest["Install metadata"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_page
node_server -->|"serves"| node_page
node_server -->|"returns counts"| node_lots
node_dashboard_logic -->|"fetches counts"| node_server
node_dashboard_logic -->|"calculates totals"| node_summary
node_dashboard_logic -->|"renders selection"| node_selection
node_page -->|"provides layout"| node_dashboard_logic
node_page -->|"uses styles"| node_styles
node_visitor -->|"selects lot"| node_dashboard_logic
node_pwa -->|"registers"| node_worker
node_worker -->|"stores app files"| node_app_cache
node_worker -->|"stores counts"| node_count_cache
node_worker -->|"fetches counts"| node_server
node_pwa -.->|"installation metadata"| node_manifest

click node_server "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/app.py"
click node_lots "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/app.py"
click node_page "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/index.html"
click node_styles "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/styles.css"
click node_dashboard_logic "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/app.js"
click node_summary "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/app.js"
click node_selection "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/app.js"
click node_pwa "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/pwa.js"
click node_worker "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/sw.js"
click node_app_cache "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/sw.js"
click node_count_cache "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/sw.js"
click node_manifest "https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/manifest.webmanifest"

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_server,node_lots toneBlue
class node_page,node_styles,node_dashboard_logic,node_summary,node_selection toneAmber
class node_pwa,node_worker,node_app_cache,node_count_cache,node_manifest toneMint
class node_visitor toneIndigo
```

## Components

### Data service

- [HTTP server and API](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/app.py): `app.py`
- [Sample lot data](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/app.py): `app.py`

### Parking dashboard

- [Page layout and map](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/index.html): `public/index.html`
- [Responsive styles](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/styles.css): `public/styles.css`
- [Dashboard logic](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/app.js): `public/app.js`
- [Availability summary](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/app.js): `public/app.js`
- [Lot selection details](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/app.js): `public/app.js`

### Offline and install

- [Install and setup](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/pwa.js): `public/pwa.js`
- [Service worker](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/sw.js): `public/sw.js`
- [App file cache](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/sw.js): `public/sw.js`
- [Saved count cache](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/sw.js): `public/sw.js`
- [Install metadata](https://github.com/sean1-git/uc-merced-campus-parking/blob/main/public/manifest.webmanifest): `public/manifest.webmanifest`

### Other components

- **Visitor**

## Connections

- Visitor → Page layout and map: opens (evidence: `README.md`)
- HTTP server and API → Page layout and map: serves (evidence: `README.md`)
- HTTP server and API → Sample lot data: returns counts (evidence: `app.py`)
- Dashboard logic → HTTP server and API: fetches counts (evidence: `public/app.js`)
- Dashboard logic → Availability summary: calculates totals (evidence: `public/app.js`)
- Dashboard logic → Lot selection details: renders selection (evidence: `public/app.js`)
- Page layout and map → Dashboard logic: provides layout (evidence: `README.md`)
- Page layout and map → Responsive styles: uses styles (evidence: `README.md`)
- Visitor → Dashboard logic: selects lot (evidence: `README.md`)
- Install and setup → Service worker: registers (evidence: `public/pwa.js`)
- Service worker → App file cache: stores app files (evidence: `public/sw.js`)
- Service worker → Saved count cache: stores counts (evidence: `public/sw.js`)
- Service worker → HTTP server and API: fetches counts (evidence: `public/sw.js`)
- Install and setup → Install metadata: installation metadata (evidence: `README.md`)
