# aew261/css37w1-project-marvel-dev-ops architecture

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

- Interactive diagram: https://gitdiagram.com/aew261/css37w1-project-marvel-dev-ops
- Repository: https://github.com/aew261/css37w1-project-marvel-dev-ops

## Overview

ResHub is a student off-campus residence discovery and review application. Students authenticate, search or browse residences, inspect residence details and images, and submit structured reviews; administrators manage residence uploads, listings, and administrator access. The graph includes the documented dashboard and helpful-review capabilities where represented by available modules. Source excerpts show routing, review submission, and API endpoint definitions; several component interactions are supported only by the SOURCE INDEX, so unsampled behavior is not inferred.

Main entry points: [`web_app/res_hub/src/App.jsx`](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/src/App.jsx) (Route map), [`web_app/res_hub/api/app_api.js`](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/api/app_api.js) (Residence API), [`web_app/res_hub/components/pages/Residence_Info.jsx`](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Residence_Info.jsx) (Residence details), [`web_app/res_hub/api/auth_api.js`](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/api/auth_api.js) (Auth API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app_entry["App entry<br/>[main.jsx]"]
  node_routes["Route map<br/>[App.jsx]"]
  node_site_layout["Site layout<br/>[Layout.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_provider["Auth provider<br/>[AuthProvider.jsx]"]
  node_protected_route["Protected route<br/>[ProtectedRoute.jsx]"]
  node_login_signup["Account access<br/>[Login.jsx]"]
  node_signup_page["Student signup<br/>[Signup.jsx]"]
end

subgraph group_student["Student residence journey"]
  node_home_page["Residence browsing<br/>[Home.jsx]"]
  node_search_page["Residence search<br/>[Search.jsx]"]
  node_residence_card["Residence card<br/>[ResidenceCard.jsx]"]
  node_residence_info["Residence details<br/>[Residence_Info.jsx]"]
  node_res_images["Residence images<br/>[ResImages.jsx]"]
  node_images_overlay["Image viewer<br/>[ImagesOverlay.jsx]"]
  node_review_page["Review submission"]
end

subgraph group_admin["Administration"]
  node_admin_dashboard["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_admin_data["Admin listing data<br/>[adminData.js]"]
  node_admin_search["Admin search<br/>[AdminSearch.jsx]"]
  node_upload_residence["Residence upload"]
  node_add_admin["Add administrator<br/>[AddAdmin.jsx]"]
end

subgraph group_services["Data and state"]
  node_auth_api["Auth API<br/>[auth_api.js]"]
  node_reviews_state["Review state<br/>[reviews.js]"]
  node_app_api["Residence API<br/>[app_api.js]"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
  node_supabase_backend[("Supabase services")]
end

node_student_actor(("Student"))
node_admin_actor(("Administrator"))

node_student_actor -->|"opens app"| node_app_entry
node_admin_actor -->|"opens app"| node_app_entry
node_app_entry -->|"renders"| node_routes
node_routes -->|"uses auth"| node_auth_provider
node_routes -->|"guards pages"| node_protected_route
node_routes -->|"routes through"| node_site_layout
node_routes -->|"routes to"| node_login_signup
node_routes -->|"routes to"| node_signup_page
node_routes -->|"redirects to"| node_home_page
node_routes -->|"routes to"| node_search_page
node_routes -->|"routes to"| node_residence_info
node_routes -->|"routes to"| node_review_page
node_routes -->|"routes to"| node_admin_dashboard
node_routes -->|"routes to"| node_upload_residence
node_routes -->|"routes to"| node_add_admin
node_auth_provider -->|"loads session"| node_supabase_client
node_login_signup -->|"authenticates"| node_auth_api
node_signup_page -->|"registers"| node_auth_api
node_auth_api -->|"gets auth token"| node_supabase_client
node_auth_api -->|"sends auth requests"| node_supabase_backend
node_home_page -->|"fetches listings"| node_app_api
node_home_page -->|"renders"| node_residence_card
node_search_page -->|"requests suggestions"| node_app_api
node_search_page -->|"renders"| node_residence_card
node_residence_info -->|"fetches details"| node_app_api
node_residence_info -->|"uses review state"| node_reviews_state
node_residence_info -->|"renders"| node_res_images
node_residence_info -->|"opens viewer"| node_images_overlay
node_review_page -->|"submits review"| node_app_api
node_admin_dashboard -->|"fetches statistics"| node_app_api
node_admin_dashboard -->|"uses listing data"| node_admin_data
node_admin_search -->|"searches data"| node_admin_data
node_upload_residence -->|"uploads residence"| node_app_api
node_add_admin -->|"adds administrator"| node_app_api
node_app_api -->|"gets auth token"| node_supabase_client
node_app_api -->|"calls functions"| node_supabase_backend
node_images_overlay -.->|"uses modal state"| node_reviews_state

click node_app_entry "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/src/main.jsx"
click node_routes "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/src/App.jsx"
click node_site_layout "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/layout/Layout.jsx"
click node_auth_provider "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/authentication/AuthProvider.jsx"
click node_protected_route "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/authentication/ProtectedRoute.jsx"
click node_login_signup "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Login.jsx"
click node_signup_page "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Signup.jsx"
click node_auth_api "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/api/auth_api.js"
click node_home_page "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Home.jsx"
click node_search_page "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Search.jsx"
click node_residence_card "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/common/ResidenceCard.jsx"
click node_residence_info "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Residence_Info.jsx"
click node_res_images "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/composites/components/ResImages.jsx"
click node_images_overlay "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/modal/ImagesOverlay.jsx"
click node_review_page "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/ResidenceReview.jsx"
click node_reviews_state "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/redux/reviews.js"
click node_admin_dashboard "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/admin/AdminDashboard.jsx"
click node_admin_data "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/admin/adminData.js"
click node_admin_search "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/admin/AdminSearch.jsx"
click node_upload_residence "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/admin/UploadResidence.jsx"
click node_add_admin "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/admin/AddAdmin.jsx"
click node_app_api "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/api/app_api.js"
click node_supabase_client "https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/lib/supabase.js"

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_entry,node_routes,node_site_layout toneBlue
class node_auth_provider,node_protected_route,node_login_signup,node_signup_page toneAmber
class node_home_page,node_search_page,node_residence_card,node_residence_info,node_res_images,node_images_overlay,node_review_page toneMint
class node_admin_dashboard,node_admin_data,node_admin_search,node_upload_residence,node_add_admin toneRose
class node_auth_api,node_reviews_state,node_app_api,node_supabase_client,node_supabase_backend,node_student_actor,node_admin_actor toneIndigo
```

## Components

### Application shell

- [App entry](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/src/main.jsx): `web_app/res_hub/src/main.jsx`
- [Route map](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/src/App.jsx): `web_app/res_hub/src/App.jsx`
- [Site layout](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/layout/Layout.jsx): `web_app/res_hub/components/layout/Layout.jsx`

### Identity and access

- [Auth provider](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/authentication/AuthProvider.jsx): `web_app/res_hub/authentication/AuthProvider.jsx`
- [Protected route](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/authentication/ProtectedRoute.jsx): `web_app/res_hub/authentication/ProtectedRoute.jsx`
- [Account access](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Login.jsx): `web_app/res_hub/components/pages/Login.jsx`
- [Student signup](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Signup.jsx): `web_app/res_hub/components/pages/Signup.jsx`

### Student residence journey

- [Residence browsing](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Home.jsx): `web_app/res_hub/components/pages/Home.jsx`
- [Residence search](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Search.jsx): `web_app/res_hub/components/pages/Search.jsx`
- [Residence card](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/common/ResidenceCard.jsx): `web_app/res_hub/components/common/ResidenceCard.jsx`
- [Residence details](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/Residence_Info.jsx): `web_app/res_hub/components/pages/Residence_Info.jsx`
- [Residence images](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/composites/components/ResImages.jsx): `web_app/res_hub/composites/components/ResImages.jsx`
- [Image viewer](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/modal/ImagesOverlay.jsx): `web_app/res_hub/components/modal/ImagesOverlay.jsx`
- [Review submission](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/pages/ResidenceReview.jsx): `web_app/res_hub/components/pages/ResidenceReview.jsx`

### Administration

- [Admin dashboard](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/admin/AdminDashboard.jsx): `web_app/res_hub/components/admin/AdminDashboard.jsx`
- [Admin listing data](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/admin/adminData.js): `web_app/res_hub/components/admin/adminData.js`
- [Admin search](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/admin/AdminSearch.jsx): `web_app/res_hub/components/admin/AdminSearch.jsx`
- [Residence upload](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/admin/UploadResidence.jsx): `web_app/res_hub/components/admin/UploadResidence.jsx`
- [Add administrator](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/components/admin/AddAdmin.jsx): `web_app/res_hub/components/admin/AddAdmin.jsx`

### Data and state

- [Auth API](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/api/auth_api.js): `web_app/res_hub/api/auth_api.js`
- [Review state](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/redux/reviews.js): `web_app/res_hub/redux/reviews.js`
- [Residence API](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/api/app_api.js): `web_app/res_hub/api/app_api.js`
- [Supabase client](https://github.com/aew261/css37w1-project-marvel-dev-ops/blob/main/web_app/res_hub/lib/supabase.js): `web_app/res_hub/lib/supabase.js`
- **Supabase services**

### Other components

- **Student**
- **Administrator**

## Connections

- Student → App entry: opens app (evidence: `web_app/res_hub/src/main.jsx`)
- Administrator → App entry: opens app (evidence: `web_app/res_hub/src/main.jsx`)
- App entry → Route map: renders (evidence: `web_app/res_hub/src/main.jsx`)
- Route map → Auth provider: uses auth (evidence: `web_app/res_hub/src/App.jsx`)
- Route map → Protected route: guards pages (evidence: `web_app/res_hub/src/App.jsx`)
- Route map → Site layout: routes through (evidence: `web_app/res_hub/src/App.jsx`)
- Route map → Account access: routes to (evidence: `web_app/res_hub/src/App.jsx`)
- Route map → Student signup: routes to (evidence: `web_app/res_hub/src/App.jsx`)
- Route map → Residence browsing: redirects to
- Route map → Residence search: routes to (evidence: `web_app/res_hub/src/App.jsx`)
- Route map → Residence details: routes to (evidence: `web_app/res_hub/src/App.jsx`)
- Route map → Review submission: routes to (evidence: `web_app/res_hub/src/App.jsx`)
- Route map → Admin dashboard: routes to (evidence: `web_app/res_hub/src/App.jsx`)
- Route map → Residence upload: routes to (evidence: `web_app/res_hub/src/App.jsx`)
- Route map → Add administrator: routes to (evidence: `web_app/res_hub/src/App.jsx`)
- Auth provider → Supabase client: loads session (evidence: `web_app/res_hub/authentication/AuthProvider.jsx`)
- Account access → Auth API: authenticates (evidence: `web_app/res_hub/components/pages/Login.jsx`)
- Student signup → Auth API: registers (evidence: `web_app/res_hub/components/pages/Signup.jsx`)
- Auth API → Supabase client: gets auth token (evidence: `web_app/res_hub/api/auth_api.js`)
- Auth API → Supabase services: sends auth requests (evidence: `web_app/res_hub/api/auth_api.js`)
- Residence browsing → Residence API: fetches listings (evidence: `web_app/res_hub/components/pages/Home.jsx`)
- Residence browsing → Residence card: renders (evidence: `web_app/res_hub/components/pages/Home.jsx`)
- Residence search → Residence API: requests suggestions (evidence: `web_app/res_hub/components/pages/Search.jsx`)
- Residence search → Residence card: renders (evidence: `web_app/res_hub/components/pages/Search.jsx`)
- Residence details → Residence API: fetches details (evidence: `web_app/res_hub/components/pages/Residence_Info.jsx`)
- Residence details → Review state: uses review state (evidence: `web_app/res_hub/components/pages/Residence_Info.jsx`)
- Residence details → Residence images: renders (evidence: `web_app/res_hub/components/pages/Residence_Info.jsx`)
- Residence details → Image viewer: opens viewer (evidence: `web_app/res_hub/components/pages/Residence_Info.jsx`)
- Review submission → Residence API: submits review (evidence: `web_app/res_hub/components/pages/ResidenceReview.jsx`)
- Admin dashboard → Residence API: fetches statistics (evidence: `web_app/res_hub/components/admin/AdminDashboard.jsx`)
- Admin dashboard → Admin listing data: uses listing data (evidence: `web_app/res_hub/components/admin/AdminDashboard.jsx`)
- Admin search → Admin listing data: searches data (evidence: `web_app/res_hub/components/admin/AdminSearch.jsx`)
- Residence upload → Residence API: uploads residence (evidence: `web_app/res_hub/components/admin/UploadResidence.jsx`)
- Add administrator → Residence API: adds administrator (evidence: `web_app/res_hub/components/admin/AddAdmin.jsx`)
- Residence API → Supabase client: gets auth token (evidence: `web_app/res_hub/api/app_api.js`)
- Residence API → Supabase services: calls functions (evidence: `web_app/res_hub/api/app_api.js`)
- Image viewer → Review state: uses modal state
