# amherryyy/roomscouter architecture

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

- Interactive diagram: https://gitdiagram.com/amherryyy/roomscouter
- Repository: https://github.com/amherryyy/roomscouter

## Overview

RoomScouter helps students find and compare boarding houses near one university, while owners maintain listings and administrators moderate content. The main student journey is search and filter, browse results, inspect a listing and its location, then optionally save it, review it, or report it. Owners create and edit listings for review; administrators approve listings and handle reports and reviews. The graph includes authentication and the Supabase data boundary. Some subsystem connections rely on README documentation or SOURCE INDEX references; unsampled implementation details are not asserted.

Main entry points: [`src/lib/supabase/server.ts`](https://github.com/amherryyy/roomscouter/blob/main/src/lib/supabase/server.ts) (Server data client), [`app/listings/[id]/page.tsx`](https://github.com/amherryyy/roomscouter/blob/main/app/listings/%5Bid%5D/page.tsx) (Listing details), [`app/admin/page.tsx`](https://github.com/amherryyy/roomscouter/blob/main/app/admin/page.tsx) (Admin portal), [`app/page.tsx`](https://github.com/amherryyy/roomscouter/blob/main/app/page.tsx) (Search and browse)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Student discovery"]
  node_home["Search and browse<br/>[page.tsx]"]
  node_discovery_model["Search filters<br/>[model.ts]"]
  node_discovery_queries["Discovery queries<br/>[queries.ts]"]
  node_listing_detail["Listing details<br/>[page.tsx]"]
  node_university["University location<br/>[university.ts]"]
  node_map["Map view<br/>[page.tsx]"]
end

subgraph group_accounts["Accounts and students"]
  node_auth_pages["Login and registration<br/>[auth-page.tsx]"]
  node_auth_actions["Authentication actions<br/>[actions.ts]"]
  node_account["Account page<br/>[page.tsx]"]
  node_favorites["Saved listings<br/>[actions.ts]"]
  node_reviews["Student reviews<br/>[review-section.tsx]"]
end

subgraph group_owners["Owner listings"]
  node_owner_portal["Owner portal<br/>[page.tsx]"]
  node_listing_editor["Listing editor<br/>[listing-form.tsx]"]
  node_listing_actions["Listing operations<br/>[actions.ts]"]
end

subgraph group_trust["Administration and trust"]
  node_reports["Content reports<br/>[actions.ts]"]
  node_admin_portal["Admin portal<br/>[page.tsx]"]
  node_moderation["Moderation operations<br/>[actions.ts]"]
  node_report_moderation["Report moderation<br/>[report-actions.ts]"]
  node_review_moderation["Review moderation<br/>[review-actions.ts]"]
end

node_student(("Student"))
node_owner(("Owner"))
node_admin(("Administrator"))
node_supabase_client["Server data client<br/>[server.ts]"]
node_supabase[("Supabase")]

node_student -->|"searches"| node_home
node_home -->|"parses filters"| node_discovery_model
node_home -->|"loads results"| node_discovery_queries
node_discovery_queries -->|"queries data"| node_supabase_client
node_discovery_queries -->|"uses filters"| node_discovery_model
node_student -->|"opens listing"| node_listing_detail
node_listing_detail -->|"loads listing"| node_supabase_client
node_listing_detail -->|"calculates distance"| node_university
node_student -->|"views map"| node_map
node_map -->|"uses location"| node_university
node_student -->|"registers or logs in"| node_auth_pages
node_auth_pages -->|"submits credentials"| node_auth_actions
node_auth_actions -->|"authenticates"| node_supabase_client
node_auth_actions -->|"redirects after login"| node_account
node_student -->|"saves listing"| node_favorites
node_listing_detail -->|"offers save action"| node_favorites
node_student -->|"writes review"| node_reviews
node_listing_detail -->|"renders reviews"| node_reviews
node_student -->|"reports content"| node_reports
node_listing_detail -->|"offers report action"| node_reports
node_owner -->|"maintains listings"| node_owner_portal
node_owner_portal -->|"opens editor"| node_listing_editor
node_listing_editor -->|"submits listing"| node_listing_actions
node_listing_actions -->|"writes listing"| node_supabase_client
node_admin -->|"reviews content"| node_admin_portal
node_admin_portal -->|"moderates listings"| node_moderation
node_admin_portal -->|"handles reports"| node_report_moderation
node_admin_portal -->|"moderates reviews"| node_review_moderation
node_moderation -.->|"updates listings"| node_supabase_client
node_report_moderation -.->|"resolves reports"| node_supabase_client
node_review_moderation -->|"updates reviews"| node_supabase_client
node_supabase_client -->|"connects"| node_supabase

click node_home "https://github.com/amherryyy/roomscouter/blob/main/app/page.tsx"
click node_discovery_model "https://github.com/amherryyy/roomscouter/blob/main/src/features/discovery/model.ts"
click node_discovery_queries "https://github.com/amherryyy/roomscouter/blob/main/src/features/discovery/queries.ts"
click node_listing_detail "https://github.com/amherryyy/roomscouter/blob/main/app/listings/%5Bid%5D/page.tsx"
click node_university "https://github.com/amherryyy/roomscouter/blob/main/src/features/discovery/university.ts"
click node_map "https://github.com/amherryyy/roomscouter/blob/main/app/map/page.tsx"
click node_auth_pages "https://github.com/amherryyy/roomscouter/blob/main/src/components/auth-page.tsx"
click node_auth_actions "https://github.com/amherryyy/roomscouter/blob/main/src/features/auth/actions.ts"
click node_account "https://github.com/amherryyy/roomscouter/blob/main/app/account/page.tsx"
click node_favorites "https://github.com/amherryyy/roomscouter/blob/main/src/features/favorites/actions.ts"
click node_reviews "https://github.com/amherryyy/roomscouter/blob/main/src/features/reviews/review-section.tsx"
click node_reports "https://github.com/amherryyy/roomscouter/blob/main/src/features/reports/actions.ts"
click node_owner_portal "https://github.com/amherryyy/roomscouter/blob/main/app/owner/page.tsx"
click node_listing_editor "https://github.com/amherryyy/roomscouter/blob/main/src/features/listings/listing-form.tsx"
click node_listing_actions "https://github.com/amherryyy/roomscouter/blob/main/src/features/listings/actions.ts"
click node_admin_portal "https://github.com/amherryyy/roomscouter/blob/main/app/admin/page.tsx"
click node_moderation "https://github.com/amherryyy/roomscouter/blob/main/src/features/moderation/actions.ts"
click node_report_moderation "https://github.com/amherryyy/roomscouter/blob/main/src/features/moderation/report-actions.ts"
click node_review_moderation "https://github.com/amherryyy/roomscouter/blob/main/src/features/moderation/review-actions.ts"
click node_supabase_client "https://github.com/amherryyy/roomscouter/blob/main/src/lib/supabase/server.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_home,node_discovery_model,node_discovery_queries,node_listing_detail,node_university,node_map,node_supabase_client toneBlue
class node_auth_pages,node_auth_actions,node_account,node_favorites,node_reviews,node_supabase toneAmber
class node_owner_portal,node_listing_editor,node_listing_actions toneMint
class node_reports,node_admin_portal,node_moderation,node_report_moderation,node_review_moderation toneRose
class node_student,node_owner,node_admin toneIndigo
```

## Components

### Student discovery

- [Search and browse](https://github.com/amherryyy/roomscouter/blob/main/app/page.tsx): `app/page.tsx`
- [Search filters](https://github.com/amherryyy/roomscouter/blob/main/src/features/discovery/model.ts): `src/features/discovery/model.ts`
- [Discovery queries](https://github.com/amherryyy/roomscouter/blob/main/src/features/discovery/queries.ts): `src/features/discovery/queries.ts`
- [Listing details](https://github.com/amherryyy/roomscouter/blob/main/app/listings/%5Bid%5D/page.tsx): `app/listings/[id]/page.tsx`
- [University location](https://github.com/amherryyy/roomscouter/blob/main/src/features/discovery/university.ts): `src/features/discovery/university.ts`
- [Map view](https://github.com/amherryyy/roomscouter/blob/main/app/map/page.tsx): `app/map/page.tsx`

### Accounts and students

- [Login and registration](https://github.com/amherryyy/roomscouter/blob/main/src/components/auth-page.tsx): `src/components/auth-page.tsx`
- [Authentication actions](https://github.com/amherryyy/roomscouter/blob/main/src/features/auth/actions.ts): `src/features/auth/actions.ts`
- [Account page](https://github.com/amherryyy/roomscouter/blob/main/app/account/page.tsx): `app/account/page.tsx`
- [Saved listings](https://github.com/amherryyy/roomscouter/blob/main/src/features/favorites/actions.ts): `src/features/favorites/actions.ts`
- [Student reviews](https://github.com/amherryyy/roomscouter/blob/main/src/features/reviews/review-section.tsx): `src/features/reviews/review-section.tsx`

### Owner listings

- [Owner portal](https://github.com/amherryyy/roomscouter/blob/main/app/owner/page.tsx): `app/owner/page.tsx`
- [Listing editor](https://github.com/amherryyy/roomscouter/blob/main/src/features/listings/listing-form.tsx): `src/features/listings/listing-form.tsx`
- [Listing operations](https://github.com/amherryyy/roomscouter/blob/main/src/features/listings/actions.ts): `src/features/listings/actions.ts`

### Administration and trust

- [Content reports](https://github.com/amherryyy/roomscouter/blob/main/src/features/reports/actions.ts): `src/features/reports/actions.ts`
- [Admin portal](https://github.com/amherryyy/roomscouter/blob/main/app/admin/page.tsx): `app/admin/page.tsx`
- [Moderation operations](https://github.com/amherryyy/roomscouter/blob/main/src/features/moderation/actions.ts): `src/features/moderation/actions.ts`
- [Report moderation](https://github.com/amherryyy/roomscouter/blob/main/src/features/moderation/report-actions.ts): `src/features/moderation/report-actions.ts`
- [Review moderation](https://github.com/amherryyy/roomscouter/blob/main/src/features/moderation/review-actions.ts): `src/features/moderation/review-actions.ts`

### Other components

- **Student**
- **Owner**
- **Administrator**
- [Server data client](https://github.com/amherryyy/roomscouter/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- **Supabase**

## Connections

- Student → Search and browse: searches (evidence: `README.md`)
- Search and browse → Search filters: parses filters (evidence: `app/page.tsx`)
- Search and browse → Discovery queries: loads results (evidence: `app/page.tsx`)
- Discovery queries → Server data client: queries data (evidence: `src/features/discovery/queries.ts`)
- Discovery queries → Search filters: uses filters (evidence: `src/features/discovery/queries.ts`)
- Student → Listing details: opens listing (evidence: `README.md`)
- Listing details → Server data client: loads listing (evidence: `app/listings/[id]/page.tsx`)
- Listing details → University location: calculates distance (evidence: `app/listings/[id]/page.tsx`)
- Student → Map view: views map (evidence: `README.md`)
- Map view → University location: uses location (evidence: `app/map/page.tsx`)
- Student → Login and registration: registers or logs in (evidence: `README.md`)
- Login and registration → Authentication actions: submits credentials (evidence: `app/login/page.tsx`)
- Authentication actions → Server data client: authenticates (evidence: `src/features/auth/actions.ts`)
- Authentication actions → Account page: redirects after login (evidence: `src/features/auth/actions.ts`)
- Student → Saved listings: saves listing (evidence: `README.md`)
- Listing details → Saved listings: offers save action (evidence: `app/listings/[id]/page.tsx`)
- Student → Student reviews: writes review (evidence: `README.md`)
- Listing details → Student reviews: renders reviews (evidence: `app/listings/[id]/page.tsx`)
- Student → Content reports: reports content (evidence: `README.md`)
- Listing details → Content reports: offers report action (evidence: `app/listings/[id]/page.tsx`)
- Owner → Owner portal: maintains listings (evidence: `README.md`)
- Owner portal → Listing editor: opens editor
- Listing editor → Listing operations: submits listing (evidence: `app/owner/listings/new/page.tsx`)
- Listing operations → Server data client: writes listing (evidence: `src/features/listings/actions.ts`)
- Administrator → Admin portal: reviews content (evidence: `README.md`)
- Admin portal → Moderation operations: moderates listings (evidence: `README.md`)
- Admin portal → Report moderation: handles reports
- Admin portal → Review moderation: moderates reviews
- Moderation operations → Server data client: updates listings
- Report moderation → Server data client: resolves reports
- Review moderation → Server data client: updates reviews (evidence: `src/features/moderation/review-actions.ts`)
- Server data client → Supabase: connects (evidence: `src/lib/supabase/server.ts`)
