# lynettespn/gis-proj architecture

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

- Interactive diagram: https://gitdiagram.com/lynettespn/gis-proj
- Repository: https://github.com/lynettespn/gis-proj

## Overview

RMIS is a web-based geospatial road-maintenance system. Its main workflow takes a user through login to an interactive map, where road and asset information can be searched and inspected, then supports maintenance route planning and viewport-based asset analytics. The Node.js API supplies authentication, asset data, and routing backed by PostgreSQL/PostGIS; GeoServer supplies map and feature services. The README documents the PWA and offline-cache capability. Source excerpts show selected frontend/API interactions; other connections below are included only where documented.

Main entry points: [`index.html`](https://github.com/lynettespn/gis-proj/blob/main/index.html) (Map application), [`rmis.js`](https://github.com/lynettespn/gis-proj/blob/main/rmis.js) (Map and search), [`server.js`](https://github.com/lynettespn/gis-proj/blob/main/server.js) (Authentication and roles), [`rmis3.js`](https://github.com/lynettespn/gis-proj/blob/main/rmis3.js) (Route planner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User-facing application"]
  node_login["Login portal<br/>[login.html]"]
  node_map["Map application<br/>[index.html]"]
  node_mapcore["Map and search<br/>[rmis.js]"]
  node_assetdetails["Asset inspection<br/>[rmis2.js]"]
  node_offline["Offline app shell<br/>[sw.js]"]
end

subgraph group_operations["Maintenance tools"]
  node_planner["Route planner<br/>[rmis3.js]"]
  node_analytics["Asset analytics<br/>[rmis4.js]"]
end

subgraph group_services["Application services"]
  node_api["HTTP API server<br/>[server.js]"]
  node_auth["Authentication and roles<br/>[server.js]"]
  node_assetapi["Asset data API<br/>[server.js]"]
  node_routeapi["Routing API<br/>[server.js]"]
  node_https["HTTPS static server<br/>[https_server.py]"]
end

subgraph group_data["Geospatial data"]
  node_database[("PostGIS database")]
  node_geoserver["GeoServer WMS/WFS"]
end

node_user(("RMIS user"))

node_user -->|"signs in"| node_login
node_login -->|"submits credentials"| node_auth
node_auth -->|"queries users"| node_database
node_auth -->|"grants access"| node_map
node_map -->|"loads map logic"| node_mapcore
node_mapcore -->|"requests map features"| node_geoserver
node_mapcore -->|"fetches nearby assets"| node_assetapi
node_mapcore -->|"opens feature details"| node_assetdetails
node_assetdetails -->|"queries road features"| node_geoserver
node_planner -->|"requests route"| node_routeapi
node_planner -->|"loads critical assets"| node_assetapi
node_routeapi -->|"calculates routes"| node_database
node_assetapi -->|"queries assets"| node_database
node_analytics -->|"fetches viewport assets"| node_geoserver
node_map -->|"registers service worker"| node_offline
node_offline -->|"serves cached shell"| node_map
node_user -->|"requests app"| node_map
node_https -.->|"serves static files"| node_map

click node_login "https://github.com/lynettespn/gis-proj/blob/main/login.html"
click node_map "https://github.com/lynettespn/gis-proj/blob/main/index.html"
click node_mapcore "https://github.com/lynettespn/gis-proj/blob/main/rmis.js"
click node_assetdetails "https://github.com/lynettespn/gis-proj/blob/main/rmis2.js"
click node_offline "https://github.com/lynettespn/gis-proj/blob/main/sw.js"
click node_planner "https://github.com/lynettespn/gis-proj/blob/main/rmis3.js"
click node_analytics "https://github.com/lynettespn/gis-proj/blob/main/rmis4.js"
click node_api "https://github.com/lynettespn/gis-proj/blob/main/server.js"
click node_auth "https://github.com/lynettespn/gis-proj/blob/main/server.js"
click node_assetapi "https://github.com/lynettespn/gis-proj/blob/main/server.js"
click node_routeapi "https://github.com/lynettespn/gis-proj/blob/main/server.js"
click node_https "https://github.com/lynettespn/gis-proj/blob/main/https_server.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_login,node_map,node_mapcore,node_assetdetails,node_offline,node_user toneBlue
class node_planner,node_analytics toneAmber
class node_api,node_auth,node_assetapi,node_routeapi,node_https toneMint
class node_database,node_geoserver toneRose
```

## Components

### User-facing application

- [Login portal](https://github.com/lynettespn/gis-proj/blob/main/login.html): `login.html`
- [Map application](https://github.com/lynettespn/gis-proj/blob/main/index.html): `index.html`
- [Map and search](https://github.com/lynettespn/gis-proj/blob/main/rmis.js): `rmis.js`
- [Asset inspection](https://github.com/lynettespn/gis-proj/blob/main/rmis2.js): `rmis2.js`
- [Offline app shell](https://github.com/lynettespn/gis-proj/blob/main/sw.js): `sw.js`

### Maintenance tools

- [Route planner](https://github.com/lynettespn/gis-proj/blob/main/rmis3.js): `rmis3.js`
- [Asset analytics](https://github.com/lynettespn/gis-proj/blob/main/rmis4.js): `rmis4.js`

### Application services

- [HTTP API server](https://github.com/lynettespn/gis-proj/blob/main/server.js): `server.js`
- [Authentication and roles](https://github.com/lynettespn/gis-proj/blob/main/server.js): `server.js`
- [Asset data API](https://github.com/lynettespn/gis-proj/blob/main/server.js): `server.js`
- [Routing API](https://github.com/lynettespn/gis-proj/blob/main/server.js): `server.js`
- [HTTPS static server](https://github.com/lynettespn/gis-proj/blob/main/https_server.py): `https_server.py`

### Geospatial data

- **PostGIS database**
- **GeoServer WMS/WFS**

### Other components

- **RMIS user**

## Connections

- RMIS user → Login portal: signs in (evidence: `README.md`)
- Login portal → Authentication and roles: submits credentials (evidence: `README.md`)
- Authentication and roles → PostGIS database: queries users (evidence: `server.js`)
- Authentication and roles → Map application: grants access (evidence: `README.md`)
- Map application → Map and search: loads map logic (evidence: `README.md`)
- Map and search → GeoServer WMS/WFS: requests map features (evidence: `rmis.js`)
- Map and search → Asset data API: fetches nearby assets (evidence: `rmis.js`)
- Map and search → Asset inspection: opens feature details (evidence: `README.md`)
- Asset inspection → GeoServer WMS/WFS: queries road features (evidence: `rmis2.js`)
- Route planner → Routing API: requests route (evidence: `rmis3.js`)
- Route planner → Asset data API: loads critical assets (evidence: `rmis3.js`)
- Routing API → PostGIS database: calculates routes (evidence: `server.js`)
- Asset data API → PostGIS database: queries assets (evidence: `server.js`)
- Asset analytics → GeoServer WMS/WFS: fetches viewport assets (evidence: `rmis4.js`)
- Map application → Offline app shell: registers service worker (evidence: `README.md`)
- Offline app shell → Map application: serves cached shell (evidence: `sw.js`)
- RMIS user → Map application: requests app (evidence: `README.md`)
- HTTPS static server → Map application: serves static files
