# sridath07/campuslostandfound architecture

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

- Interactive diagram: https://gitdiagram.com/sridath07/campuslostandfound
- Repository: https://github.com/sridath07/campuslostandfound

## Overview

Campus Lost-and-Found provides two user-facing routes: a standalone browser board backed directly by Supabase, and a Java console/optional local HTTP server backed by PostgreSQL. Both support reporting, browsing/search, matching, and claim/return lifecycle work; the Java service owns report rules while its repository loads and saves snapshots. The README documents shared database behavior and protected public access. The sampled source confirms the main Java calls and browser REST requests; the broader page interactions and server routes are only partially excerpted.

Main entry points: [`src/main/java/edu/campus/lostfound/LostAndFoundService.java`](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/LostAndFoundService.java) (Report service), [`src/main/java/edu/campus/lostfound/Main.java`](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/Main.java) (Application entry), [`src/main/java/edu/campus/lostfound/WebServer.java`](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/WebServer.java) (HTTP server), [`src/main/java/edu/campus/lostfound/ReportRepository.java`](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/ReportRepository.java) (Report repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser Website"]
  node_standalone_page["Standalone page<br/>[index.html]"]
  node_browser_app["Browser workflows<br/>[app.js]"]
  node_web_config["Supabase config<br/>[supabase-config.js]"]
  node_embedded_page["Served page<br/>[index.html]"]
  node_embedded_app["Embedded workflows<br/>[app.js]"]
end

subgraph group_java["Java Application"]
  node_main["Application entry<br/>[Main.java]"]
  node_http_server["HTTP server<br/>[WebServer.java]"]
end

subgraph group_domain["Report Domain"]
  node_service["Report service"]
  node_report_model["Report lifecycle<br/>[ItemReport.java]"]
  node_lost_report["Lost report"]
  node_found_report["Found report"]
  node_reporter["Reporter details<br/>[User.java]"]
  node_status_types["Status and type<br/>[ItemStatus.java]"]
end

subgraph group_persistence["Persistence"]
  node_repository["Report repository"]
  node_schema["Access policies<br/>[schema.sql]"]
  node_supabase[("Supabase PostgreSQL")]
end

node_campus_user(("Campus user"))
node_java_user(("Console user"))

node_campus_user -->|"opens"| node_standalone_page
node_standalone_page -->|"loads"| node_browser_app
node_browser_app -->|"uses settings"| node_web_config
node_browser_app -->|"reads and writes"| node_supabase
node_schema -->|"defines access"| node_supabase
node_campus_user -->|"uses console"| node_main
node_main -->|"dispatches actions"| node_service
node_main -->|"loads and saves"| node_repository
node_main -->|"starts optional server"| node_http_server
node_http_server -->|"handles report actions"| node_service
node_http_server -->|"saves updates"| node_repository
node_http_server -->|"serves assets"| node_embedded_page
node_embedded_page -.->|"loads"| node_embedded_app
node_service -->|"creates"| node_lost_report
node_service -->|"creates"| node_found_report
node_lost_report -->|"extends"| node_report_model
node_found_report -->|"extends"| node_report_model
node_report_model -->|"contains"| node_reporter
node_service -->|"searches and updates"| node_report_model
node_service -->|"checks lifecycle"| node_status_types
node_repository -->|"loads and saves"| node_supabase
node_repository -->|"restores reports"| node_service

click node_standalone_page "https://github.com/sridath07/campuslostandfound/blob/main/website/index.html"
click node_browser_app "https://github.com/sridath07/campuslostandfound/blob/main/website/app.js"
click node_web_config "https://github.com/sridath07/campuslostandfound/blob/main/website/supabase-config.js"
click node_embedded_page "https://github.com/sridath07/campuslostandfound/blob/main/src/main/resources/web/index.html"
click node_embedded_app "https://github.com/sridath07/campuslostandfound/blob/main/src/main/resources/web/app.js"
click node_main "https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/Main.java"
click node_http_server "https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/WebServer.java"
click node_service "https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/LostAndFoundService.java"
click node_report_model "https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/ItemReport.java"
click node_lost_report "https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/LostItemReport.java"
click node_found_report "https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/FoundItemReport.java"
click node_reporter "https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/User.java"
click node_status_types "https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/ItemStatus.java"
click node_repository "https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/ReportRepository.java"
click node_schema "https://github.com/sridath07/campuslostandfound/blob/main/supabase/schema.sql"

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_standalone_page,node_browser_app,node_web_config,node_embedded_page,node_embedded_app,node_campus_user,node_java_user toneBlue
class node_main,node_http_server toneAmber
class node_service,node_report_model,node_lost_report,node_found_report,node_reporter,node_status_types toneMint
class node_repository,node_schema,node_supabase toneRose
```

## Components

### Browser Website

- [Standalone page](https://github.com/sridath07/campuslostandfound/blob/main/website/index.html): `website/index.html`
- [Browser workflows](https://github.com/sridath07/campuslostandfound/blob/main/website/app.js): `website/app.js`
- [Supabase config](https://github.com/sridath07/campuslostandfound/blob/main/website/supabase-config.js): `website/supabase-config.js`
- [Served page](https://github.com/sridath07/campuslostandfound/blob/main/src/main/resources/web/index.html): `src/main/resources/web/index.html`
- [Embedded workflows](https://github.com/sridath07/campuslostandfound/blob/main/src/main/resources/web/app.js): `src/main/resources/web/app.js`

### Java Application

- [Application entry](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/Main.java): `src/main/java/edu/campus/lostfound/Main.java`
- [HTTP server](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/WebServer.java): `src/main/java/edu/campus/lostfound/WebServer.java`

### Report Domain

- [Report service](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/LostAndFoundService.java): `src/main/java/edu/campus/lostfound/LostAndFoundService.java`
- [Report lifecycle](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/ItemReport.java): `src/main/java/edu/campus/lostfound/ItemReport.java`
- [Lost report](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/LostItemReport.java): `src/main/java/edu/campus/lostfound/LostItemReport.java`
- [Found report](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/FoundItemReport.java): `src/main/java/edu/campus/lostfound/FoundItemReport.java`
- [Reporter details](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/User.java): `src/main/java/edu/campus/lostfound/User.java`
- [Status and type](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/ItemStatus.java): `src/main/java/edu/campus/lostfound/ItemStatus.java`

### Persistence

- [Report repository](https://github.com/sridath07/campuslostandfound/blob/main/src/main/java/edu/campus/lostfound/ReportRepository.java): `src/main/java/edu/campus/lostfound/ReportRepository.java`
- [Access policies](https://github.com/sridath07/campuslostandfound/blob/main/supabase/schema.sql): `supabase/schema.sql`
- **Supabase PostgreSQL**

### Other components

- **Campus user**
- **Console user**

## Connections

- Campus user → Standalone page: opens (evidence: `README.md`)
- Standalone page → Browser workflows: loads (evidence: `README.md`)
- Browser workflows → Supabase config: uses settings (evidence: `website/app.js`)
- Browser workflows → Supabase PostgreSQL: reads and writes (evidence: `website/app.js`)
- Access policies → Supabase PostgreSQL: defines access (evidence: `README.md`)
- Campus user → Application entry: uses console (evidence: `README.md`)
- Application entry → Report service: dispatches actions (evidence: `src/main/java/edu/campus/lostfound/Main.java`)
- Application entry → Report repository: loads and saves (evidence: `src/main/java/edu/campus/lostfound/Main.java`)
- Application entry → HTTP server: starts optional server (evidence: `src/main/java/edu/campus/lostfound/Main.java`)
- HTTP server → Report service: handles report actions (evidence: `src/main/java/edu/campus/lostfound/WebServer.java`)
- HTTP server → Report repository: saves updates (evidence: `src/main/java/edu/campus/lostfound/WebServer.java`)
- HTTP server → Served page: serves assets (evidence: `src/main/java/edu/campus/lostfound/WebServer.java`)
- Served page → Embedded workflows: loads
- Report service → Lost report: creates (evidence: `src/main/java/edu/campus/lostfound/LostAndFoundService.java`)
- Report service → Found report: creates (evidence: `src/main/java/edu/campus/lostfound/LostAndFoundService.java`)
- Lost report → Report lifecycle: extends (evidence: `src/main/java/edu/campus/lostfound/LostItemReport.java`)
- Found report → Report lifecycle: extends (evidence: `src/main/java/edu/campus/lostfound/FoundItemReport.java`)
- Report lifecycle → Reporter details: contains (evidence: `src/main/java/edu/campus/lostfound/ItemReport.java`)
- Report service → Report lifecycle: searches and updates (evidence: `src/main/java/edu/campus/lostfound/LostAndFoundService.java`)
- Report service → Status and type: checks lifecycle (evidence: `src/main/java/edu/campus/lostfound/LostAndFoundService.java`)
- Report repository → Supabase PostgreSQL: loads and saves (evidence: `README.md`)
- Report repository → Report service: restores reports (evidence: `src/main/java/edu/campus/lostfound/ReportRepository.java`)
