# prag-18/loopin architecture

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

- Interactive diagram: https://gitdiagram.com/prag-18/loopin
- Repository: https://github.com/prag-18/loopin

## Overview

LoopIn is a campus-community gear-sharing product: students browse items or submit dated borrowing requests, with visibility scoped by trust-circle degree. The React client renders these workflows and currently keeps profile and request state in browser localStorage; the Spring backend exposes listing and request APIs, with request business logic and repository abstractions. The request API-to-service relationship is explicit; backend persistence wiring and frontend-to-backend calls were not shown, so those links are omitted. The repository interfaces and domain models are included, but the sampled excerpts do not establish which repository implementations are active.

Main entry points: [`src/App.jsx`](https://github.com/prag-18/loopin/blob/main/src/App.jsx) (Route shell), [`src/context/AppContext.jsx`](https://github.com/prag-18/loopin/blob/main/src/context/AppContext.jsx) (Client state), [`backend/src/main/java/com/loopin/service/RequestService.java`](https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/service/RequestService.java) (Request service contract), [`backend/src/main/java/com/loopin/service/RequestServiceImpl.java`](https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/service/RequestServiceImpl.java) (Request business logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route shell<br/>[App.jsx]"]
  node_provider["Client state<br/>[AppContext.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_browse["Browse listings<br/>[Listings.jsx]"]
  node_requestform["Request form<br/>[Request.jsx]"]
  node_signin["Sign in<br/>[SignIn.jsx]"]
  node_signup["Sign up<br/>[SignUp.jsx]"]
  node_hero["Mode navigation<br/>[Hero.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_browserstore[("Browser localStorage")]
end

subgraph group_backend["Backend API"]
  node_listingapi["Listing endpoints"]
  node_requestapi["Request endpoints"]
  node_requestservice["Request business logic"]
  node_requestcontract["Request service contract"]
end

subgraph group_domain["Domain and storage"]
  node_listingcontract["Listing repository contract"]
  node_requestcontractrepo["Request repository contract"]
  node_listingmodel["Item listing<br/>[ItemListing.java]"]
  node_requestmodel["Item request<br/>[ItemRequest.java]"]
  node_listingstore[("Listing repositories")]
  node_requeststore[("Request repositories")]
end

node_student(("Campus student"))

node_student -->|"uses"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_browse
node_app -->|"routes"| node_requestform
node_app -->|"routes"| node_signin
node_app -->|"routes"| node_signup
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_browse -->|"renders"| node_hero
node_requestform -->|"renders"| node_hero
node_browse -->|"reads state"| node_provider
node_requestform -->|"creates request"| node_provider
node_signin -->|"signs in"| node_provider
node_signup -->|"signs up"| node_provider
node_navbar -->|"reads state"| node_provider
node_provider -->|"persists profile"| node_browserstore
node_provider -->|"persists requests"| node_browserstore
node_requestapi -->|"delegates"| node_requestcontract
node_requestservice -->|"implements"| node_requestcontract
node_requestservice -->|"uses"| node_listingcontract
node_requestservice -->|"uses"| node_requestcontractrepo
node_requestcontract -->|"returns matches"| node_listingmodel
node_requestcontract -->|"handles"| node_requestmodel
node_listingcontract -->|"stores"| node_listingmodel
node_requestcontractrepo -->|"stores"| node_requestmodel
node_listingstore -.->|"implements"| node_listingcontract
node_requeststore -.->|"implements"| node_requestcontractrepo
node_listingapi -->|"returns"| node_listingmodel

click node_app "https://github.com/prag-18/loopin/blob/main/src/App.jsx"
click node_provider "https://github.com/prag-18/loopin/blob/main/src/context/AppContext.jsx"
click node_home "https://github.com/prag-18/loopin/blob/main/src/pages/Home.jsx"
click node_browse "https://github.com/prag-18/loopin/blob/main/src/pages/Listings.jsx"
click node_requestform "https://github.com/prag-18/loopin/blob/main/src/pages/Request.jsx"
click node_signin "https://github.com/prag-18/loopin/blob/main/src/pages/SignIn.jsx"
click node_signup "https://github.com/prag-18/loopin/blob/main/src/pages/SignUp.jsx"
click node_hero "https://github.com/prag-18/loopin/blob/main/src/components/Hero.jsx"
click node_navbar "https://github.com/prag-18/loopin/blob/main/src/components/Navbar.jsx"
click node_footer "https://github.com/prag-18/loopin/blob/main/src/components/Footer.jsx"
click node_listingapi "https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/controller/ListingController.java"
click node_requestapi "https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/controller/RequestController.java"
click node_requestservice "https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/service/RequestServiceImpl.java"
click node_requestcontract "https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/service/RequestService.java"
click node_listingcontract "https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/repository/ListingRepository.java"
click node_requestcontractrepo "https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/repository/RequestRepository.java"
click node_listingmodel "https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/model/ItemListing.java"
click node_requestmodel "https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/model/ItemRequest.java"
click node_listingstore "https://github.com/prag-18/loopin/tree/main/backend/src/main/java/com/loopin/repository"
click node_requeststore "https://github.com/prag-18/loopin/tree/main/backend/src/main/java/com/loopin/repository"

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_provider,node_home,node_browse,node_requestform,node_signin,node_signup,node_hero,node_navbar,node_footer,node_browserstore toneBlue
class node_listingapi,node_requestapi,node_requestservice,node_requestcontract toneAmber
class node_listingcontract,node_requestcontractrepo,node_listingmodel,node_requestmodel,node_listingstore,node_requeststore toneMint
class node_student toneIndigo
```

## Components

### Web client

- [Route shell](https://github.com/prag-18/loopin/blob/main/src/App.jsx): `src/App.jsx`
- [Client state](https://github.com/prag-18/loopin/blob/main/src/context/AppContext.jsx): `src/context/AppContext.jsx`
- [Home page](https://github.com/prag-18/loopin/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Browse listings](https://github.com/prag-18/loopin/blob/main/src/pages/Listings.jsx): `src/pages/Listings.jsx`
- [Request form](https://github.com/prag-18/loopin/blob/main/src/pages/Request.jsx): `src/pages/Request.jsx`
- [Sign in](https://github.com/prag-18/loopin/blob/main/src/pages/SignIn.jsx): `src/pages/SignIn.jsx`
- [Sign up](https://github.com/prag-18/loopin/blob/main/src/pages/SignUp.jsx): `src/pages/SignUp.jsx`
- [Mode navigation](https://github.com/prag-18/loopin/blob/main/src/components/Hero.jsx): `src/components/Hero.jsx`
- [Navigation bar](https://github.com/prag-18/loopin/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Footer](https://github.com/prag-18/loopin/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`
- **Browser localStorage**

### Backend API

- [Listing endpoints](https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/controller/ListingController.java): `backend/src/main/java/com/loopin/controller/ListingController.java`
- [Request endpoints](https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/controller/RequestController.java): `backend/src/main/java/com/loopin/controller/RequestController.java`
- [Request business logic](https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/service/RequestServiceImpl.java): `backend/src/main/java/com/loopin/service/RequestServiceImpl.java`
- [Request service contract](https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/service/RequestService.java): `backend/src/main/java/com/loopin/service/RequestService.java`

### Domain and storage

- [Listing repository contract](https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/repository/ListingRepository.java): `backend/src/main/java/com/loopin/repository/ListingRepository.java`
- [Request repository contract](https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/repository/RequestRepository.java): `backend/src/main/java/com/loopin/repository/RequestRepository.java`
- [Item listing](https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/model/ItemListing.java): `backend/src/main/java/com/loopin/model/ItemListing.java`
- [Item request](https://github.com/prag-18/loopin/blob/main/backend/src/main/java/com/loopin/model/ItemRequest.java): `backend/src/main/java/com/loopin/model/ItemRequest.java`
- [Listing repositories](https://github.com/prag-18/loopin/tree/main/backend/src/main/java/com/loopin/repository): `backend/src/main/java/com/loopin/repository`
- [Request repositories](https://github.com/prag-18/loopin/tree/main/backend/src/main/java/com/loopin/repository): `backend/src/main/java/com/loopin/repository`

### Other components

- **Campus student**

## Connections

- Campus student → Route shell: uses (evidence: `src/App.jsx`)
- Route shell → Home page: routes (evidence: `src/App.jsx`)
- Route shell → Browse listings: routes (evidence: `src/App.jsx`)
- Route shell → Request form: routes (evidence: `src/App.jsx`)
- Route shell → Sign in: routes (evidence: `src/App.jsx`)
- Route shell → Sign up: routes (evidence: `src/App.jsx`)
- Route shell → Navigation bar: renders (evidence: `src/App.jsx`)
- Route shell → Footer: renders (evidence: `src/App.jsx`)
- Browse listings → Mode navigation: renders (evidence: `src/pages/Listings.jsx`)
- Request form → Mode navigation: renders (evidence: `src/pages/Request.jsx`)
- Browse listings → Client state: reads state (evidence: `src/pages/Listings.jsx`)
- Request form → Client state: creates request (evidence: `src/pages/Request.jsx`)
- Sign in → Client state: signs in (evidence: `src/context/AppContext.jsx`)
- Sign up → Client state: signs up (evidence: `src/context/AppContext.jsx`)
- Navigation bar → Client state: reads state (evidence: `src/components/Navbar.jsx`)
- Client state → Browser localStorage: persists profile (evidence: `src/context/AppContext.jsx`)
- Client state → Browser localStorage: persists requests (evidence: `src/context/AppContext.jsx`)
- Request endpoints → Request service contract: delegates (evidence: `backend/src/main/java/com/loopin/controller/RequestController.java`)
- Request business logic → Request service contract: implements (evidence: `backend/src/main/java/com/loopin/service/RequestService.java`)
- Request business logic → Listing repository contract: uses (evidence: `backend/src/main/java/com/loopin/service/RequestServiceImpl.java`)
- Request business logic → Request repository contract: uses (evidence: `backend/src/main/java/com/loopin/service/RequestServiceImpl.java`)
- Request service contract → Item listing: returns matches (evidence: `backend/src/main/java/com/loopin/service/RequestService.java`)
- Request service contract → Item request: handles (evidence: `backend/src/main/java/com/loopin/service/RequestService.java`)
- Listing repository contract → Item listing: stores (evidence: `backend/src/main/java/com/loopin/repository/ListingRepository.java`)
- Request repository contract → Item request: stores (evidence: `backend/src/main/java/com/loopin/repository/RequestRepository.java`)
- Listing repositories → Listing repository contract: implements (evidence: `backend/src/main/java/com/loopin/repository/JdbcListingRepository.java`)
- Request repositories → Request repository contract: implements (evidence: `backend/src/main/java/com/loopin/repository/JdbcRequestRepository.java`)
- Listing endpoints → Item listing: returns (evidence: `backend/src/main/java/com/loopin/controller/ListingController.java`)
