# abdullatech06/iiitdm-campus-navigator architecture

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

- Interactive diagram: https://gitdiagram.com/abdullatech06/iiitdm-campus-navigator
- Repository: https://github.com/abdullatech06/iiitdm-campus-navigator

## Overview

1. **Repository shape**
   - This is a **static, client-side web application** with no server code in the repo.
   - The architecture is split between a **landing page** and a **map application view**, plus shared styling assets.

2. **Entry points**
   - `index.html` is the public-facing landing page and likely the first screen users see.
   - `app/map.html` is the core application shell where the interactive campus navigator runs.

3. **Presentation layer**
   - `assets/css/global.css` holds shared design tokens and base styling such as typography, root variables, and utilities.
   - `app/style.css` contains app-specific UI styling for map overlays, chips, panels, and responsive/mobile-first layout.

4. **Application logic boundary**
   - `app/script.js` is the main behavior layer.
   - It owns map initialization, user interaction handling, data loading, marker creation, routing, and geolocation tracking.

5. **Map subsystem**
   - The app uses **Leaflet.js** as the map rendering engine.
   - It renders an interactive campus map, manages zoom/camera movement, and replaces default controls with custom UI.

6. **Routing subsystem**
   - Routing is handled through **Leaflet Routing Machine**.
   - The app computes walking routes from the user’s current position to a selected campus destination, with path updates driven by live location data.

7. **Location tracking flow**
   - The browser’s **Geolocation API** provides the user’s live position.
   - `watchPosition` is used to keep the location marker updated continuously, enabling the “current location to destination” navigation flow.

8. **Campus data flow**
   - Dynamic campus node data is fetched from **Supabase** at runtime.
   - The data appears to include coordinates, names, and categories, which are then merged with local UI logic for marker display and search/filter behavior.

9. **Local data vs remote data**
   - The repo uses a **hybrid data model**:
     - remote Supabase records for primary location nodes and metadata,
     - local/static mappings for richer details like floor-level directories, room labels, and facility descriptions.
   - This keeps the app responsive while still allowing dynamic campus updates.

10. **Interaction and navigation model**
    - Users can search, filter by category, tap markers, and open a bottom-sheet style details panel.
    - Selecting a building recenters the map and reveals its facility information; selecting a destination enables route calculation from the live position.

11. **Visual/UX subsystem**
    - The UI is built around custom overlays, glassmorphism panels, chips, and animated markers.
    - The design is mobile-first and optimized for single-handed use, which strongly influences layout and interaction boundaries.

12. **External dependencies and runtime assumptions**
    - The app depends on **OpenStreetMap tiles**, so initial map rendering requires network access.
    - It also depends on **Supabase** for campus node data and on browser location permissions for live navigation.

13. **What is not in the repo**
    - There is no custom backend, API server, or build pipeline visible in the file tree.
    - Architecture-wise, this is a **thin frontend client** consuming third-party services rather than a full-stack system.

14. **How to diagram it**
    - A useful diagram would show:
      - user browser at the center,
      - `index.html` leading into `app/map.html`,
      - `script.js` orchestrating UI, map, geolocation, and routing,
      - `global.css` and `style.css` feeding presentation,
      - external service links to Leaflet/OpenStreetMap, Supabase, and the browser Geolocation API.

Main entry points: [`app/script.js`](https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/app/script.js) (App logic), [`app/map.html`](https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/app/map.html) (Map shell), [`index.html`](https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/index.html) (Landing page), [`assets/css/global.css`](https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/assets/css/global.css) (Global styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry"]
  node_index["Landing page<br/>html entry<br/>[index.html]"]
end

subgraph group_app["App"]
  node_maphtml["Map shell<br/>html shell<br/>[map.html]"]
  node_script["App logic<br/>frontend logic<br/>[script.js]"]
  node_mapui["Map UI<br/>overlay UI"]
  node_routing["Routing flow<br/>navigation logic"]
  node_location(("Live location<br/>geo tracking"))
  node_campusdata[("Campus data<br/>location dataset")]
  node_filtering["Search and filter<br/>interaction logic"]
end

subgraph group_styles["Styles"]
  node_globalcss["Global styles<br/>shared css<br/>[global.css]"]
  node_appcss["App styles<br/>ui css<br/>[style.css]"]
end

subgraph group_external["External"]
  node_leaflet["Leaflet<br/>map engine"]
  node_routingmachine["Routing Machine<br/>route engine"]
  node_geolocation(("Geolocation API<br/>browser api"))
  node_supabase[("Supabase<br/>remote data")]
  node_tiles[("Map tiles<br/>tile service")]
end

node_browser(("Browser<br/>runtime"))

node_browser -->|"opens"| node_index
node_index -->|"navigates to"| node_maphtml
node_maphtml -->|"loads"| node_script
node_maphtml -->|"uses"| node_globalcss
node_maphtml -->|"uses"| node_appcss
node_script -->|"drives"| node_leaflet
node_script -->|"requests routes"| node_routingmachine
node_script -->|"tracks"| node_geolocation
node_script -->|"fetches data"| node_supabase
node_script -->|"renders basemap"| node_tiles
node_script -->|"updates"| node_mapui
node_script -->|"coordinates"| node_routing
node_script -->|"updates"| node_location
node_script -->|"merges"| node_campusdata
node_script -->|"handles"| node_filtering
node_location -->|"feeds"| node_routing
node_campusdata -->|"powers"| node_filtering
node_campusdata -->|"populates"| node_mapui
node_routing -->|"uses"| node_routingmachine
node_geolocation -->|"provides"| node_location

click node_index "https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/index.html"
click node_maphtml "https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/app/map.html"
click node_script "https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/app/script.js"
click node_globalcss "https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/assets/css/global.css"
click node_appcss "https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/app/style.css"

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_index toneBlue
class node_maphtml,node_script,node_mapui,node_routing,node_location,node_campusdata,node_filtering toneAmber
class node_globalcss,node_appcss toneMint
class node_leaflet,node_routingmachine,node_geolocation,node_supabase,node_tiles toneRose
class node_browser toneNeutral
```

## Components

### Entry

Public landing and app shell

- [Landing page](https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/index.html): html entry · Public-facing entry screen · `index.html`

### App

Interactive campus navigator

- [Map shell](https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/app/map.html): html shell · Application container for the campus navigator · `app/map.html`
- [App logic](https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/app/script.js): frontend logic · Coordinates map, search, routing, location, and campus data · `app/script.js`
- **Map UI**: overlay UI · Custom controls, panels, chips, and marker interactions
- **Routing flow**: navigation logic · Destination routing from live location to selected campus node
- **Live location**: geo tracking · Continuous position updates from the browser location API
- **Campus data**: location dataset · Remote campus nodes merged with local metadata and labels
- **Search and filter**: interaction logic · Category filtering and marker selection behavior

### Styles

Shared and app-specific presentation

- [Global styles](https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/assets/css/global.css): shared css · Base typography, tokens, and utilities · `assets/css/global.css`
- [App styles](https://github.com/abdullatech06/iiitdm-campus-navigator/blob/main/app/style.css): ui css · Map overlays, panels, chips, and responsive layout · `app/style.css`

### External

Runtime dependencies and data services

- **Leaflet**: map engine · Map rendering and camera control layer
- **Routing Machine**: route engine · Walking route generation and path updates
- **Geolocation API**: browser api · Browser-provided live position access
- **Supabase**: remote data · Runtime source for campus nodes and metadata
- **Map tiles**: tile service · OpenStreetMap basemap tiles

### Other components

- **Browser**: runtime · User’s client-side runtime and permissions boundary

## Connections

- Browser → Landing page: opens · Users start at the landing page
- Landing page → Map shell: navigates to · Landing page leads into the navigator shell
- Map shell → App logic: loads · Application shell boots the main behavior layer
- Map shell → Global styles: uses · Shared base styling applies to the page
- Map shell → App styles: uses · App-specific UI styling applies to the shell
- App logic → Leaflet: drives · Main logic initializes and controls the map
- App logic → Routing Machine: requests routes · Routing is computed through the route engine
- App logic → Geolocation API: tracks · Live position comes from the browser API
- App logic → Supabase: fetches data · Campus nodes are loaded at runtime
- App logic → Map tiles: renders basemap · Map display depends on tile service access
- App logic → Map UI: updates · Custom controls and panels are managed by the app layer
- App logic → Routing flow: coordinates · Route creation and updates are orchestrated in app logic
- App logic → Live location: updates · Live position state is maintained continuously
- App logic → Campus data: merges · Remote records are combined with local location metadata
- App logic → Search and filter: handles · Search, filter, and marker selection flow through app logic
- Live location → Routing flow: feeds · Current position is used as route origin
- Campus data → Search and filter: powers · Categories and names support search and filter behavior
- Campus data → Map UI: populates · Marker display and details panel content come from campus nodes
- Routing flow → Routing Machine: uses · Walking path computation is delegated externally
- Geolocation API → Live location: provides · Browser permissions and watchPosition drive updates
