# arpit0109/sih-project-2-id-25060 architecture

> Architecture diagram of the GitHub repository arpit0109/sih-project-2-id-25060, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arpit0109/sih-project-2-id-25060
- Repository: https://github.com/arpit0109/sih-project-2-id-25060

## Overview

This is a recycling/scrap marketplace with separate seller and buyer experiences: sellers authenticate and list waste, while buyers browse listings and proceed through confirmation/contact screens. The app also exposes location suggestions and chatbot routes, and the frontend includes recycling, games, leaderboard, and shop experiences. The graph reflects routes and calls visible in sampled files; several feature pages and backend route implementations were not sampled, so their internal wiring is left unspecified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/App.jsx) (Route application), [`backend/app.js`](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/app.js) (API server), [`backend/routes/mapRouter/mapRouter.js`](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/mapRouter/mapRouter.js) (Map routes), [`backend/routes/UserAuth/authRoute.js`](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/UserAuth/authRoute.js) (Seller auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Route application<br/>[App.jsx]"]
  node_seller_ui["Seller experience<br/>[SellingPage.jsx]"]
  node_buyer_ui["Buyer experience<br/>[ListOfWaste.jsx]"]
end

subgraph group_identity["User identity"]
  node_user_auth_ui["Seller sign-in<br/>[UserLogin.jsx]"]
  node_buyer_auth_ui["Buyer sign-in<br/>[BuyerLogin.jsx]"]
  node_user_auth_routes["Seller auth routes<br/>[authRoute.js]"]
  node_buyer_auth_routes["Buyer auth routes<br/>[BuyerAuthRouter.js]"]
  node_user_auth["Seller auth logic<br/>[AuthControl.js]"]
  node_buyer_auth["Buyer auth logic"]
  node_user_store[("Seller accounts<br/>[UserModel.js]")]
  node_buyer_store[("Buyer accounts<br/>[BuyerModel.js]")]
end

subgraph group_market["Scrap marketplace"]
  node_sell_form["Create listing<br/>[Sell.jsx]"]
  node_listing_detail["Listing detail"]
  node_buyer_confirm["Buyer confirmation<br/>[BuyerConfirm.jsx]"]
  node_found["Seller contact<br/>[Found.jsx]"]
  node_backend["API server<br/>[app.js]"]
  node_scrap_routes["Scrap routes<br/>[scrapCreate.js]"]
  node_scrap_logic["Listing creation<br/>[ScrapController.js]"]
  node_scrap_store[("Waste listings")]
end

subgraph group_extras["Supporting features"]
  node_location_ui["Location lookup"]
  node_map_routes["Map routes<br/>[mapRouter.js]"]
  node_map_logic["Suggestion logic<br/>[mapControl.js]"]
  node_chatbot["Chatbot experience<br/>[Chatbot.jsx]"]
  node_chat_routes["Chatbot routes<br/>[chatbot.js]"]
  node_recycling["Recycling guidance<br/>[RecyclingWaste.jsx]"]
  node_points["Recycling points<br/>[recyclingPonts.jsx]"]
  node_games["Recycling games<br/>[Games.jsx]"]
  node_leaderboard["Leaderboard<br/>[LeaderBord.jsx]"]
  node_shop["Rewards shop<br/>[Shop.jsx]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_user_auth_ui
node_app -->|"routes to"| node_buyer_auth_ui
node_app -->|"routes to"| node_seller_ui
node_app -->|"routes to"| node_sell_form
node_app -->|"routes to"| node_buyer_ui
node_app -->|"routes to"| node_listing_detail
node_app -->|"routes to"| node_buyer_confirm
node_app -->|"routes to"| node_found
node_app -->|"routes to"| node_chatbot
node_app -->|"routes to"| node_recycling
node_app -->|"routes to"| node_points
node_app -->|"routes to"| node_games
node_app -->|"routes to"| node_leaderboard
node_app -->|"routes to"| node_shop
node_backend -->|"mounts"| node_user_auth_routes
node_backend -->|"mounts"| node_buyer_auth_routes
node_backend -->|"mounts"| node_scrap_routes
node_backend -->|"mounts"| node_map_routes
node_backend -->|"mounts"| node_chat_routes
node_user_auth_routes -->|"dispatches"| node_user_auth
node_buyer_auth_routes -->|"dispatches"| node_buyer_auth
node_user_auth -->|"registers and reads"| node_user_store
node_buyer_auth -->|"registers and reads"| node_buyer_store
node_scrap_routes -->|"dispatches"| node_scrap_logic
node_scrap_logic -->|"creates listing"| node_scrap_store
node_map_routes -->|"dispatches"| node_map_logic
node_location_ui -.->|"requests suggestions"| node_map_routes

click node_app "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/App.jsx"
click node_seller_ui "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/Selling%20page/SellingPage.jsx"
click node_sell_form "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/SellScrap/Sell.jsx"
click node_buyer_ui "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Buyer/BuyScrap/ListOfWaste.jsx"
click node_listing_detail "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Buyer/BuyScrap/WasteDescription.jsx"
click node_buyer_confirm "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Buyer/BuyerConfirm/BuyerConfirm.jsx"
click node_found "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Buyer/SellerFound/Found.jsx"
click node_user_auth_ui "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/UserLogin/UserLogin.jsx"
click node_buyer_auth_ui "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Buyer/BuyerLogin/BuyerLogin.jsx"
click node_backend "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/app.js"
click node_user_auth_routes "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/UserAuth/authRoute.js"
click node_buyer_auth_routes "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/UserAuth/BuyerAuthRouter.js"
click node_user_auth "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/controllers/AuthController/AuthControl.js"
click node_buyer_auth "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/controllers/AuthController/BuyerAuthControler.js"
click node_user_store "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/models/UserModel.js"
click node_buyer_store "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/models/BuyerModel.js"
click node_scrap_routes "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/ScrapRouter/scrapCreate.js"
click node_scrap_logic "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/controllers/ScrapController/ScrapController.js"
click node_scrap_store "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/models/WasteProductModel.js"
click node_location_ui "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/components/SearchPanal/LocationSearchpanel.jsx"
click node_map_routes "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/mapRouter/mapRouter.js"
click node_map_logic "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/controllers/mapController/mapControl.js"
click node_chatbot "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Chatbot/Chatbot.jsx"
click node_chat_routes "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/chatBot/chatbot.js"
click node_recycling "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/recycling/RecyclingWaste.jsx"
click node_points "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/recycling/recyclingPonts.jsx"
click node_games "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/Games/Games.jsx"
click node_leaderboard "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/LeaderBord/LeaderBord.jsx"
click node_shop "https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Shop/Shop.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_seller_ui,node_buyer_ui toneBlue
class node_user_auth_ui,node_buyer_auth_ui,node_user_auth_routes,node_buyer_auth_routes,node_user_auth,node_buyer_auth,node_user_store,node_buyer_store toneAmber
class node_sell_form,node_listing_detail,node_buyer_confirm,node_found,node_backend,node_scrap_routes,node_scrap_logic,node_scrap_store toneMint
class node_location_ui,node_map_routes,node_map_logic,node_chatbot,node_chat_routes,node_recycling,node_points,node_games,node_leaderboard,node_shop toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Seller experience](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/Selling%20page/SellingPage.jsx): `frontend/src/pages/User/Selling page/SellingPage.jsx`
- [Buyer experience](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Buyer/BuyScrap/ListOfWaste.jsx): `frontend/src/pages/Buyer/BuyScrap/ListOfWaste.jsx`

### User identity

- [Seller sign-in](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/UserLogin/UserLogin.jsx): `frontend/src/pages/User/UserLogin/UserLogin.jsx`
- [Buyer sign-in](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Buyer/BuyerLogin/BuyerLogin.jsx): `frontend/src/pages/Buyer/BuyerLogin/BuyerLogin.jsx`
- [Seller auth routes](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/UserAuth/authRoute.js): `backend/routes/UserAuth/authRoute.js`
- [Buyer auth routes](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/UserAuth/BuyerAuthRouter.js): `backend/routes/UserAuth/BuyerAuthRouter.js`
- [Seller auth logic](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/controllers/AuthController/AuthControl.js): `backend/controllers/AuthController/AuthControl.js`
- [Buyer auth logic](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/controllers/AuthController/BuyerAuthControler.js): `backend/controllers/AuthController/BuyerAuthControler.js`
- [Seller accounts](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/models/UserModel.js): `backend/models/UserModel.js`
- [Buyer accounts](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/models/BuyerModel.js): `backend/models/BuyerModel.js`

### Scrap marketplace

- [Create listing](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/SellScrap/Sell.jsx): `frontend/src/pages/User/SellScrap/Sell.jsx`
- [Listing detail](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Buyer/BuyScrap/WasteDescription.jsx): `frontend/src/pages/Buyer/BuyScrap/WasteDescription.jsx`
- [Buyer confirmation](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Buyer/BuyerConfirm/BuyerConfirm.jsx): `frontend/src/pages/Buyer/BuyerConfirm/BuyerConfirm.jsx`
- [Seller contact](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Buyer/SellerFound/Found.jsx): `frontend/src/pages/Buyer/SellerFound/Found.jsx`
- [API server](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/app.js): `backend/app.js`
- [Scrap routes](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/ScrapRouter/scrapCreate.js): `backend/routes/ScrapRouter/scrapCreate.js`
- [Listing creation](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/controllers/ScrapController/ScrapController.js): `backend/controllers/ScrapController/ScrapController.js`
- [Waste listings](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/models/WasteProductModel.js): `backend/models/WasteProductModel.js`

### Supporting features

- [Location lookup](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/components/SearchPanal/LocationSearchpanel.jsx): `frontend/src/components/SearchPanal/LocationSearchpanel.jsx`
- [Map routes](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/mapRouter/mapRouter.js): `backend/routes/mapRouter/mapRouter.js`
- [Suggestion logic](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/controllers/mapController/mapControl.js): `backend/controllers/mapController/mapControl.js`
- [Chatbot experience](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Chatbot/Chatbot.jsx): `frontend/src/pages/Chatbot/Chatbot.jsx`
- [Chatbot routes](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/backend/routes/chatBot/chatbot.js): `backend/routes/chatBot/chatbot.js`
- [Recycling guidance](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/recycling/RecyclingWaste.jsx): `frontend/src/pages/User/recycling/RecyclingWaste.jsx`
- [Recycling points](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/recycling/recyclingPonts.jsx): `frontend/src/pages/User/recycling/recyclingPonts.jsx`
- [Recycling games](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/Games/Games.jsx): `frontend/src/pages/User/Games/Games.jsx`
- [Leaderboard](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/User/LeaderBord/LeaderBord.jsx): `frontend/src/pages/User/LeaderBord/LeaderBord.jsx`
- [Rewards shop](https://github.com/arpit0109/sih-project-2-id-25060/blob/main/frontend/src/pages/Shop/Shop.jsx): `frontend/src/pages/Shop/Shop.jsx`

### Other components

- **Visitor**

## Connections

- Visitor → Route application: opens
- Route application → Seller sign-in: routes to
- Route application → Buyer sign-in: routes to
- Route application → Seller experience: routes to
- Route application → Create listing: routes to
- Route application → Buyer experience: routes to
- Route application → Listing detail: routes to
- Route application → Buyer confirmation: routes to
- Route application → Seller contact: routes to
- Route application → Chatbot experience: routes to
- Route application → Recycling guidance: routes to
- Route application → Recycling points: routes to
- Route application → Recycling games: routes to
- Route application → Leaderboard: routes to
- Route application → Rewards shop: routes to
- API server → Seller auth routes: mounts
- API server → Buyer auth routes: mounts
- API server → Scrap routes: mounts
- API server → Map routes: mounts
- API server → Chatbot routes: mounts
- Seller auth routes → Seller auth logic: dispatches
- Buyer auth routes → Buyer auth logic: dispatches
- Seller auth logic → Seller accounts: registers and reads
- Buyer auth logic → Buyer accounts: registers and reads
- Scrap routes → Listing creation: dispatches
- Listing creation → Waste listings: creates listing
- Map routes → Suggestion logic: dispatches
- Location lookup → Map routes: requests suggestions
