# darshanyadav-dev/campuslost-prototype architecture

> Architecture diagram of the GitHub repository darshanyadav-dev/campuslost-prototype, 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/darshanyadav-dev/campuslost-prototype
- Repository: https://github.com/darshanyadav-dev/campuslost-prototype

## Overview

CampusLost is a PHP/MySQL campus lost-and-found portal. Students register or sign in, post lost/found listings (optionally with photos), browse and search listings, view item details, submit ownership claims, and manage listings and claims; administrators moderate listings. The graph separates discovery, accounts, listing/claim workflows, and shared infrastructure. Database schema and MySQL are documented, while some page implementations and database wiring are not excerpted; those connections are shown only where the excerpts or README support them.

Main entry points: [`functions.php`](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/functions.php) (Session and upload helpers), [`item.php`](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/item.php) (Item details), [`index.php`](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/index.php) (Home and recent items), [`browse.php`](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/browse.php) (Browse and search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery"]
  node_home["Home and recent items<br/>[index.php]"]
  node_search["Browse and search<br/>[browse.php]"]
  node_item_detail["Item details<br/>[item.php]"]
end

subgraph group_accounts["Accounts"]
  node_register["Registration<br/>[register.php]"]
  node_login["Sign in<br/>[login.php]"]
  node_logout["Sign out<br/>[logout.php]"]
end

subgraph group_listing_claims["Listings and claims"]
  node_listing_create["Post listing<br/>[post-item.php]"]
  node_my_listings["Manage listings<br/>[my-items.php]"]
  node_claim_submit["Submit claim<br/>[claim.php]"]
  node_claim_review["Review claims<br/>[claims.php]"]
  node_moderation["Listing moderation<br/>[admin.php]"]
end

subgraph group_shared["Shared infrastructure"]
  node_shared_header["Shared navigation<br/>[header.php]"]
  node_shared_footer["Shared page footer<br/>[footer.php]"]
  node_item_card["Listing card<br/>[item-card.php]"]
  node_helpers["Session and upload helpers<br/>[functions.php]"]
  node_config["Database configuration<br/>[config.php]"]
  node_upload_dir["Listing photo files"]
  node_schema["Database schema<br/>[database.sql]"]
end

node_student(("Student"))
node_admin_user(("Administrator"))
node_mysql[("MySQL")]

node_student -->|"opens"| node_home
node_student -->|"registers"| node_register
node_student -->|"signs in"| node_login
node_student -->|"searches"| node_search
node_student -->|"posts"| node_listing_create
node_student -->|"claims"| node_claim_submit
node_student -->|"manages"| node_my_listings
node_admin_user -->|"moderates"| node_moderation
node_home -->|"includes"| node_shared_header
node_home -->|"renders"| node_item_card
node_home -->|"includes"| node_shared_footer
node_search -->|"includes"| node_shared_header
node_search -->|"renders"| node_item_card
node_search -->|"includes"| node_shared_footer
node_item_detail -->|"includes"| node_shared_header
node_item_detail -->|"includes"| node_shared_footer
node_item_detail -->|"links to"| node_claim_submit
node_listing_create -->|"requires login"| node_helpers
node_listing_create -->|"uploads photo"| node_helpers
node_helpers -->|"stores photo"| node_upload_dir
node_my_listings -->|"requires login"| node_helpers
node_claim_submit -->|"requires login"| node_helpers
node_claim_review -->|"requires login"| node_helpers
node_moderation -->|"checks admin"| node_helpers
node_claim_submit -->|"owner reviews"| node_claim_review
node_item_detail -->|"links to manage"| node_my_listings
node_shared_header -->|"uses session helpers"| node_helpers
node_helpers -->|"loads"| node_config
node_schema -->|"imported into"| node_mysql
node_home -->|"queries listings"| node_mysql
node_search -->|"queries listings"| node_mysql
node_item_detail -->|"queries item"| node_mysql
node_listing_create -->|"inserts listing"| node_mysql
node_my_listings -->|"reads and updates"| node_mysql
node_claim_submit -->|"reads and inserts"| node_mysql
node_claim_review -->|"reads and updates"| node_mysql
node_moderation -->|"reads and deletes"| node_mysql

click node_home "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/index.php"
click node_search "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/browse.php"
click node_item_detail "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/item.php"
click node_register "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/register.php"
click node_login "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/login.php"
click node_logout "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/logout.php"
click node_listing_create "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/post-item.php"
click node_my_listings "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/my-items.php"
click node_claim_submit "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/claim.php"
click node_claim_review "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/claims.php"
click node_moderation "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/admin.php"
click node_shared_header "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/header.php"
click node_shared_footer "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/footer.php"
click node_item_card "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/item-card.php"
click node_helpers "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/functions.php"
click node_config "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/config.php"
click node_upload_dir "https://github.com/darshanyadav-dev/campuslost-prototype/tree/main/uploads"
click node_schema "https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/database.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_home,node_search,node_item_detail toneBlue
class node_register,node_login,node_logout,node_mysql toneAmber
class node_listing_create,node_my_listings,node_claim_submit,node_claim_review,node_moderation toneMint
class node_shared_header,node_shared_footer,node_item_card,node_helpers,node_config,node_upload_dir,node_schema toneRose
class node_student,node_admin_user toneIndigo
```

## Components

### Discovery

- [Home and recent items](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/index.php): `index.php`
- [Browse and search](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/browse.php): `browse.php`
- [Item details](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/item.php): `item.php`

### Accounts

- [Registration](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/register.php): `register.php`
- [Sign in](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/login.php): `login.php`
- [Sign out](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/logout.php): `logout.php`

### Listings and claims

- [Post listing](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/post-item.php): `post-item.php`
- [Manage listings](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/my-items.php): `my-items.php`
- [Submit claim](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/claim.php): `claim.php`
- [Review claims](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/claims.php): `claims.php`
- [Listing moderation](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/admin.php): `admin.php`

### Shared infrastructure

- [Shared navigation](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/header.php): `header.php`
- [Shared page footer](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/footer.php): `footer.php`
- [Listing card](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/item-card.php): `item-card.php`
- [Session and upload helpers](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/functions.php): `functions.php`
- [Database configuration](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/config.php): `config.php`
- [Listing photo files](https://github.com/darshanyadav-dev/campuslost-prototype/tree/main/uploads): `uploads`
- [Database schema](https://github.com/darshanyadav-dev/campuslost-prototype/blob/main/database.sql): `database.sql`

### Other components

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

## Connections

- Student → Home and recent items: opens (evidence: `README.md`)
- Student → Registration: registers (evidence: `README.md`)
- Student → Sign in: signs in (evidence: `README.md`)
- Student → Browse and search: searches (evidence: `README.md`)
- Student → Post listing: posts (evidence: `README.md`)
- Student → Submit claim: claims (evidence: `README.md`)
- Student → Manage listings: manages (evidence: `my-items.php`)
- Administrator → Listing moderation: moderates (evidence: `README.md`)
- Home and recent items → Shared navigation: includes (evidence: `index.php`)
- Home and recent items → Listing card: renders (evidence: `index.php`)
- Home and recent items → Shared page footer: includes (evidence: `index.php`)
- Browse and search → Shared navigation: includes (evidence: `browse.php`)
- Browse and search → Listing card: renders (evidence: `browse.php`)
- Browse and search → Shared page footer: includes (evidence: `browse.php`)
- Item details → Shared navigation: includes (evidence: `item.php`)
- Item details → Shared page footer: includes (evidence: `item.php`)
- Item details → Submit claim: links to (evidence: `item.php`)
- Post listing → Session and upload helpers: requires login (evidence: `post-item.php`)
- Post listing → Session and upload helpers: uploads photo (evidence: `post-item.php`)
- Session and upload helpers → Listing photo files: stores photo (evidence: `functions.php`)
- Manage listings → Session and upload helpers: requires login (evidence: `my-items.php`)
- Submit claim → Session and upload helpers: requires login (evidence: `claim.php`)
- Review claims → Session and upload helpers: requires login (evidence: `claims.php`)
- Listing moderation → Session and upload helpers: checks admin (evidence: `admin.php`)
- Submit claim → Review claims: owner reviews (evidence: `README.md`)
- Item details → Manage listings: links to manage (evidence: `item.php`)
- Shared navigation → Session and upload helpers: uses session helpers (evidence: `header.php`)
- Session and upload helpers → Database configuration: loads (evidence: `functions.php`)
- Database schema → MySQL: imported into (evidence: `README.md`)
- Home and recent items → MySQL: queries listings (evidence: `index.php`)
- Browse and search → MySQL: queries listings (evidence: `browse.php`)
- Item details → MySQL: queries item (evidence: `item.php`)
- Post listing → MySQL: inserts listing (evidence: `post-item.php`)
- Manage listings → MySQL: reads and updates (evidence: `my-items.php`)
- Submit claim → MySQL: reads and inserts (evidence: `claim.php`)
- Review claims → MySQL: reads and updates (evidence: `claims.php`)
- Listing moderation → MySQL: reads and deletes (evidence: `admin.php`)
