# goyal-nandini/claimit architecture

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

- Interactive diagram: https://gitdiagram.com/goyal-nandini/claimit
- Repository: https://github.com/goyal-nandini/claimit

## Overview

ClaimIt is a campus lost-and-found application. Students browse and search lost/found reports, post items, and submit claims; owners review claims, approve or reject them, and approved claims resolve the item and reveal owner contact details. The React client uses a shared API service to communicate with an Express API backed by MongoDB, with Cloudinary image storage and email notifications. Relationships among backend routes, controllers, and models are supported by the sampled source; some client-to-API links are documented capabilities rather than inspected call sites.

Main entry points: [`client/src/services/api.js`](https://github.com/goyal-nandini/claimit/blob/main/client/src/services/api.js) (API Client), [`client/src/App.jsx`](https://github.com/goyal-nandini/claimit/blob/main/client/src/App.jsx) (Page Router), [`server/server.js`](https://github.com/goyal-nandini/claimit/blob/main/server/server.js) (Express Server), [`server/routes/itemRoutes.js`](https://github.com/goyal-nandini/claimit/blob/main/server/routes/itemRoutes.js) (Item Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Student Web App"]
  node_webapp["Page Router<br/>[App.jsx]"]
  node_browse["Browse Items<br/>[ItemsPage.jsx]"]
  node_itemdetail["Item Details<br/>[ItemDetailPage.jsx]"]
  node_postitem["Report Item<br/>[PostItemPage.jsx]"]
  node_myposts["My Posts<br/>[MyPostsPage.jsx]"]
  node_myclaims["My Claims<br/>[MyClaimsPage.jsx]"]
  node_claimspanel["Claims Panel<br/>[ClaimsPanel.jsx]"]
  node_authcontext["Auth State<br/>[AuthContext.jsx]"]
  node_api_client["API Client<br/>[api.js]"]
end

subgraph group_api["API and Workflows"]
  node_server["Express Server<br/>[server.js]"]
  node_authroutes["Auth Routes<br/>[authRoutes.js]"]
  node_itemroutes["Item Routes<br/>[itemRoutes.js]"]
  node_claimroutes["Claim Routes<br/>[claimRoutes.js]"]
  node_authcontroller["Authentication<br/>[authController.js]"]
  node_itemcontroller["Item Workflow<br/>[itemController.js]"]
  node_claimcontroller["Claim Workflow<br/>[claimController.js]"]
  node_authmiddleware["JWT Guard<br/>[authMiddleware.js]"]
end

subgraph group_data["Persistent Data"]
  node_user_model[("User Records<br/>[User.js]")]
  node_item_model[("Item Records<br/>[Item.js]")]
  node_claim_model[("Claim Records<br/>[Claim.js]")]
end

subgraph group_integrations["External Services"]
  node_cloudinary_config["Image Upload<br/>[cloudinary.js]"]
  node_email_service["Email Sender<br/>[sendEmail.js]"]
  node_cloudinary(("Cloudinary"))
  node_email(("Email Provider"))
end

node_student(("Student"))

node_student -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_browse
node_webapp -->|"routes to"| node_itemdetail
node_webapp -->|"protects route"| node_postitem
node_webapp -->|"protects route"| node_myposts
node_webapp -->|"protects route"| node_myclaims
node_myposts -->|"renders"| node_claimspanel
node_authcontext -.->|"stores credentials"| node_api_client
node_browse -.->|"requests listings"| node_api_client
node_itemdetail -.->|"requests item"| node_api_client
node_postitem -.->|"submits report"| node_api_client
node_myposts -.->|"requests posts"| node_api_client
node_myclaims -.->|"requests claims"| node_api_client
node_claimspanel -.->|"manages claims"| node_api_client
node_api_client -->|"calls API"| node_server
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_itemroutes
node_server -->|"mounts routes"| node_claimroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_itemroutes -->|"dispatches"| node_itemcontroller
node_claimroutes -->|"dispatches"| node_claimcontroller
node_itemroutes -->|"guards"| node_authmiddleware
node_claimroutes -->|"guards"| node_authmiddleware
node_authcontroller -->|"reads and writes"| node_user_model
node_itemcontroller -->|"reads and writes"| node_item_model
node_itemcontroller -->|"deletes claims"| node_claim_model
node_itemcontroller -->|"counts users"| node_user_model
node_claimcontroller -->|"reads and writes"| node_claim_model
node_claimcontroller -->|"reads and resolves"| node_item_model
node_itemroutes -->|"uses upload"| node_cloudinary_config
node_cloudinary_config -.->|"stores images"| node_cloudinary
node_claimcontroller -->|"sends notices"| node_email_service
node_email_service -.->|"delivers mail"| node_email

click node_webapp "https://github.com/goyal-nandini/claimit/blob/main/client/src/App.jsx"
click node_browse "https://github.com/goyal-nandini/claimit/blob/main/client/src/pages/ItemsPage.jsx"
click node_itemdetail "https://github.com/goyal-nandini/claimit/blob/main/client/src/pages/ItemDetailPage.jsx"
click node_postitem "https://github.com/goyal-nandini/claimit/blob/main/client/src/pages/PostItemPage.jsx"
click node_myposts "https://github.com/goyal-nandini/claimit/blob/main/client/src/pages/MyPostsPage.jsx"
click node_myclaims "https://github.com/goyal-nandini/claimit/blob/main/client/src/pages/MyClaimsPage.jsx"
click node_claimspanel "https://github.com/goyal-nandini/claimit/blob/main/client/src/components/ClaimsPanel.jsx"
click node_authcontext "https://github.com/goyal-nandini/claimit/blob/main/client/src/context/AuthContext.jsx"
click node_api_client "https://github.com/goyal-nandini/claimit/blob/main/client/src/services/api.js"
click node_server "https://github.com/goyal-nandini/claimit/blob/main/server/server.js"
click node_authroutes "https://github.com/goyal-nandini/claimit/blob/main/server/routes/authRoutes.js"
click node_itemroutes "https://github.com/goyal-nandini/claimit/blob/main/server/routes/itemRoutes.js"
click node_claimroutes "https://github.com/goyal-nandini/claimit/blob/main/server/routes/claimRoutes.js"
click node_authcontroller "https://github.com/goyal-nandini/claimit/blob/main/server/controllers/authController.js"
click node_itemcontroller "https://github.com/goyal-nandini/claimit/blob/main/server/controllers/itemController.js"
click node_claimcontroller "https://github.com/goyal-nandini/claimit/blob/main/server/controllers/claimController.js"
click node_authmiddleware "https://github.com/goyal-nandini/claimit/blob/main/server/middleware/authMiddleware.js"
click node_user_model "https://github.com/goyal-nandini/claimit/blob/main/server/models/User.js"
click node_item_model "https://github.com/goyal-nandini/claimit/blob/main/server/models/Item.js"
click node_claim_model "https://github.com/goyal-nandini/claimit/blob/main/server/models/Claim.js"
click node_cloudinary_config "https://github.com/goyal-nandini/claimit/blob/main/server/utils/cloudinary.js"
click node_email_service "https://github.com/goyal-nandini/claimit/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_webapp,node_browse,node_itemdetail,node_postitem,node_myposts,node_myclaims,node_claimspanel,node_authcontext,node_api_client toneBlue
class node_server,node_authroutes,node_itemroutes,node_claimroutes,node_authcontroller,node_itemcontroller,node_claimcontroller,node_authmiddleware toneAmber
class node_user_model,node_item_model,node_claim_model toneMint
class node_cloudinary_config,node_email_service,node_cloudinary,node_email toneRose
class node_student toneIndigo
```

## Components

### Student Web App

- [Page Router](https://github.com/goyal-nandini/claimit/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Browse Items](https://github.com/goyal-nandini/claimit/blob/main/client/src/pages/ItemsPage.jsx): `client/src/pages/ItemsPage.jsx`
- [Item Details](https://github.com/goyal-nandini/claimit/blob/main/client/src/pages/ItemDetailPage.jsx): `client/src/pages/ItemDetailPage.jsx`
- [Report Item](https://github.com/goyal-nandini/claimit/blob/main/client/src/pages/PostItemPage.jsx): `client/src/pages/PostItemPage.jsx`
- [My Posts](https://github.com/goyal-nandini/claimit/blob/main/client/src/pages/MyPostsPage.jsx): `client/src/pages/MyPostsPage.jsx`
- [My Claims](https://github.com/goyal-nandini/claimit/blob/main/client/src/pages/MyClaimsPage.jsx): `client/src/pages/MyClaimsPage.jsx`
- [Claims Panel](https://github.com/goyal-nandini/claimit/blob/main/client/src/components/ClaimsPanel.jsx): `client/src/components/ClaimsPanel.jsx`
- [Auth State](https://github.com/goyal-nandini/claimit/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [API Client](https://github.com/goyal-nandini/claimit/blob/main/client/src/services/api.js): `client/src/services/api.js`

### API and Workflows

- [Express Server](https://github.com/goyal-nandini/claimit/blob/main/server/server.js): `server/server.js`
- [Auth Routes](https://github.com/goyal-nandini/claimit/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Item Routes](https://github.com/goyal-nandini/claimit/blob/main/server/routes/itemRoutes.js): `server/routes/itemRoutes.js`
- [Claim Routes](https://github.com/goyal-nandini/claimit/blob/main/server/routes/claimRoutes.js): `server/routes/claimRoutes.js`
- [Authentication](https://github.com/goyal-nandini/claimit/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [Item Workflow](https://github.com/goyal-nandini/claimit/blob/main/server/controllers/itemController.js): `server/controllers/itemController.js`
- [Claim Workflow](https://github.com/goyal-nandini/claimit/blob/main/server/controllers/claimController.js): `server/controllers/claimController.js`
- [JWT Guard](https://github.com/goyal-nandini/claimit/blob/main/server/middleware/authMiddleware.js): `server/middleware/authMiddleware.js`

### Persistent Data

- [User Records](https://github.com/goyal-nandini/claimit/blob/main/server/models/User.js): `server/models/User.js`
- [Item Records](https://github.com/goyal-nandini/claimit/blob/main/server/models/Item.js): `server/models/Item.js`
- [Claim Records](https://github.com/goyal-nandini/claimit/blob/main/server/models/Claim.js): `server/models/Claim.js`

### External Services

- [Image Upload](https://github.com/goyal-nandini/claimit/blob/main/server/utils/cloudinary.js): `server/utils/cloudinary.js`
- [Email Sender](https://github.com/goyal-nandini/claimit/blob/main/server/utils/sendEmail.js): `server/utils/sendEmail.js`
- **Cloudinary**
- **Email Provider**

### Other components

- **Student**

## Connections

- Student → Page Router: uses (evidence: `README.md`)
- Page Router → Browse Items: routes to (evidence: `client/src/App.jsx`)
- Page Router → Item Details: routes to (evidence: `client/src/App.jsx`)
- Page Router → Report Item: protects route (evidence: `client/src/App.jsx`)
- Page Router → My Posts: protects route (evidence: `client/src/App.jsx`)
- Page Router → My Claims: protects route (evidence: `client/src/App.jsx`)
- My Posts → Claims Panel: renders (evidence: `client/src/pages/MyPostsPage.jsx`)
- Auth State → API Client: stores credentials
- Browse Items → API Client: requests listings (evidence: `client/src/pages/ItemsPage.jsx`)
- Item Details → API Client: requests item (evidence: `client/src/pages/ItemDetailPage.jsx`)
- Report Item → API Client: submits report (evidence: `client/src/pages/PostItemPage.jsx`)
- My Posts → API Client: requests posts (evidence: `client/src/pages/MyPostsPage.jsx`)
- My Claims → API Client: requests claims (evidence: `client/src/pages/MyClaimsPage.jsx`)
- Claims Panel → API Client: manages claims (evidence: `client/src/components/ClaimsPanel.jsx`)
- API Client → Express Server: calls API (evidence: `README.md`)
- Express Server → Auth Routes: mounts routes (evidence: `server/server.js`)
- Express Server → Item Routes: mounts routes (evidence: `server/server.js`)
- Express Server → Claim Routes: mounts routes (evidence: `server/server.js`)
- Auth Routes → Authentication: dispatches (evidence: `server/routes/authRoutes.js`)
- Item Routes → Item Workflow: dispatches (evidence: `server/routes/itemRoutes.js`)
- Claim Routes → Claim Workflow: dispatches (evidence: `server/routes/claimRoutes.js`)
- Item Routes → JWT Guard: guards (evidence: `server/routes/itemRoutes.js`)
- Claim Routes → JWT Guard: guards (evidence: `server/routes/claimRoutes.js`)
- Authentication → User Records: reads and writes (evidence: `server/controllers/authController.js`)
- Item Workflow → Item Records: reads and writes (evidence: `server/controllers/itemController.js`)
- Item Workflow → Claim Records: deletes claims (evidence: `server/controllers/itemController.js`)
- Item Workflow → User Records: counts users (evidence: `server/controllers/itemController.js`)
- Claim Workflow → Claim Records: reads and writes (evidence: `server/controllers/claimController.js`)
- Claim Workflow → Item Records: reads and resolves (evidence: `server/controllers/claimController.js`)
- Item Routes → Image Upload: uses upload (evidence: `server/routes/itemRoutes.js`)
- Image Upload → Cloudinary: stores images
- Claim Workflow → Email Sender: sends notices (evidence: `server/controllers/claimController.js`)
- Email Sender → Email Provider: delivers mail
