# bidoiasimone/mycampus architecture

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

- Interactive diagram: https://gitdiagram.com/bidoiasimone/mycampus
- Repository: https://github.com/bidoiasimone/mycampus

## Overview

MyCampus is a campus guide app. Its main journey is guided search: choose a category, choose a building, then open a place detail; the home also offers saved shortcuts and a campus map, while profile lets users configure shortcuts. The graph includes documented account/role capabilities and backend domains, but source excerpts chiefly verify the search, map, and shortcut flows; backend links beyond shown Supabase queries are documented at a high level rather than inferred from unsampled code.

Main entry points: [`src/data/places.ts`](https://github.com/bidoiasimone/mycampus/blob/main/src/data/places.ts) (Place queries), [`src/app/index.tsx`](https://github.com/bidoiasimone/mycampus/blob/main/src/app/index.tsx) (Home), [`src/app/search/index.tsx`](https://github.com/bidoiasimone/mycampus/blob/main/src/app/search/index.tsx) (Choose category), [`src/app/search/[category]/index.tsx`](https://github.com/bidoiasimone/mycampus/blob/main/src/app/search/%5Bcategory%5D/index.tsx) (Choose building)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_home["Home<br/>[index.tsx]"]
  node_search_category["Choose category<br/>[index.tsx]"]
  node_search_building["Choose building<br/>[index.tsx]"]
  node_search_place["Choose place<br/>[&#91;building&#93;.tsx]"]
  node_place_detail["Place detail<br/>[&#91;id&#93;.tsx]"]
  node_profile["Shortcut profile<br/>[profile.tsx]"]
  node_shortcut_grid["Shortcut grid<br/>[shortcut-grid.tsx]"]
  node_search_ui["Search options<br/>[option-list.tsx]"]
  node_campus_map["Campus map<br/>[campus-map.tsx]"]
end

subgraph group_domain["Campus data"]
  node_places_api["Place queries<br/>[places.ts]"]
  node_campus_data["Campus data<br/>[campus.ts]"]
end

subgraph group_infra["Platform services"]
  node_async_hook["Async state<br/>[use-async.ts]"]
  node_async_view["Async feedback<br/>[async-view.tsx]"]
  node_shortcuts_hook["Shortcut preferences"]
  node_shortcut_logic["Shortcut rules<br/>[shortcuts.ts]"]
  node_device_storage["Device storage<br/>[device-storage.ts]"]
end

subgraph group_backend["Supabase backend"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_supabase_db[("Postgres campus DB")]
  node_auth["Accounts and roles"]
  node_storage[("Supabase Storage")]
  node_routes["Directions"]
  node_events["Campus events"]
  node_search_events["Search events"]
end

node_visitor(("Campus visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"starts search"| node_search_category
node_home -->|"loads categories"| node_places_api
node_home -->|"reads choices"| node_shortcuts_hook
node_home -->|"shows shortcuts"| node_shortcut_grid
node_home -->|"shows map"| node_campus_map
node_home -->|"opens profile"| node_profile
node_search_category -->|"loads categories"| node_places_api
node_search_category -->|"routes selection"| node_search_building
node_search_building -->|"loads buildings"| node_places_api
node_search_building -->|"routes selection"| node_search_place
node_search_place -->|"loads places"| node_places_api
node_search_place -->|"opens place"| node_place_detail
node_search_category -->|"renders choices"| node_search_ui
node_search_building -->|"renders choices"| node_search_ui
node_search_place -->|"renders choices"| node_search_ui
node_search_category -->|"loads asynchronously"| node_async_hook
node_search_building -->|"loads asynchronously"| node_async_hook
node_search_place -->|"loads asynchronously"| node_async_hook
node_place_detail -->|"loads place"| node_places_api
node_place_detail -->|"loads asynchronously"| node_async_hook
node_profile -->|"edits choices"| node_shortcuts_hook
node_profile -->|"loads categories"| node_async_hook
node_profile -->|"shows load state"| node_async_view
node_search_category -->|"shows load state"| node_async_view
node_search_building -->|"shows load state"| node_async_view
node_search_place -->|"shows load state"| node_async_view
node_place_detail -->|"shows load state"| node_async_view
node_shortcut_grid -->|"uses category rules"| node_shortcut_logic
node_shortcuts_hook -->|"parses and toggles"| node_shortcut_logic
node_shortcuts_hook -->|"reads and writes"| node_device_storage
node_campus_map -->|"loads locations"| node_places_api
node_places_api -->|"queries"| node_supabase_client
node_supabase_client -.->|"accesses data"| node_supabase_db
node_visitor -->|"registers and signs in"| node_auth
node_auth -->|"stores profiles"| node_supabase_db
node_supabase_client -.->|"uses service"| node_storage
node_visitor -.->|"requests directions"| node_routes
node_visitor -.->|"browses events"| node_events
node_supabase_db -.->|"records searches"| node_search_events

click node_home "https://github.com/bidoiasimone/mycampus/blob/main/src/app/index.tsx"
click node_search_category "https://github.com/bidoiasimone/mycampus/blob/main/src/app/search/index.tsx"
click node_search_building "https://github.com/bidoiasimone/mycampus/blob/main/src/app/search/%5Bcategory%5D/index.tsx"
click node_search_place "https://github.com/bidoiasimone/mycampus/blob/main/src/app/search/%5Bcategory%5D/%5Bbuilding%5D.tsx"
click node_place_detail "https://github.com/bidoiasimone/mycampus/blob/main/src/app/place/%5Bid%5D.tsx"
click node_profile "https://github.com/bidoiasimone/mycampus/blob/main/src/app/profile.tsx"
click node_shortcut_grid "https://github.com/bidoiasimone/mycampus/blob/main/src/components/shortcut-grid.tsx"
click node_search_ui "https://github.com/bidoiasimone/mycampus/blob/main/src/components/option-list.tsx"
click node_campus_map "https://github.com/bidoiasimone/mycampus/blob/main/src/components/campus-map.tsx"
click node_async_hook "https://github.com/bidoiasimone/mycampus/blob/main/src/hooks/use-async.ts"
click node_async_view "https://github.com/bidoiasimone/mycampus/blob/main/src/components/async-view.tsx"
click node_shortcuts_hook "https://github.com/bidoiasimone/mycampus/blob/main/src/hooks/use-home-shortcuts.ts"
click node_shortcut_logic "https://github.com/bidoiasimone/mycampus/blob/main/src/utils/shortcuts.ts"
click node_device_storage "https://github.com/bidoiasimone/mycampus/blob/main/src/lib/device-storage.ts"
click node_places_api "https://github.com/bidoiasimone/mycampus/blob/main/src/data/places.ts"
click node_campus_data "https://github.com/bidoiasimone/mycampus/blob/main/src/data/campus.ts"
click node_supabase_client "https://github.com/bidoiasimone/mycampus/blob/main/src/lib/supabase.ts"
click node_supabase_db "https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations"
click node_auth "https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations"
click node_storage "https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations"
click node_routes "https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations"
click node_events "https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations"
click node_search_events "https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations"

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_home,node_search_category,node_search_building,node_search_place,node_place_detail,node_profile,node_shortcut_grid,node_search_ui,node_campus_map toneBlue
class node_places_api,node_campus_data toneAmber
class node_async_hook,node_async_view,node_shortcuts_hook,node_shortcut_logic,node_device_storage toneMint
class node_supabase_client,node_supabase_db,node_auth,node_storage,node_routes,node_events,node_search_events toneRose
class node_visitor toneIndigo
```

## Components

### App experience

- [Home](https://github.com/bidoiasimone/mycampus/blob/main/src/app/index.tsx): `src/app/index.tsx`
- [Choose category](https://github.com/bidoiasimone/mycampus/blob/main/src/app/search/index.tsx): `src/app/search/index.tsx`
- [Choose building](https://github.com/bidoiasimone/mycampus/blob/main/src/app/search/%5Bcategory%5D/index.tsx): `src/app/search/[category]/index.tsx`
- [Choose place](https://github.com/bidoiasimone/mycampus/blob/main/src/app/search/%5Bcategory%5D/%5Bbuilding%5D.tsx): `src/app/search/[category]/[building].tsx`
- [Place detail](https://github.com/bidoiasimone/mycampus/blob/main/src/app/place/%5Bid%5D.tsx): `src/app/place/[id].tsx`
- [Shortcut profile](https://github.com/bidoiasimone/mycampus/blob/main/src/app/profile.tsx): `src/app/profile.tsx`
- [Shortcut grid](https://github.com/bidoiasimone/mycampus/blob/main/src/components/shortcut-grid.tsx): `src/components/shortcut-grid.tsx`
- [Search options](https://github.com/bidoiasimone/mycampus/blob/main/src/components/option-list.tsx): `src/components/option-list.tsx`
- [Campus map](https://github.com/bidoiasimone/mycampus/blob/main/src/components/campus-map.tsx): `src/components/campus-map.tsx`

### Campus data

- [Place queries](https://github.com/bidoiasimone/mycampus/blob/main/src/data/places.ts): `src/data/places.ts`
- [Campus data](https://github.com/bidoiasimone/mycampus/blob/main/src/data/campus.ts): `src/data/campus.ts`

### Platform services

- [Async state](https://github.com/bidoiasimone/mycampus/blob/main/src/hooks/use-async.ts): `src/hooks/use-async.ts`
- [Async feedback](https://github.com/bidoiasimone/mycampus/blob/main/src/components/async-view.tsx): `src/components/async-view.tsx`
- [Shortcut preferences](https://github.com/bidoiasimone/mycampus/blob/main/src/hooks/use-home-shortcuts.ts): `src/hooks/use-home-shortcuts.ts`
- [Shortcut rules](https://github.com/bidoiasimone/mycampus/blob/main/src/utils/shortcuts.ts): `src/utils/shortcuts.ts`
- [Device storage](https://github.com/bidoiasimone/mycampus/blob/main/src/lib/device-storage.ts): `src/lib/device-storage.ts`

### Supabase backend

- [Supabase client](https://github.com/bidoiasimone/mycampus/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Postgres campus DB](https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations): `supabase/migrations`
- [Accounts and roles](https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations): `supabase/migrations`
- [Supabase Storage](https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations): `supabase/migrations`
- [Directions](https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations): `supabase/migrations`
- [Campus events](https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations): `supabase/migrations`
- [Search events](https://github.com/bidoiasimone/mycampus/tree/main/supabase/migrations): `supabase/migrations`

### Other components

- **Campus visitor**

## Connections

- Campus visitor → Home: opens (evidence: `README.md`)
- Campus visitor → Choose category: starts search (evidence: `README.md`)
- Home → Place queries: loads categories (evidence: `src/app/index.tsx`)
- Home → Shortcut preferences: reads choices (evidence: `src/app/index.tsx`)
- Home → Shortcut grid: shows shortcuts (evidence: `src/app/index.tsx`)
- Home → Campus map: shows map (evidence: `src/app/index.tsx`)
- Home → Shortcut profile: opens profile (evidence: `src/app/index.tsx`)
- Choose category → Place queries: loads categories (evidence: `src/app/search/index.tsx`)
- Choose category → Choose building: routes selection (evidence: `README.md`)
- Choose building → Place queries: loads buildings (evidence: `src/app/search/[category]/index.tsx`)
- Choose building → Choose place: routes selection (evidence: `README.md`)
- Choose place → Place queries: loads places (evidence: `src/app/search/[category]/[building].tsx`)
- Choose place → Place detail: opens place (evidence: `README.md`)
- Choose category → Search options: renders choices (evidence: `src/app/search/index.tsx`)
- Choose building → Search options: renders choices (evidence: `src/app/search/[category]/index.tsx`)
- Choose place → Search options: renders choices (evidence: `src/app/search/[category]/[building].tsx`)
- Choose category → Async state: loads asynchronously (evidence: `src/app/search/index.tsx`)
- Choose building → Async state: loads asynchronously (evidence: `src/app/search/[category]/index.tsx`)
- Choose place → Async state: loads asynchronously (evidence: `src/app/search/[category]/[building].tsx`)
- Place detail → Place queries: loads place (evidence: `src/app/place/[id].tsx`)
- Place detail → Async state: loads asynchronously (evidence: `src/app/place/[id].tsx`)
- Shortcut profile → Shortcut preferences: edits choices (evidence: `src/app/profile.tsx`)
- Shortcut profile → Async state: loads categories (evidence: `src/app/profile.tsx`)
- Shortcut profile → Async feedback: shows load state (evidence: `src/app/profile.tsx`)
- Choose category → Async feedback: shows load state (evidence: `src/app/search/index.tsx`)
- Choose building → Async feedback: shows load state (evidence: `src/app/search/[category]/index.tsx`)
- Choose place → Async feedback: shows load state (evidence: `src/app/search/[category]/[building].tsx`)
- Place detail → Async feedback: shows load state (evidence: `src/app/place/[id].tsx`)
- Shortcut grid → Shortcut rules: uses category rules (evidence: `src/components/shortcut-grid.tsx`)
- Shortcut preferences → Shortcut rules: parses and toggles (evidence: `src/hooks/use-home-shortcuts.ts`)
- Shortcut preferences → Device storage: reads and writes (evidence: `src/hooks/use-home-shortcuts.ts`)
- Campus map → Place queries: loads locations (evidence: `src/components/campus-map.tsx`)
- Place queries → Supabase client: queries (evidence: `src/data/places.ts`)
- Supabase client → Postgres campus DB: accesses data (evidence: `README.md`)
- Campus visitor → Accounts and roles: registers and signs in (evidence: `README.md`)
- Accounts and roles → Postgres campus DB: stores profiles (evidence: `README.md`)
- Supabase client → Supabase Storage: uses service (evidence: `README.md`)
- Campus visitor → Directions: requests directions
- Campus visitor → Campus events: browses events
- Postgres campus DB → Search events: records searches
