How abdullatech06/iiitdm-campus-navigator works
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: script.js App logic · map.html Map shell · index.html Landing page · global.css Global styles
Components 16
App
Interactive campus navigator
- Map shell · Application container for the campus navigator
app/map.html - App logic · Coordinates map, search, routing, location, and campus data
app/script.js - Map UI · Custom controls, panels, chips, and marker interactions
- Routing flow · Destination routing from live location to selected campus node
- Live location · Continuous position updates from the browser location API
- Campus data · Remote campus nodes merged with local metadata and labels
- Search and filter · Category filtering and marker selection behavior
Styles
Shared and app-specific presentation
- Global styles · Base typography, tokens, and utilities
assets/css/global.css - App styles · Map overlays, panels, chips, and responsive layout
app/style.css
External
Runtime dependencies and data services
- Leaflet · Map rendering and camera control layer
- Routing Machine · Walking route generation and path updates
- Geolocation API · Browser-provided live position access
- Supabase · Runtime source for campus nodes and metadata
- Map tiles · OpenStreetMap basemap tiles
Other components
- Browser · User’s client-side runtime and permissions boundary
Connections 20
- 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