# virat991v/lost-foundweb architecture

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

- Interactive diagram: https://gitdiagram.com/virat991v/lost-foundweb
- Repository: https://github.com/virat991v/lost-foundweb

## Overview

This is a campus lost-and-found platform. Students authenticate, report lost or found property, browse campus reports, and pursue ownership verification through return confirmation; administrators manage claims, users, flags, and activity. Supabase provides authentication, persistence, file storage, and notification subscriptions. The graph reflects routed pages and source-index references, with README documentation used for broader features. Several page and admin implementations were not sampled, so their internal calls are not inferred.

Main entry points: [`src/App.jsx`](https://github.com/virat991v/lost-foundweb/blob/main/src/App.jsx) (Route dispatcher), [`src/lib/supabase.js`](https://github.com/virat991v/lost-foundweb/blob/main/src/lib/supabase.js) (Supabase client), [`src/pages/student/ItemDetailsPage.jsx`](https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/ItemDetailsPage.jsx) (Item details), [`src/services/items/lostItemsService.js`](https://github.com/virat991v/lost-foundweb/blob/main/src/services/items/lostItemsService.js) (Lost item service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Application routing"]
  node_app["Route dispatcher<br/>[App.jsx]"]
  node_student_layout["Student shell<br/>[StudentLayout.jsx]"]
  node_admin_layout["Admin shell<br/>[AdminLayout.jsx]"]
end

subgraph group_student["Student workflows"]
  node_dashboard["Student dashboard<br/>[DashboardPage.jsx]"]
  node_browse["Browse reports<br/>[BrowsePage.jsx]"]
  node_item_detail["Item details"]
  node_lost_report["Report lost item<br/>[ReportLostPage.jsx]"]
  node_found_report["Report found item"]
  node_claim_pages["Claim and return"]
  node_item_components["Search and item views"]
  node_claim_components["Claim verification UI"]
  node_assistant["AI-ready placeholder"]
end

subgraph group_services["Domain services"]
  node_items_hook["Item data hook<br/>[useItems.js]"]
  node_lost_service["Lost item service"]
  node_found_service["Found item service"]
  node_matching["Item matching<br/>[matchingService.js]"]
  node_claims_hook["Claims hook<br/>[useClaims.js]"]
  node_claims_service["Claims and returns<br/>[claimsService.js]"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
end

subgraph group_identity["Identity and alerts"]
  node_auth_context["Auth provider<br/>[AuthContext.jsx]"]
  node_auth_pages["Sign-in and signup"]
  node_notifications_hook["Notification hook"]
  node_notification_ui["Notification controls"]
  node_notifications_service["Notification service"]
end

subgraph group_admin["Administration"]
  node_admin_pages["Admin console"]
  node_admin_claims["Ownership review"]
  node_admin_service["Admin operations<br/>[adminService.js]"]
end

node_student_actor(("Campus user"))
node_admin_actor(("Campus admin"))
node_supabase[("Supabase platform")]

node_student_actor -->|"opens app"| node_app
node_admin_actor -->|"opens app"| node_app
node_app -->|"provides auth"| node_auth_context
node_app -->|"routes to"| node_auth_pages
node_app -->|"routes through"| node_student_layout
node_app -->|"routes through"| node_admin_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_browse
node_app -->|"routes to"| node_item_detail
node_app -->|"routes to"| node_claim_pages
node_app -->|"routes to"| node_admin_pages
node_lost_report -->|"creates reports"| node_lost_service
node_found_report -->|"creates reports"| node_found_service
node_browse -.->|"loads reports"| node_items_hook
node_items_hook -->|"uses"| node_lost_service
node_items_hook -->|"uses"| node_found_service
node_browse -.->|"renders results"| node_item_components
node_item_detail -->|"loads item"| node_lost_service
node_item_detail -->|"loads item"| node_found_service
node_item_detail -->|"starts claim"| node_claims_service
node_claim_pages -.->|"uses claims"| node_claims_hook
node_claims_hook -->|"calls"| node_claims_service
node_claim_pages -->|"renders steps"| node_claim_components
node_lost_service -->|"queries and writes"| node_supabase_client
node_found_service -->|"queries and writes"| node_supabase_client
node_claims_service -->|"manages claims"| node_supabase_client
node_admin_claims -->|"reviews claims"| node_admin_service
node_admin_pages -.->|"uses operations"| node_admin_service
node_admin_service -->|"queries and updates"| node_supabase_client
node_auth_context -->|"authenticates users"| node_supabase_client
node_notification_ui -->|"loads alerts"| node_notifications_service
node_notifications_hook -->|"calls"| node_notifications_service
node_notifications_service -->|"reads and subscribes"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_matching -->|"queries data"| node_supabase_client
node_matching -.->|"AI extension"| node_assistant

click node_app "https://github.com/virat991v/lost-foundweb/blob/main/src/App.jsx"
click node_auth_context "https://github.com/virat991v/lost-foundweb/blob/main/src/context/AuthContext.jsx"
click node_auth_pages "https://github.com/virat991v/lost-foundweb/tree/main/src/pages/auth"
click node_student_layout "https://github.com/virat991v/lost-foundweb/blob/main/src/layouts/StudentLayout.jsx"
click node_admin_layout "https://github.com/virat991v/lost-foundweb/blob/main/src/layouts/AdminLayout.jsx"
click node_dashboard "https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/DashboardPage.jsx"
click node_browse "https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/BrowsePage.jsx"
click node_item_detail "https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/ItemDetailsPage.jsx"
click node_lost_report "https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/ReportLostPage.jsx"
click node_found_report "https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/ReportFoundPage.jsx"
click node_claim_pages "https://github.com/virat991v/lost-foundweb/tree/main/src/pages/student"
click node_item_components "https://github.com/virat991v/lost-foundweb/tree/main/src/components/items"
click node_claim_components "https://github.com/virat991v/lost-foundweb/tree/main/src/components/claims"
click node_items_hook "https://github.com/virat991v/lost-foundweb/blob/main/src/hooks/useItems.js"
click node_lost_service "https://github.com/virat991v/lost-foundweb/blob/main/src/services/items/lostItemsService.js"
click node_found_service "https://github.com/virat991v/lost-foundweb/blob/main/src/services/items/foundItemsService.js"
click node_matching "https://github.com/virat991v/lost-foundweb/blob/main/src/services/items/matchingService.js"
click node_claims_hook "https://github.com/virat991v/lost-foundweb/blob/main/src/hooks/useClaims.js"
click node_claims_service "https://github.com/virat991v/lost-foundweb/blob/main/src/services/claims/claimsService.js"
click node_notifications_hook "https://github.com/virat991v/lost-foundweb/blob/main/src/hooks/useNotifications.js"
click node_notification_ui "https://github.com/virat991v/lost-foundweb/blob/main/src/components/notifications/NotificationBell.jsx"
click node_notifications_service "https://github.com/virat991v/lost-foundweb/blob/main/src/services/notifications/notificationsService.js"
click node_admin_pages "https://github.com/virat991v/lost-foundweb/tree/main/src/pages/admin"
click node_admin_claims "https://github.com/virat991v/lost-foundweb/blob/main/src/pages/admin/AdminOwnershipClaimsPage.jsx"
click node_admin_service "https://github.com/virat991v/lost-foundweb/blob/main/src/services/admin/adminService.js"
click node_supabase_client "https://github.com/virat991v/lost-foundweb/blob/main/src/lib/supabase.js"
click node_assistant "https://github.com/virat991v/lost-foundweb/blob/main/src/components/ai/AssistantPlaceholder.jsx"

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,node_student_layout,node_admin_layout,node_student_actor toneBlue
class node_dashboard,node_browse,node_item_detail,node_lost_report,node_found_report,node_claim_pages,node_item_components,node_claim_components,node_assistant,node_supabase toneAmber
class node_items_hook,node_lost_service,node_found_service,node_matching,node_claims_hook,node_claims_service,node_supabase_client toneMint
class node_auth_context,node_auth_pages,node_notifications_hook,node_notification_ui,node_notifications_service toneRose
class node_admin_pages,node_admin_claims,node_admin_service,node_admin_actor toneIndigo
```

## Components

### Application routing

- [Route dispatcher](https://github.com/virat991v/lost-foundweb/blob/main/src/App.jsx): `src/App.jsx`
- [Student shell](https://github.com/virat991v/lost-foundweb/blob/main/src/layouts/StudentLayout.jsx): `src/layouts/StudentLayout.jsx`
- [Admin shell](https://github.com/virat991v/lost-foundweb/blob/main/src/layouts/AdminLayout.jsx): `src/layouts/AdminLayout.jsx`

### Student workflows

- [Student dashboard](https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/DashboardPage.jsx): `src/pages/student/DashboardPage.jsx`
- [Browse reports](https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/BrowsePage.jsx): `src/pages/student/BrowsePage.jsx`
- [Item details](https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/ItemDetailsPage.jsx): `src/pages/student/ItemDetailsPage.jsx`
- [Report lost item](https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/ReportLostPage.jsx): `src/pages/student/ReportLostPage.jsx`
- [Report found item](https://github.com/virat991v/lost-foundweb/blob/main/src/pages/student/ReportFoundPage.jsx): `src/pages/student/ReportFoundPage.jsx`
- [Claim and return](https://github.com/virat991v/lost-foundweb/tree/main/src/pages/student): `src/pages/student`
- [Search and item views](https://github.com/virat991v/lost-foundweb/tree/main/src/components/items): `src/components/items`
- [Claim verification UI](https://github.com/virat991v/lost-foundweb/tree/main/src/components/claims): `src/components/claims`
- [AI-ready placeholder](https://github.com/virat991v/lost-foundweb/blob/main/src/components/ai/AssistantPlaceholder.jsx): `src/components/ai/AssistantPlaceholder.jsx`

### Domain services

- [Item data hook](https://github.com/virat991v/lost-foundweb/blob/main/src/hooks/useItems.js): `src/hooks/useItems.js`
- [Lost item service](https://github.com/virat991v/lost-foundweb/blob/main/src/services/items/lostItemsService.js): `src/services/items/lostItemsService.js`
- [Found item service](https://github.com/virat991v/lost-foundweb/blob/main/src/services/items/foundItemsService.js): `src/services/items/foundItemsService.js`
- [Item matching](https://github.com/virat991v/lost-foundweb/blob/main/src/services/items/matchingService.js): `src/services/items/matchingService.js`
- [Claims hook](https://github.com/virat991v/lost-foundweb/blob/main/src/hooks/useClaims.js): `src/hooks/useClaims.js`
- [Claims and returns](https://github.com/virat991v/lost-foundweb/blob/main/src/services/claims/claimsService.js): `src/services/claims/claimsService.js`
- [Supabase client](https://github.com/virat991v/lost-foundweb/blob/main/src/lib/supabase.js): `src/lib/supabase.js`

### Identity and alerts

- [Auth provider](https://github.com/virat991v/lost-foundweb/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Sign-in and signup](https://github.com/virat991v/lost-foundweb/tree/main/src/pages/auth): `src/pages/auth`
- [Notification hook](https://github.com/virat991v/lost-foundweb/blob/main/src/hooks/useNotifications.js): `src/hooks/useNotifications.js`
- [Notification controls](https://github.com/virat991v/lost-foundweb/blob/main/src/components/notifications/NotificationBell.jsx): `src/components/notifications/NotificationBell.jsx`
- [Notification service](https://github.com/virat991v/lost-foundweb/blob/main/src/services/notifications/notificationsService.js): `src/services/notifications/notificationsService.js`

### Administration

- [Admin console](https://github.com/virat991v/lost-foundweb/tree/main/src/pages/admin): `src/pages/admin`
- [Ownership review](https://github.com/virat991v/lost-foundweb/blob/main/src/pages/admin/AdminOwnershipClaimsPage.jsx): `src/pages/admin/AdminOwnershipClaimsPage.jsx`
- [Admin operations](https://github.com/virat991v/lost-foundweb/blob/main/src/services/admin/adminService.js): `src/services/admin/adminService.js`

### Other components

- **Campus user**
- **Campus admin**
- **Supabase platform**

## Connections

- Campus user → Route dispatcher: opens app (evidence: `src/App.jsx`)
- Campus admin → Route dispatcher: opens app (evidence: `src/App.jsx`)
- Route dispatcher → Auth provider: provides auth (evidence: `src/App.jsx`)
- Route dispatcher → Sign-in and signup: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Student shell: routes through (evidence: `src/App.jsx`)
- Route dispatcher → Admin shell: routes through (evidence: `src/App.jsx`)
- Route dispatcher → Student dashboard: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Browse reports: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Item details: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Claim and return: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Admin console: routes to (evidence: `src/App.jsx`)
- Report lost item → Lost item service: creates reports (evidence: `src/pages/student/ReportLostPage.jsx`)
- Report found item → Found item service: creates reports (evidence: `src/pages/student/ReportFoundPage.jsx`)
- Browse reports → Item data hook: loads reports
- Item data hook → Lost item service: uses (evidence: `src/hooks/useItems.js`)
- Item data hook → Found item service: uses (evidence: `src/hooks/useItems.js`)
- Browse reports → Search and item views: renders results
- Item details → Lost item service: loads item (evidence: `src/pages/student/ItemDetailsPage.jsx`)
- Item details → Found item service: loads item (evidence: `src/pages/student/ItemDetailsPage.jsx`)
- Item details → Claims and returns: starts claim (evidence: `src/pages/student/ItemDetailsPage.jsx`)
- Claim and return → Claims hook: uses claims
- Claims hook → Claims and returns: calls (evidence: `src/hooks/useClaims.js`)
- Claim and return → Claim verification UI: renders steps (evidence: `src/pages/student/ReportLostPage.jsx`)
- Lost item service → Supabase client: queries and writes (evidence: `src/services/items/lostItemsService.js`)
- Found item service → Supabase client: queries and writes (evidence: `src/services/items/foundItemsService.js`)
- Claims and returns → Supabase client: manages claims (evidence: `src/services/claims/claimsService.js`)
- Ownership review → Admin operations: reviews claims (evidence: `src/pages/admin/AdminOwnershipClaimsPage.jsx`)
- Admin console → Admin operations: uses operations (evidence: `src/pages/admin/AdminOwnershipClaimsPage.jsx`)
- Admin operations → Supabase client: queries and updates (evidence: `src/services/admin/adminService.js`)
- Auth provider → Supabase client: authenticates users (evidence: `src/context/AuthContext.jsx`)
- Notification controls → Notification service: loads alerts (evidence: `src/components/notifications/NotificationBell.jsx`)
- Notification hook → Notification service: calls (evidence: `src/hooks/useNotifications.js`)
- Notification service → Supabase client: reads and subscribes (evidence: `src/services/notifications/notificationsService.js`)
- Supabase client → Supabase platform: connects to (evidence: `src/lib/supabase.js`)
- Item matching → Supabase client: queries data (evidence: `src/services/items/matchingService.js`)
- Item matching → AI-ready placeholder: AI extension
