# nivas2008/smart-college-lost-found architecture

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

- Interactive diagram: https://gitdiagram.com/nivas2008/smart-college-lost-found
- Repository: https://github.com/nivas2008/smart-college-lost-found

## Overview

Smart College Lost & Found is a React client backed by an Express API and MongoDB. Students and faculty register or sign in, report lost or found items, browse listings, and submit claims; administrators manage listings and approve or reject claims. The graph preserves authentication, item, claim, dashboard, and profile responsibilities, plus the documented image-upload and email capabilities. Some client-to-API links are dashed because the sampled page excerpts do not show their requests; unsampled implementation details are not inferred.

Main entry points: [`client/src/App.jsx`](https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/App.jsx) (Application routes), [`server/index.js`](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/index.js) (Express API), [`server/routes/itemRoutes.js`](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/itemRoutes.js) (Item routes), [`server/routes/claimRoutes.js`](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/claimRoutes.js) (Claim routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Application routes<br/>[App.jsx]"]
  node_auth_ui["Sign-in and registration<br/>[LoginPage.jsx]"]
  node_browse_ui["Browse items<br/>[BrowseItems.jsx]"]
  node_report_ui["Report item<br/>[ReportItem.jsx]"]
  node_item_ui["Item details<br/>[ItemDetails.jsx]"]
  node_dashboard_ui["User dashboard<br/>[Dashboard.jsx]"]
  node_admin_ui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_profile_ui["User profile<br/>[ProfilePage.jsx]"]
  node_session["Session state<br/>[AuthContext.jsx]"]
end

subgraph group_api["API and access"]
  node_api_server["Express API<br/>[index.js]"]
  node_auth_routes["Authentication routes<br/>[authRoutes.js]"]
  node_item_routes["Item routes<br/>[itemRoutes.js]"]
  node_claim_routes["Claim routes<br/>[claimRoutes.js]"]
  node_dashboard_routes["Dashboard routes<br/>[dashboardRoutes.js]"]
  node_user_routes["User routes<br/>[userRoutes.js]"]
  node_auth_guard["JWT and admin checks<br/>[auth.js]"]
  node_upload["Image upload<br/>[upload.js]"]
end

subgraph group_domain["Lost and found"]
  node_auth_logic["Authentication logic<br/>[authController.js]"]
  node_item_logic["Item management<br/>[itemController.js]"]
  node_claim_logic["Claim review<br/>[claimController.js]"]
  node_dashboard_logic["Dashboard data"]
  node_user_logic["User management<br/>[userController.js]"]
end

subgraph group_persistence["Data and integrations"]
  node_users[("User records<br/>[User.js]")]
  node_items[("Item records<br/>[Item.js]")]
  node_claims[("Claim records<br/>[Claim.js]")]
  node_notifications[("Notifications<br/>[Notification.js]")]
  node_otps[("OTP records<br/>[Otp.js]")]
  node_email["Email delivery<br/>[sendEmail.js]"]
end

node_student(("Student or faculty"))
node_admin_actor(("Administrator"))
node_mongodb[("MongoDB")]

node_student -->|"uses"| node_app
node_admin_actor -->|"uses"| node_app
node_app -->|"routes to"| node_auth_ui
node_app -->|"routes to"| node_browse_ui
node_app -->|"routes to"| node_report_ui
node_app -->|"routes to"| node_item_ui
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_admin_ui
node_app -->|"routes to"| node_profile_ui
node_auth_ui -.->|"updates session"| node_session
node_auth_ui -.->|"authenticates"| node_auth_routes
node_browse_ui -.->|"requests listings"| node_item_routes
node_report_ui -.->|"submits report"| node_item_routes
node_item_ui -.->|"submits claim"| node_claim_routes
node_admin_ui -.->|"reviews claims"| node_claim_routes
node_dashboard_ui -.->|"requests summary"| node_dashboard_routes
node_profile_ui -.->|"updates profile"| node_user_routes
node_api_server -->|"mounts routes"| node_auth_routes
node_api_server -->|"mounts routes"| node_item_routes
node_api_server -->|"mounts routes"| node_claim_routes
node_api_server -->|"mounts routes"| node_dashboard_routes
node_api_server -->|"mounts routes"| node_user_routes
node_auth_routes -->|"dispatches"| node_auth_logic
node_auth_routes -->|"protects"| node_auth_guard
node_item_routes -->|"dispatches"| node_item_logic
node_item_routes -->|"protects"| node_auth_guard
node_item_routes -->|"uploads images"| node_upload
node_claim_routes -->|"dispatches"| node_claim_logic
node_claim_routes -->|"protects"| node_auth_guard
node_claim_routes -->|"uploads proof"| node_upload
node_dashboard_routes -->|"dispatches"| node_dashboard_logic
node_dashboard_routes -->|"protects"| node_auth_guard
node_user_routes -->|"dispatches"| node_user_logic
node_user_routes -->|"protects"| node_auth_guard
node_auth_guard -->|"loads user"| node_users
node_auth_logic -->|"reads and writes"| node_users
node_auth_logic -->|"reads and writes"| node_otps
node_auth_logic -->|"sends codes"| node_email
node_item_logic -->|"reads and writes"| node_items
node_claim_logic -->|"reads and writes"| node_claims
node_claim_logic -->|"updates status"| node_items
node_claim_logic -->|"creates notice"| node_notifications
node_dashboard_logic -->|"queries"| node_users
node_dashboard_logic -->|"queries"| node_items
node_dashboard_logic -->|"queries"| node_claims
node_user_logic -->|"manages"| node_users
node_api_server -->|"connects"| node_mongodb

click node_app "https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/App.jsx"
click node_auth_ui "https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/LoginPage.jsx"
click node_browse_ui "https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/BrowseItems.jsx"
click node_report_ui "https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/ReportItem.jsx"
click node_item_ui "https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/ItemDetails.jsx"
click node_dashboard_ui "https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/Dashboard.jsx"
click node_admin_ui "https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/AdminDashboard.jsx"
click node_profile_ui "https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/ProfilePage.jsx"
click node_session "https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/context/AuthContext.jsx"
click node_api_server "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/index.js"
click node_auth_routes "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/authRoutes.js"
click node_item_routes "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/itemRoutes.js"
click node_claim_routes "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/claimRoutes.js"
click node_dashboard_routes "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/dashboardRoutes.js"
click node_user_routes "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/userRoutes.js"
click node_auth_guard "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/middleware/auth.js"
click node_upload "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/middleware/upload.js"
click node_auth_logic "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/controllers/authController.js"
click node_item_logic "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/controllers/itemController.js"
click node_claim_logic "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/controllers/claimController.js"
click node_dashboard_logic "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/controllers/dashboardController.js"
click node_user_logic "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/controllers/userController.js"
click node_users "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/models/User.js"
click node_items "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/models/Item.js"
click node_claims "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/models/Claim.js"
click node_notifications "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/models/Notification.js"
click node_otps "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/models/Otp.js"
click node_email "https://github.com/nivas2008/smart-college-lost-found/blob/main/server/utils/sendEmail.js"

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_auth_ui,node_browse_ui,node_report_ui,node_item_ui,node_dashboard_ui,node_admin_ui,node_profile_ui,node_session toneBlue
class node_api_server,node_auth_routes,node_item_routes,node_claim_routes,node_dashboard_routes,node_user_routes,node_auth_guard,node_upload,node_mongodb toneAmber
class node_auth_logic,node_item_logic,node_claim_logic,node_dashboard_logic,node_user_logic toneMint
class node_users,node_items,node_claims,node_notifications,node_otps,node_email toneRose
class node_student,node_admin_actor toneIndigo
```

## Components

### Web application

- [Application routes](https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign-in and registration](https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/LoginPage.jsx): `client/src/pages/LoginPage.jsx`
- [Browse items](https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/BrowseItems.jsx): `client/src/pages/BrowseItems.jsx`
- [Report item](https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/ReportItem.jsx): `client/src/pages/ReportItem.jsx`
- [Item details](https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/ItemDetails.jsx): `client/src/pages/ItemDetails.jsx`
- [User dashboard](https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Admin dashboard](https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/AdminDashboard.jsx): `client/src/pages/AdminDashboard.jsx`
- [User profile](https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/pages/ProfilePage.jsx): `client/src/pages/ProfilePage.jsx`
- [Session state](https://github.com/nivas2008/smart-college-lost-found/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`

### API and access

- [Express API](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/index.js): `server/index.js`
- [Authentication routes](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Item routes](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/itemRoutes.js): `server/routes/itemRoutes.js`
- [Claim routes](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/claimRoutes.js): `server/routes/claimRoutes.js`
- [Dashboard routes](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/dashboardRoutes.js): `server/routes/dashboardRoutes.js`
- [User routes](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/routes/userRoutes.js): `server/routes/userRoutes.js`
- [JWT and admin checks](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- [Image upload](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/middleware/upload.js): `server/middleware/upload.js`

### Lost and found

- [Authentication logic](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [Item management](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/controllers/itemController.js): `server/controllers/itemController.js`
- [Claim review](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/controllers/claimController.js): `server/controllers/claimController.js`
- [Dashboard data](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/controllers/dashboardController.js): `server/controllers/dashboardController.js`
- [User management](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/controllers/userController.js): `server/controllers/userController.js`

### Data and integrations

- [User records](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/models/User.js): `server/models/User.js`
- [Item records](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/models/Item.js): `server/models/Item.js`
- [Claim records](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/models/Claim.js): `server/models/Claim.js`
- [Notifications](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/models/Notification.js): `server/models/Notification.js`
- [OTP records](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/models/Otp.js): `server/models/Otp.js`
- [Email delivery](https://github.com/nivas2008/smart-college-lost-found/blob/main/server/utils/sendEmail.js): `server/utils/sendEmail.js`

### Other components

- **Student or faculty**
- **Administrator**
- **MongoDB**

## Connections

- Student or faculty → Application routes: uses (evidence: `client/src/App.jsx`)
- Administrator → Application routes: uses (evidence: `client/src/App.jsx`)
- Application routes → Sign-in and registration: routes to (evidence: `client/src/App.jsx`)
- Application routes → Browse items: routes to (evidence: `client/src/App.jsx`)
- Application routes → Report item: routes to (evidence: `client/src/App.jsx`)
- Application routes → Item details: routes to (evidence: `client/src/App.jsx`)
- Application routes → User dashboard: routes to (evidence: `client/src/App.jsx`)
- Application routes → Admin dashboard: routes to (evidence: `client/src/App.jsx`)
- Application routes → User profile: routes to (evidence: `client/src/App.jsx`)
- Sign-in and registration → Session state: updates session (evidence: `client/src/pages/LoginPage.jsx`)
- Sign-in and registration → Authentication routes: authenticates
- Browse items → Item routes: requests listings
- Report item → Item routes: submits report
- Item details → Claim routes: submits claim
- Admin dashboard → Claim routes: reviews claims
- User dashboard → Dashboard routes: requests summary
- User profile → User routes: updates profile
- Express API → Authentication routes: mounts routes (evidence: `server/index.js`)
- Express API → Item routes: mounts routes (evidence: `server/index.js`)
- Express API → Claim routes: mounts routes (evidence: `server/index.js`)
- Express API → Dashboard routes: mounts routes (evidence: `server/index.js`)
- Express API → User routes: mounts routes (evidence: `server/index.js`)
- Authentication routes → Authentication logic: dispatches (evidence: `server/routes/authRoutes.js`)
- Authentication routes → JWT and admin checks: protects (evidence: `server/routes/authRoutes.js`)
- Item routes → Item management: dispatches (evidence: `server/routes/itemRoutes.js`)
- Item routes → JWT and admin checks: protects (evidence: `server/routes/itemRoutes.js`)
- Item routes → Image upload: uploads images (evidence: `server/routes/itemRoutes.js`)
- Claim routes → Claim review: dispatches (evidence: `server/routes/claimRoutes.js`)
- Claim routes → JWT and admin checks: protects (evidence: `server/routes/claimRoutes.js`)
- Claim routes → Image upload: uploads proof (evidence: `server/routes/claimRoutes.js`)
- Dashboard routes → Dashboard data: dispatches (evidence: `server/routes/dashboardRoutes.js`)
- Dashboard routes → JWT and admin checks: protects (evidence: `server/routes/dashboardRoutes.js`)
- User routes → User management: dispatches (evidence: `server/routes/userRoutes.js`)
- User routes → JWT and admin checks: protects (evidence: `server/routes/userRoutes.js`)
- JWT and admin checks → User records: loads user (evidence: `server/middleware/auth.js`)
- Authentication logic → User records: reads and writes (evidence: `server/controllers/authController.js`)
- Authentication logic → OTP records: reads and writes (evidence: `server/controllers/authController.js`)
- Authentication logic → Email delivery: sends codes (evidence: `server/controllers/authController.js`)
- Item management → Item records: reads and writes (evidence: `server/controllers/itemController.js`)
- Claim review → Claim records: reads and writes (evidence: `server/controllers/claimController.js`)
- Claim review → Item records: updates status (evidence: `server/controllers/claimController.js`)
- Claim review → Notifications: creates notice (evidence: `server/controllers/claimController.js`)
- Dashboard data → User records: queries (evidence: `server/controllers/dashboardController.js`)
- Dashboard data → Item records: queries (evidence: `server/controllers/dashboardController.js`)
- Dashboard data → Claim records: queries (evidence: `server/controllers/dashboardController.js`)
- User management → User records: manages (evidence: `server/controllers/userController.js`)
- Express API → MongoDB: connects (evidence: `server/index.js`)
