# laaqshya/campus-compass architecture

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

- Interactive diagram: https://gitdiagram.com/laaqshya/campus-compass
- Repository: https://github.com/laaqshya/campus-compass

## Overview

This is a campus wayfinding web app: visitors open the map, search or select a location, inspect occupancy, choose a start/destination, and follow a crowd-aware walking route. The map route owns that interaction and periodically recalculates routes; navigation state and bundled campus data support it. The tree and excerpts show simulated occupancy rather than a live occupancy service. The router and server provide page delivery and branded error handling; unsampled UI-kit internals are not expanded.

Main entry points: [`src/routes/map.tsx`](https://github.com/laaqshya/campus-compass/blob/main/src/routes/map.tsx) (Interactive map), [`src/server.ts`](https://github.com/laaqshya/campus-compass/blob/main/src/server.ts) (Request handler), [`src/routeTree.gen.ts`](https://github.com/laaqshya/campus-compass/blob/main/src/routeTree.gen.ts) (Route registry), [`src/components/map/LocationPopup.tsx`](https://github.com/laaqshya/campus-compass/blob/main/src/components/map/LocationPopup.tsx) (Location details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Campus navigation"]
  node_map["Interactive map<br/>[map.tsx]"]
  node_navstate["Navigation state<br/>[navigationStore.ts]"]
  node_routing["Crowd-aware routing"]
  node_locationbox["Location markers<br/>[LocationBox.tsx]"]
  node_popup["Location details<br/>[LocationPopup.tsx]"]
  node_routepath["Route display<br/>[RoutePath.tsx]"]
  node_person["Person marker<br/>[PersonMarker.tsx]"]
  node_titles["Name formatting<br/>[titleCase.ts]"]
end

subgraph group_mapdata["Map and occupancy data"]
  node_locations["Campus locations<br/>[locations.ts]"]
end

subgraph group_web["Web application"]
  node_home["Welcome page<br/>[index.tsx]"]
  node_router["Route registry<br/>[routeTree.gen.ts]"]
  node_routerconfig["Router setup<br/>[router.tsx]"]
  node_root["App root<br/>[__root.tsx]"]
  node_mobile["Mobile detection<br/>[use-mobile.tsx]"]
end

subgraph group_errors["Error handling"]
  node_server["Request handler<br/>[server.ts]"]
  node_start["Start handler<br/>[start.ts]"]
  node_capture["Error capture<br/>[error-capture.ts]"]
  node_errorpage["Branded error page<br/>[error-page.ts]"]
end

node_visitor(("Campus visitor"))
node_tanstack["TanStack server entry"]

node_visitor -->|"opens"| node_home
node_home -->|"links to"| node_map
node_routerconfig -->|"loads"| node_router
node_router -->|"registers"| node_root
node_router -->|"registers"| node_home
node_router -->|"registers"| node_map
node_visitor -->|"uses"| node_map
node_map -->|"reads"| node_locations
node_map -->|"reads and updates"| node_navstate
node_map -->|"calculates routes"| node_routing
node_routing -->|"uses locations"| node_locations
node_map -->|"renders"| node_locationbox
node_map -->|"renders"| node_popup
node_map -->|"renders"| node_routepath
node_map -->|"renders"| node_person
node_popup -->|"reads status"| node_navstate
node_locationbox -->|"reads state"| node_navstate
node_popup -->|"formats names"| node_titles
node_map -->|"formats names"| node_titles
node_map -->|"checks viewport"| node_mobile
node_server -->|"dispatches requests"| node_tanstack
node_server -->|"consumes errors"| node_capture
node_server -->|"renders failure"| node_errorpage
node_start -->|"uses fallback"| node_errorpage
node_server -.->|"returns response"| node_visitor

click node_home "https://github.com/laaqshya/campus-compass/blob/main/src/routes/index.tsx"
click node_router "https://github.com/laaqshya/campus-compass/blob/main/src/routeTree.gen.ts"
click node_routerconfig "https://github.com/laaqshya/campus-compass/blob/main/src/router.tsx"
click node_root "https://github.com/laaqshya/campus-compass/blob/main/src/routes/__root.tsx"
click node_map "https://github.com/laaqshya/campus-compass/blob/main/src/routes/map.tsx"
click node_locations "https://github.com/laaqshya/campus-compass/blob/main/src/data/locations.ts"
click node_navstate "https://github.com/laaqshya/campus-compass/blob/main/src/stores/navigationStore.ts"
click node_routing "https://github.com/laaqshya/campus-compass/blob/main/src/lib/crowdAwareDijkstra.ts"
click node_locationbox "https://github.com/laaqshya/campus-compass/blob/main/src/components/map/LocationBox.tsx"
click node_popup "https://github.com/laaqshya/campus-compass/blob/main/src/components/map/LocationPopup.tsx"
click node_routepath "https://github.com/laaqshya/campus-compass/blob/main/src/components/map/RoutePath.tsx"
click node_person "https://github.com/laaqshya/campus-compass/blob/main/src/components/map/PersonMarker.tsx"
click node_titles "https://github.com/laaqshya/campus-compass/blob/main/src/utils/titleCase.ts"
click node_mobile "https://github.com/laaqshya/campus-compass/blob/main/src/hooks/use-mobile.tsx"
click node_server "https://github.com/laaqshya/campus-compass/blob/main/src/server.ts"
click node_start "https://github.com/laaqshya/campus-compass/blob/main/src/start.ts"
click node_capture "https://github.com/laaqshya/campus-compass/blob/main/src/lib/error-capture.ts"
click node_errorpage "https://github.com/laaqshya/campus-compass/blob/main/src/lib/error-page.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_map,node_navstate,node_routing,node_locationbox,node_popup,node_routepath,node_person,node_titles toneBlue
class node_locations toneAmber
class node_home,node_router,node_routerconfig,node_root,node_mobile,node_tanstack toneMint
class node_server,node_start,node_capture,node_errorpage toneRose
class node_visitor toneIndigo
```

## Components

### Campus navigation

- [Interactive map](https://github.com/laaqshya/campus-compass/blob/main/src/routes/map.tsx): `src/routes/map.tsx`
- [Navigation state](https://github.com/laaqshya/campus-compass/blob/main/src/stores/navigationStore.ts): `src/stores/navigationStore.ts`
- [Crowd-aware routing](https://github.com/laaqshya/campus-compass/blob/main/src/lib/crowdAwareDijkstra.ts): `src/lib/crowdAwareDijkstra.ts`
- [Location markers](https://github.com/laaqshya/campus-compass/blob/main/src/components/map/LocationBox.tsx): `src/components/map/LocationBox.tsx`
- [Location details](https://github.com/laaqshya/campus-compass/blob/main/src/components/map/LocationPopup.tsx): `src/components/map/LocationPopup.tsx`
- [Route display](https://github.com/laaqshya/campus-compass/blob/main/src/components/map/RoutePath.tsx): `src/components/map/RoutePath.tsx`
- [Person marker](https://github.com/laaqshya/campus-compass/blob/main/src/components/map/PersonMarker.tsx): `src/components/map/PersonMarker.tsx`
- [Name formatting](https://github.com/laaqshya/campus-compass/blob/main/src/utils/titleCase.ts): `src/utils/titleCase.ts`

### Map and occupancy data

- [Campus locations](https://github.com/laaqshya/campus-compass/blob/main/src/data/locations.ts): `src/data/locations.ts`

### Web application

- [Welcome page](https://github.com/laaqshya/campus-compass/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Route registry](https://github.com/laaqshya/campus-compass/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Router setup](https://github.com/laaqshya/campus-compass/blob/main/src/router.tsx): `src/router.tsx`
- [App root](https://github.com/laaqshya/campus-compass/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [Mobile detection](https://github.com/laaqshya/campus-compass/blob/main/src/hooks/use-mobile.tsx): `src/hooks/use-mobile.tsx`

### Error handling

- [Request handler](https://github.com/laaqshya/campus-compass/blob/main/src/server.ts): `src/server.ts`
- [Start handler](https://github.com/laaqshya/campus-compass/blob/main/src/start.ts): `src/start.ts`
- [Error capture](https://github.com/laaqshya/campus-compass/blob/main/src/lib/error-capture.ts): `src/lib/error-capture.ts`
- [Branded error page](https://github.com/laaqshya/campus-compass/blob/main/src/lib/error-page.ts): `src/lib/error-page.ts`

### Other components

- **Campus visitor**
- **TanStack server entry**

## Connections

- Campus visitor → Welcome page: opens (evidence: `src/routes/index.tsx`)
- Welcome page → Interactive map: links to (evidence: `src/routes/index.tsx`)
- Router setup → Route registry: loads (evidence: `src/router.tsx`)
- Route registry → App root: registers (evidence: `src/routeTree.gen.ts`)
- Route registry → Welcome page: registers (evidence: `src/routeTree.gen.ts`)
- Route registry → Interactive map: registers (evidence: `src/routeTree.gen.ts`)
- Campus visitor → Interactive map: uses (evidence: `src/routes/map.tsx`)
- Interactive map → Campus locations: reads (evidence: `src/routes/map.tsx`)
- Interactive map → Navigation state: reads and updates (evidence: `src/routes/map.tsx`)
- Interactive map → Crowd-aware routing: calculates routes (evidence: `src/routes/map.tsx`)
- Crowd-aware routing → Campus locations: uses locations (evidence: `src/lib/crowdAwareDijkstra.ts`)
- Interactive map → Location markers: renders (evidence: `src/routes/map.tsx`)
- Interactive map → Location details: renders (evidence: `src/routes/map.tsx`)
- Interactive map → Route display: renders (evidence: `src/routes/map.tsx`)
- Interactive map → Person marker: renders (evidence: `src/routes/map.tsx`)
- Location details → Navigation state: reads status (evidence: `src/components/map/LocationPopup.tsx`)
- Location markers → Navigation state: reads state (evidence: `src/components/map/LocationBox.tsx`)
- Location details → Name formatting: formats names (evidence: `src/components/map/LocationPopup.tsx`)
- Interactive map → Name formatting: formats names (evidence: `src/routes/map.tsx`)
- Interactive map → Mobile detection: checks viewport (evidence: `src/routes/map.tsx`)
- Request handler → TanStack server entry: dispatches requests (evidence: `src/server.ts`)
- Request handler → Error capture: consumes errors (evidence: `src/server.ts`)
- Request handler → Branded error page: renders failure (evidence: `src/server.ts`)
- Start handler → Branded error page: uses fallback (evidence: `src/start.ts`)
- Request handler → Campus visitor: returns response
