# sinnca/lost-found-system architecture

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

- Interactive diagram: https://gitdiagram.com/sinnca/lost-found-system
- Repository: https://github.com/sinnca/lost-found-system

## Overview

This is a campus lost-and-found application for students and administrators. Students sign in, report lost or found property, browse listings, and request claims; administrators verify reports, review claims, schedule returns, and mark claims complete. Notifications communicate important changes. The graph preserves the major student, admin, claim, and notification areas, plus shared authentication, session, and database layers. Relationship evidence is limited to the README (empty), SOURCE INDEX references, and sampled excerpts; uncertain page-to-endpoint links are omitted.

Main entry points: [`config/database.php`](https://github.com/sinnca/lost-found-system/blob/main/config/database.php) (Database connection), [`student/index.php`](https://github.com/sinnca/lost-found-system/blob/main/student/index.php) (Student dashboard), [`api/auth/login.php`](https://github.com/sinnca/lost-found-system/blob/main/api/auth/login.php) (Login handler), [`admin/index.php`](https://github.com/sinnca/lost-found-system/blob/main/admin/index.php) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shared services"]
  node_login["Login page<br/>[index.php]"]
  node_login_api["Login handler<br/>[login.php]"]
  node_auth["Authentication<br/>[auth.php]"]
  node_session["Session controls<br/>[session.php]"]
  node_helpers["Shared helpers<br/>[functions.php]"]
  node_database_config["Database connection<br/>[database.php]"]
  node_database[("Application database")]
end

subgraph group_student["Student lost-and-found"]
  node_student_home["Student dashboard<br/>[index.php]"]
  node_report_lost["Report lost item<br/>[report_lost.php]"]
  node_report_found["Report found item<br/>[report_found.php]"]
  node_lost_browse["Browse lost items<br/>[lost_items.php]"]
  node_found_browse["Browse found items<br/>[found_items.php]"]
  node_my_items["My items<br/>[my_items.php]"]
  node_edit_lost["Edit lost item<br/>[edit_lost_item.php]"]
  node_item_views["Item details<br/>[view_lost_item.php]"]
  node_found_view["Found item details"]
  node_faq["FAQ<br/>[faq.php]"]
  node_item_api["Item handlers<br/>[get_items.php]"]
  node_lost_create_api["Create lost report<br/>[create_lost.php]"]
  node_found_create_api["Create found report<br/>[create_found.php]"]
end

subgraph group_admin["Administration"]
  node_admin_home["Admin dashboard<br/>[index.php]"]
  node_item_review["Verify items<br/>[verify_lost.php]"]
  node_found_review["Verify found items<br/>[verify_found.php]"]
  node_all_items["All items<br/>[all_items.php]"]
  node_pending_lost["Pending lost reports<br/>[pending_lost.php]"]
  node_pending_found["Pending found reports<br/>[pending_found.php]"]
  node_statistics["Statistics<br/>[statistics.php]"]
end

subgraph group_claims["Claims and notifications"]
  node_claims["Claim requests<br/>[claim_requests.php]"]
  node_claim_review["Review claim<br/>[review_claim.php]"]
  node_claim_create["Submit claim<br/>[create_claim.php]"]
  node_claim_complete["Complete claim<br/>[complete_claim.php]"]
  node_claim_update["Update claim<br/>[update_claim.php]"]
  node_approve_claim["Approve claim API<br/>[approve_claim.php]"]
end

node_visitor(("User"))

node_visitor -->|"signs in"| node_login
node_login -->|"posts credentials"| node_login_api
node_login_api -->|"authenticates"| node_auth
node_login_api -->|"loads connection"| node_database_config
node_student_home -->|"requires student"| node_session
node_student_home -->|"loads connection"| node_database_config
node_student_home -->|"queries items"| node_database
node_report_lost -->|"loads connection"| node_database_config
node_report_found -->|"loads connection"| node_database_config
node_lost_browse -->|"loads connection"| node_database_config
node_my_items -->|"loads connection"| node_database_config
node_edit_lost -->|"loads connection"| node_database_config
node_item_views -->|"loads connection"| node_database_config
node_found_view -->|"loads connection"| node_database_config
node_faq -->|"loads connection"| node_database_config
node_item_api -->|"loads connection"| node_database_config
node_lost_create_api -->|"loads connection"| node_database_config
node_found_create_api -->|"loads connection"| node_database_config
node_admin_home -->|"loads connection"| node_database_config
node_admin_home -->|"queries activity"| node_database
node_item_review -->|"loads connection"| node_database_config
node_found_review -->|"loads connection"| node_database_config
node_all_items -->|"loads connection"| node_database_config
node_pending_lost -->|"loads connection"| node_database_config
node_pending_found -->|"loads connection"| node_database_config
node_statistics -->|"loads connection"| node_database_config
node_claim_review -->|"loads connection"| node_database_config
node_claim_review -->|"updates claim state"| node_database
node_claim_create -->|"loads connection"| node_database_config
node_claim_create -->|"checks and inserts"| node_database
node_claim_complete -->|"loads connection"| node_database_config
node_approve_claim -->|"loads connection"| node_database_config
node_claim_update --> node_database_config

click node_login "https://github.com/sinnca/lost-found-system/blob/main/index.php"
click node_login_api "https://github.com/sinnca/lost-found-system/blob/main/api/auth/login.php"
click node_auth "https://github.com/sinnca/lost-found-system/blob/main/includes/auth.php"
click node_session "https://github.com/sinnca/lost-found-system/blob/main/includes/session.php"
click node_helpers "https://github.com/sinnca/lost-found-system/blob/main/includes/functions.php"
click node_database_config "https://github.com/sinnca/lost-found-system/blob/main/config/database.php"
click node_student_home "https://github.com/sinnca/lost-found-system/blob/main/student/index.php"
click node_report_lost "https://github.com/sinnca/lost-found-system/blob/main/student/report_lost.php"
click node_report_found "https://github.com/sinnca/lost-found-system/blob/main/student/report_found.php"
click node_lost_browse "https://github.com/sinnca/lost-found-system/blob/main/student/lost_items.php"
click node_found_browse "https://github.com/sinnca/lost-found-system/blob/main/student/found_items.php"
click node_my_items "https://github.com/sinnca/lost-found-system/blob/main/student/my_items.php"
click node_edit_lost "https://github.com/sinnca/lost-found-system/blob/main/student/edit_lost_item.php"
click node_item_views "https://github.com/sinnca/lost-found-system/blob/main/student/view_lost_item.php"
click node_found_view "https://github.com/sinnca/lost-found-system/blob/main/student/view_found_item.php"
click node_faq "https://github.com/sinnca/lost-found-system/blob/main/student/faq.php"
click node_item_api "https://github.com/sinnca/lost-found-system/blob/main/api/items/get_items.php"
click node_lost_create_api "https://github.com/sinnca/lost-found-system/blob/main/api/items/create_lost.php"
click node_found_create_api "https://github.com/sinnca/lost-found-system/blob/main/api/items/create_found.php"
click node_admin_home "https://github.com/sinnca/lost-found-system/blob/main/admin/index.php"
click node_item_review "https://github.com/sinnca/lost-found-system/blob/main/admin/verify_lost.php"
click node_found_review "https://github.com/sinnca/lost-found-system/blob/main/admin/verify_found.php"
click node_all_items "https://github.com/sinnca/lost-found-system/blob/main/admin/all_items.php"
click node_pending_lost "https://github.com/sinnca/lost-found-system/blob/main/admin/pending_lost.php"
click node_pending_found "https://github.com/sinnca/lost-found-system/blob/main/admin/pending_found.php"
click node_statistics "https://github.com/sinnca/lost-found-system/blob/main/admin/statistics.php"
click node_claims "https://github.com/sinnca/lost-found-system/blob/main/admin/claim_requests.php"
click node_claim_review "https://github.com/sinnca/lost-found-system/blob/main/admin/review_claim.php"
click node_claim_create "https://github.com/sinnca/lost-found-system/blob/main/api/claims/create_claim.php"
click node_claim_complete "https://github.com/sinnca/lost-found-system/blob/main/api/claims/complete_claim.php"
click node_claim_update "https://github.com/sinnca/lost-found-system/blob/main/api/claims/update_claim.php"
click node_approve_claim "https://github.com/sinnca/lost-found-system/blob/main/api/admin/approve_claim.php"

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_login,node_login_api,node_auth,node_session,node_helpers,node_database_config,node_database,node_visitor toneBlue
class node_student_home,node_report_lost,node_report_found,node_lost_browse,node_found_browse,node_my_items,node_edit_lost,node_item_views,node_found_view,node_faq,node_item_api,node_lost_create_api,node_found_create_api toneAmber
class node_admin_home,node_item_review,node_found_review,node_all_items,node_pending_lost,node_pending_found,node_statistics toneMint
class node_claims,node_claim_review,node_claim_create,node_claim_complete,node_claim_update,node_approve_claim toneRose
```

## Components

### Access and shared services

- [Login page](https://github.com/sinnca/lost-found-system/blob/main/index.php): `index.php`
- [Login handler](https://github.com/sinnca/lost-found-system/blob/main/api/auth/login.php): `api/auth/login.php`
- [Authentication](https://github.com/sinnca/lost-found-system/blob/main/includes/auth.php): `includes/auth.php`
- [Session controls](https://github.com/sinnca/lost-found-system/blob/main/includes/session.php): `includes/session.php`
- [Shared helpers](https://github.com/sinnca/lost-found-system/blob/main/includes/functions.php): `includes/functions.php`
- [Database connection](https://github.com/sinnca/lost-found-system/blob/main/config/database.php): `config/database.php`
- **Application database**

### Student lost-and-found

- [Student dashboard](https://github.com/sinnca/lost-found-system/blob/main/student/index.php): `student/index.php`
- [Report lost item](https://github.com/sinnca/lost-found-system/blob/main/student/report_lost.php): `student/report_lost.php`
- [Report found item](https://github.com/sinnca/lost-found-system/blob/main/student/report_found.php): `student/report_found.php`
- [Browse lost items](https://github.com/sinnca/lost-found-system/blob/main/student/lost_items.php): `student/lost_items.php`
- [Browse found items](https://github.com/sinnca/lost-found-system/blob/main/student/found_items.php): `student/found_items.php`
- [My items](https://github.com/sinnca/lost-found-system/blob/main/student/my_items.php): `student/my_items.php`
- [Edit lost item](https://github.com/sinnca/lost-found-system/blob/main/student/edit_lost_item.php): `student/edit_lost_item.php`
- [Item details](https://github.com/sinnca/lost-found-system/blob/main/student/view_lost_item.php): `student/view_lost_item.php`
- [Found item details](https://github.com/sinnca/lost-found-system/blob/main/student/view_found_item.php): `student/view_found_item.php`
- [FAQ](https://github.com/sinnca/lost-found-system/blob/main/student/faq.php): `student/faq.php`
- [Item handlers](https://github.com/sinnca/lost-found-system/blob/main/api/items/get_items.php): `api/items/get_items.php`
- [Create lost report](https://github.com/sinnca/lost-found-system/blob/main/api/items/create_lost.php): `api/items/create_lost.php`
- [Create found report](https://github.com/sinnca/lost-found-system/blob/main/api/items/create_found.php): `api/items/create_found.php`

### Administration

- [Admin dashboard](https://github.com/sinnca/lost-found-system/blob/main/admin/index.php): `admin/index.php`
- [Verify items](https://github.com/sinnca/lost-found-system/blob/main/admin/verify_lost.php): `admin/verify_lost.php`
- [Verify found items](https://github.com/sinnca/lost-found-system/blob/main/admin/verify_found.php): `admin/verify_found.php`
- [All items](https://github.com/sinnca/lost-found-system/blob/main/admin/all_items.php): `admin/all_items.php`
- [Pending lost reports](https://github.com/sinnca/lost-found-system/blob/main/admin/pending_lost.php): `admin/pending_lost.php`
- [Pending found reports](https://github.com/sinnca/lost-found-system/blob/main/admin/pending_found.php): `admin/pending_found.php`
- [Statistics](https://github.com/sinnca/lost-found-system/blob/main/admin/statistics.php): `admin/statistics.php`

### Claims and notifications

- [Claim requests](https://github.com/sinnca/lost-found-system/blob/main/admin/claim_requests.php): `admin/claim_requests.php`
- [Review claim](https://github.com/sinnca/lost-found-system/blob/main/admin/review_claim.php): `admin/review_claim.php`
- [Submit claim](https://github.com/sinnca/lost-found-system/blob/main/api/claims/create_claim.php): `api/claims/create_claim.php`
- [Complete claim](https://github.com/sinnca/lost-found-system/blob/main/api/claims/complete_claim.php): `api/claims/complete_claim.php`
- [Update claim](https://github.com/sinnca/lost-found-system/blob/main/api/claims/update_claim.php): `api/claims/update_claim.php`
- [Approve claim API](https://github.com/sinnca/lost-found-system/blob/main/api/admin/approve_claim.php): `api/admin/approve_claim.php`

### Other components

- **User**

## Connections

- User → Login page: signs in (evidence: `index.php`)
- Login page → Login handler: posts credentials (evidence: `index.php`)
- Login handler → Authentication: authenticates (evidence: `api/auth/login.php`)
- Login handler → Database connection: loads connection (evidence: `api/auth/login.php`)
- Student dashboard → Session controls: requires student (evidence: `student/index.php`)
- Student dashboard → Database connection: loads connection (evidence: `student/index.php`)
- Student dashboard → Application database: queries items (evidence: `student/index.php`)
- Report lost item → Database connection: loads connection (evidence: `student/report_lost.php`)
- Report found item → Database connection: loads connection (evidence: `student/report_found.php`)
- Browse lost items → Database connection: loads connection (evidence: `student/lost_items.php`)
- My items → Database connection: loads connection (evidence: `student/my_items.php`)
- Edit lost item → Database connection: loads connection (evidence: `student/edit_lost_item.php`)
- Item details → Database connection: loads connection (evidence: `student/view_lost_item.php`)
- Found item details → Database connection: loads connection (evidence: `student/view_found_item.php`)
- FAQ → Database connection: loads connection (evidence: `student/faq.php`)
- Item handlers → Database connection: loads connection (evidence: `api/items/get_items.php`)
- Create lost report → Database connection: loads connection (evidence: `api/items/create_lost.php`)
- Create found report → Database connection: loads connection (evidence: `api/items/create_found.php`)
- Admin dashboard → Database connection: loads connection (evidence: `admin/index.php`)
- Admin dashboard → Application database: queries activity (evidence: `admin/index.php`)
- Verify items → Database connection: loads connection (evidence: `admin/verify_lost.php`)
- Verify found items → Database connection: loads connection (evidence: `admin/verify_found.php`)
- All items → Database connection: loads connection (evidence: `admin/all_items.php`)
- Pending lost reports → Database connection: loads connection (evidence: `admin/pending_lost.php`)
- Pending found reports → Database connection: loads connection (evidence: `admin/pending_found.php`)
- Statistics → Database connection: loads connection (evidence: `admin/statistics.php`)
- Review claim → Database connection: loads connection (evidence: `admin/review_claim.php`)
- Review claim → Application database: updates claim state (evidence: `admin/review_claim.php`)
- Submit claim → Database connection: loads connection (evidence: `api/claims/create_claim.php`)
- Submit claim → Application database: checks and inserts (evidence: `api/claims/create_claim.php`)
- Complete claim → Database connection: loads connection (evidence: `api/claims/complete_claim.php`)
- Approve claim API → Database connection: loads connection (evidence: `api/admin/approve_claim.php`)
- Update claim → Database connection
