# ryanman9/uniway architecture

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

- Interactive diagram: https://gitdiagram.com/ryanman9/uniway
- Repository: https://github.com/ryanman9/uniway

## Overview

Uniway is a campus wayfinding application: people explore places and select a start and destination, then the map loads campus places and paths, builds a routable graph, computes a walking or vehicle route, and presents turn-by-turn guidance with live-location progress and rerouting. The backend serves place, category, and graph data backed by MongoDB models; the frontend also supports cached or bundled map data. Source excerpts show the map workflow and selected backend/model relationships, but not the frontend API implementation or backend HTTP handlers in full, so those links are left unasserted.

Main entry points: [`frontend/src/views/map/routingFlow.ts`](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/routingFlow.ts) (Route workflow), [`frontend/src/views/map/navigationUI.ts`](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/navigationUI.ts) (Navigation display), [`backend/src/seed/seed.ts`](https://github.com/ryanman9/uniway/blob/main/backend/src/seed/seed.ts) (Campus data seeding), [`frontend/src/views/mapView.ts`](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/mapView.ts) (Map view setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Wayfinding client"]
  node_app["App entry and views<br/>[main.ts]"]
  node_explore["Explore places<br/>[explore.ts]"]
  node_home["Home view<br/>[home.ts]"]
  node_profile["Profile view<br/>[profile.ts]"]
  node_mapview["Map view setup<br/>[mapView.ts]"]
  node_map["Map and location<br/>[mapSetup.ts]"]
  node_picker["Place picker<br/>[pickerUI.ts]"]
  node_navui["Navigation display<br/>[navigationUI.ts]"]
  node_drawing["Route drawing<br/>[routeDrawing.ts]"]
  node_geometry["Route geometry<br/>[routeGeometry.ts]"]
  node_simulator["Location simulator<br/>[devSimulator.ts]"]
  node_api["Data client<br/>[api.ts]"]
end

subgraph group_routing["Routing and guidance"]
  node_flow["Route workflow<br/>[routingFlow.ts]"]
  node_graph["Graph construction<br/>[graph.ts]"]
  node_routing["Route selection<br/>[routing.ts]"]
  node_dijkstra["Path search<br/>[dijkstra.ts]"]
  node_navigation["Turn guidance<br/>[navigation.ts]"]
end

subgraph group_backend["Campus data API"]
  node_server["HTTP server<br/>[server.ts]"]
  node_placesroute["Places routes<br/>[places.ts]"]
  node_placesctrl["Place queries"]
  node_categoriesroute["Category routes<br/>[categories.ts]"]
  node_categoriesctrl["Category queries"]
  node_graphroute["Graph routes<br/>[graph.ts]"]
  node_graphctrl["Graph queries<br/>[graphController.ts]"]
end

subgraph group_storage["Data and seeding"]
  node_place[("Place records<br/>[Place.ts]")]
  node_details[("Place details<br/>[PlaceDetails.ts]")]
  node_category[("Category records<br/>[Category.ts]")]
  node_gnode[("Graph nodes<br/>[GraphNode.ts]")]
  node_gedge[("Graph edges<br/>[GraphEdge.ts]")]
  node_db["Database connection<br/>[db.ts]"]
  node_builder["Seed graph builder<br/>[graphBuilder.ts]"]
  node_seed["Campus data seeding<br/>[seed.ts]"]
end

node_person(("Campus user"))

node_person -->|"uses"| node_app
node_app -->|"initializes"| node_home
node_app -->|"initializes"| node_explore
node_app -->|"initializes"| node_profile
node_app -->|"initializes"| node_mapview
node_mapview -->|"creates map"| node_map
node_mapview -->|"initializes picker"| node_picker
node_mapview -->|"initializes guidance"| node_navui
node_mapview -->|"initializes simulator"| node_simulator
node_mapview -->|"loads data"| node_flow
node_map -->|"updates progress"| node_navui
node_picker -->|"starts routing"| node_flow
node_flow -->|"fetches data"| node_api
node_flow -->|"builds graph"| node_graph
node_flow -->|"finds route"| node_routing
node_routing -->|"searches paths"| node_dijkstra
node_flow -->|"builds instructions"| node_navigation
node_flow -->|"draws route"| node_drawing
node_flow -->|"renders steps"| node_navui
node_drawing -->|"uses geometry"| node_geometry
node_navigation -->|"measures distance"| node_graph
node_navui -->|"reroutes"| node_routing
node_navui -->|"rebuilds instructions"| node_navigation
node_navui -->|"updates route"| node_drawing
node_simulator -->|"samples route trace"| node_navigation
node_simulator -->|"simulates location"| node_navui
node_server -->|"mounts routes"| node_placesroute
node_server -->|"mounts routes"| node_categoriesroute
node_server -->|"mounts routes"| node_graphroute
node_placesroute -->|"dispatches"| node_placesctrl
node_categoriesroute -->|"dispatches"| node_categoriesctrl
node_graphroute -->|"dispatches"| node_graphctrl
node_placesctrl -->|"queries"| node_place
node_placesctrl -->|"queries"| node_details
node_categoriesctrl -->|"queries"| node_category
node_graphctrl -->|"queries"| node_gnode
node_graphctrl -->|"queries"| node_gedge
node_seed -->|"connects"| node_db
node_seed -->|"builds graph"| node_builder
node_seed -->|"seeds records"| node_place
node_seed -->|"seeds records"| node_category
node_seed -->|"seeds records"| node_gnode
node_seed -->|"seeds records"| node_gedge

click node_app "https://github.com/ryanman9/uniway/blob/main/frontend/src/main.ts"
click node_explore "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/explore.ts"
click node_home "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/home.ts"
click node_profile "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/profile.ts"
click node_mapview "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/mapView.ts"
click node_map "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/mapSetup.ts"
click node_picker "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/pickerUI.ts"
click node_flow "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/routingFlow.ts"
click node_graph "https://github.com/ryanman9/uniway/blob/main/frontend/src/graph.ts"
click node_routing "https://github.com/ryanman9/uniway/blob/main/frontend/src/routing.ts"
click node_dijkstra "https://github.com/ryanman9/uniway/blob/main/frontend/src/dijkstra.ts"
click node_navigation "https://github.com/ryanman9/uniway/blob/main/frontend/src/navigation.ts"
click node_navui "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/navigationUI.ts"
click node_drawing "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/routeDrawing.ts"
click node_geometry "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/routeGeometry.ts"
click node_simulator "https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/devSimulator.ts"
click node_api "https://github.com/ryanman9/uniway/blob/main/frontend/src/api.ts"
click node_server "https://github.com/ryanman9/uniway/blob/main/backend/src/server.ts"
click node_placesroute "https://github.com/ryanman9/uniway/blob/main/backend/src/routes/places.ts"
click node_placesctrl "https://github.com/ryanman9/uniway/blob/main/backend/src/controllers/placesController.ts"
click node_categoriesroute "https://github.com/ryanman9/uniway/blob/main/backend/src/routes/categories.ts"
click node_categoriesctrl "https://github.com/ryanman9/uniway/blob/main/backend/src/controllers/categoriesController.ts"
click node_graphroute "https://github.com/ryanman9/uniway/blob/main/backend/src/routes/graph.ts"
click node_graphctrl "https://github.com/ryanman9/uniway/blob/main/backend/src/controllers/graphController.ts"
click node_place "https://github.com/ryanman9/uniway/blob/main/backend/src/models/Place.ts"
click node_details "https://github.com/ryanman9/uniway/blob/main/backend/src/models/PlaceDetails.ts"
click node_category "https://github.com/ryanman9/uniway/blob/main/backend/src/models/Category.ts"
click node_gnode "https://github.com/ryanman9/uniway/blob/main/backend/src/models/GraphNode.ts"
click node_gedge "https://github.com/ryanman9/uniway/blob/main/backend/src/models/GraphEdge.ts"
click node_db "https://github.com/ryanman9/uniway/blob/main/backend/src/config/db.ts"
click node_builder "https://github.com/ryanman9/uniway/blob/main/backend/src/seed/graphBuilder.ts"
click node_seed "https://github.com/ryanman9/uniway/blob/main/backend/src/seed/seed.ts"

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_explore,node_home,node_profile,node_mapview,node_map,node_picker,node_navui,node_drawing,node_geometry,node_simulator,node_api,node_person toneBlue
class node_flow,node_graph,node_routing,node_dijkstra,node_navigation toneAmber
class node_server,node_placesroute,node_placesctrl,node_categoriesroute,node_categoriesctrl,node_graphroute,node_graphctrl toneMint
class node_place,node_details,node_category,node_gnode,node_gedge,node_db,node_builder,node_seed toneRose
```

## Components

### Wayfinding client

- [App entry and views](https://github.com/ryanman9/uniway/blob/main/frontend/src/main.ts): `frontend/src/main.ts`
- [Explore places](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/explore.ts): `frontend/src/views/explore.ts`
- [Home view](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/home.ts): `frontend/src/views/home.ts`
- [Profile view](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/profile.ts): `frontend/src/views/profile.ts`
- [Map view setup](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/mapView.ts): `frontend/src/views/mapView.ts`
- [Map and location](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/mapSetup.ts): `frontend/src/views/map/mapSetup.ts`
- [Place picker](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/pickerUI.ts): `frontend/src/views/map/pickerUI.ts`
- [Navigation display](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/navigationUI.ts): `frontend/src/views/map/navigationUI.ts`
- [Route drawing](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/routeDrawing.ts): `frontend/src/views/map/routeDrawing.ts`
- [Route geometry](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/routeGeometry.ts): `frontend/src/views/map/routeGeometry.ts`
- [Location simulator](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/devSimulator.ts): `frontend/src/views/map/devSimulator.ts`
- [Data client](https://github.com/ryanman9/uniway/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### Routing and guidance

- [Route workflow](https://github.com/ryanman9/uniway/blob/main/frontend/src/views/map/routingFlow.ts): `frontend/src/views/map/routingFlow.ts`
- [Graph construction](https://github.com/ryanman9/uniway/blob/main/frontend/src/graph.ts): `frontend/src/graph.ts`
- [Route selection](https://github.com/ryanman9/uniway/blob/main/frontend/src/routing.ts): `frontend/src/routing.ts`
- [Path search](https://github.com/ryanman9/uniway/blob/main/frontend/src/dijkstra.ts): `frontend/src/dijkstra.ts`
- [Turn guidance](https://github.com/ryanman9/uniway/blob/main/frontend/src/navigation.ts): `frontend/src/navigation.ts`

### Campus data API

- [HTTP server](https://github.com/ryanman9/uniway/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Places routes](https://github.com/ryanman9/uniway/blob/main/backend/src/routes/places.ts): `backend/src/routes/places.ts`
- [Place queries](https://github.com/ryanman9/uniway/blob/main/backend/src/controllers/placesController.ts): `backend/src/controllers/placesController.ts`
- [Category routes](https://github.com/ryanman9/uniway/blob/main/backend/src/routes/categories.ts): `backend/src/routes/categories.ts`
- [Category queries](https://github.com/ryanman9/uniway/blob/main/backend/src/controllers/categoriesController.ts): `backend/src/controllers/categoriesController.ts`
- [Graph routes](https://github.com/ryanman9/uniway/blob/main/backend/src/routes/graph.ts): `backend/src/routes/graph.ts`
- [Graph queries](https://github.com/ryanman9/uniway/blob/main/backend/src/controllers/graphController.ts): `backend/src/controllers/graphController.ts`

### Data and seeding

- [Place records](https://github.com/ryanman9/uniway/blob/main/backend/src/models/Place.ts): `backend/src/models/Place.ts`
- [Place details](https://github.com/ryanman9/uniway/blob/main/backend/src/models/PlaceDetails.ts): `backend/src/models/PlaceDetails.ts`
- [Category records](https://github.com/ryanman9/uniway/blob/main/backend/src/models/Category.ts): `backend/src/models/Category.ts`
- [Graph nodes](https://github.com/ryanman9/uniway/blob/main/backend/src/models/GraphNode.ts): `backend/src/models/GraphNode.ts`
- [Graph edges](https://github.com/ryanman9/uniway/blob/main/backend/src/models/GraphEdge.ts): `backend/src/models/GraphEdge.ts`
- [Database connection](https://github.com/ryanman9/uniway/blob/main/backend/src/config/db.ts): `backend/src/config/db.ts`
- [Seed graph builder](https://github.com/ryanman9/uniway/blob/main/backend/src/seed/graphBuilder.ts): `backend/src/seed/graphBuilder.ts`
- [Campus data seeding](https://github.com/ryanman9/uniway/blob/main/backend/src/seed/seed.ts): `backend/src/seed/seed.ts`

### Other components

- **Campus user**

## Connections

- Campus user → App entry and views: uses
- App entry and views → Home view: initializes (evidence: `frontend/src/main.ts`)
- App entry and views → Explore places: initializes (evidence: `frontend/src/main.ts`)
- App entry and views → Profile view: initializes (evidence: `frontend/src/main.ts`)
- App entry and views → Map view setup: initializes (evidence: `frontend/src/main.ts`)
- Map view setup → Map and location: creates map (evidence: `frontend/src/views/mapView.ts`)
- Map view setup → Place picker: initializes picker (evidence: `frontend/src/views/mapView.ts`)
- Map view setup → Navigation display: initializes guidance (evidence: `frontend/src/views/mapView.ts`)
- Map view setup → Location simulator: initializes simulator (evidence: `frontend/src/views/mapView.ts`)
- Map view setup → Route workflow: loads data (evidence: `frontend/src/views/mapView.ts`)
- Map and location → Navigation display: updates progress (evidence: `frontend/src/views/map/mapSetup.ts`)
- Place picker → Route workflow: starts routing (evidence: `frontend/src/views/map/routingFlow.ts`)
- Route workflow → Data client: fetches data (evidence: `frontend/src/views/map/routingFlow.ts`)
- Route workflow → Graph construction: builds graph (evidence: `frontend/src/views/map/routingFlow.ts`)
- Route workflow → Route selection: finds route (evidence: `frontend/src/views/map/routingFlow.ts`)
- Route selection → Path search: searches paths (evidence: `frontend/src/routing.ts`)
- Route workflow → Turn guidance: builds instructions (evidence: `frontend/src/views/map/routingFlow.ts`)
- Route workflow → Route drawing: draws route (evidence: `frontend/src/views/map/routingFlow.ts`)
- Route workflow → Navigation display: renders steps (evidence: `frontend/src/views/map/routingFlow.ts`)
- Route drawing → Route geometry: uses geometry (evidence: `frontend/src/views/map/routeDrawing.ts`)
- Turn guidance → Graph construction: measures distance (evidence: `frontend/src/navigation.ts`)
- Navigation display → Route selection: reroutes (evidence: `frontend/src/views/map/navigationUI.ts`)
- Navigation display → Turn guidance: rebuilds instructions (evidence: `frontend/src/views/map/navigationUI.ts`)
- Navigation display → Route drawing: updates route (evidence: `frontend/src/views/map/navigationUI.ts`)
- Location simulator → Turn guidance: samples route trace (evidence: `frontend/src/views/map/devSimulator.ts`)
- Location simulator → Navigation display: simulates location (evidence: `frontend/src/views/map/devSimulator.ts`)
- HTTP server → Places routes: mounts routes (evidence: `backend/src/server.ts`)
- HTTP server → Category routes: mounts routes (evidence: `backend/src/server.ts`)
- HTTP server → Graph routes: mounts routes (evidence: `backend/src/server.ts`)
- Places routes → Place queries: dispatches (evidence: `backend/src/routes/places.ts`)
- Category routes → Category queries: dispatches (evidence: `backend/src/routes/categories.ts`)
- Graph routes → Graph queries: dispatches (evidence: `backend/src/routes/graph.ts`)
- Place queries → Place records: queries (evidence: `backend/src/controllers/placesController.ts`)
- Place queries → Place details: queries (evidence: `backend/src/controllers/placesController.ts`)
- Category queries → Category records: queries (evidence: `backend/src/controllers/categoriesController.ts`)
- Graph queries → Graph nodes: queries (evidence: `backend/src/controllers/graphController.ts`)
- Graph queries → Graph edges: queries (evidence: `backend/src/controllers/graphController.ts`)
- Campus data seeding → Database connection: connects (evidence: `backend/src/seed/seed.ts`)
- Campus data seeding → Seed graph builder: builds graph (evidence: `backend/src/seed/seed.ts`)
- Campus data seeding → Place records: seeds records (evidence: `backend/src/seed/seed.ts`)
- Campus data seeding → Category records: seeds records (evidence: `backend/src/seed/seed.ts`)
- Campus data seeding → Graph nodes: seeds records (evidence: `backend/src/seed/seed.ts`)
- Campus data seeding → Graph edges: seeds records (evidence: `backend/src/seed/seed.ts`)
