# ciphrchai/unirent architecture

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

- Interactive diagram: https://gitdiagram.com/ciphrchai/unirent
- Repository: https://github.com/ciphrchai/unirent

## Overview

UniRent is a campus peer-to-peer rental marketplace. Students browse and inspect listings, arrange a rental through checkout, and view its confirmation; owners can publish and manage listings, while both sides can track rentals, transactions, and disputes. Account/profile tools and wallet connectivity support this flow. The README documents all twelve product pages; sampled code confirms routing, local-storage persistence, wallet context, and selected escrow calls. Several page implementations were not sampled, so their internal wiring is intentionally not inferred.

Main entry points: [`src/App.tsx`](https://github.com/ciphrchai/unirent/blob/main/src/App.tsx) (Route application), [`src/pages/MyListings.tsx`](https://github.com/ciphrchai/unirent/blob/main/src/pages/MyListings.tsx) (My listings), [`src/blockchain/wallet.ts`](https://github.com/ciphrchai/unirent/blob/main/src/blockchain/wallet.ts) (Wallet adapter), [`src/services/storageService.ts`](https://github.com/ciphrchai/unirent/blob/main/src/services/storageService.ts) (Storage service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Marketplace app"]
  node_app["Route application<br/>[App.tsx]"]
  node_shell["Page shell<br/>[Layout.tsx]"]
end

subgraph group_rental["Rental journey"]
  node_home["Home<br/>[Home.tsx]"]
  node_market["Marketplace<br/>[Marketplace.tsx]"]
  node_details["Item details<br/>[ItemDetails.tsx]"]
  node_listing["Create listing<br/>[CreateListing.tsx]"]
  node_checkout["Checkout<br/>[Checkout.tsx]"]
  node_confirmation["Booking confirmation"]
end

subgraph group_management["Account and records"]
  node_rentals["My rentals<br/>[MyRentals.tsx]"]
  node_mylistings["My listings<br/>[MyListings.tsx]"]
  node_transactions["Transactions<br/>[Transactions.tsx]"]
  node_disputes["Disputes<br/>[Disputes.tsx]"]
  node_profile["Profile<br/>[Profile.tsx]"]
  node_settings["Settings<br/>[Settings.tsx]"]
end

subgraph group_state["Local state"]
  node_storage["Storage service<br/>[storageService.ts]"]
  node_localstorage[("Browser storage")]
  node_seeddata["Seed datasets<br/>[mockData.ts]"]
end

subgraph group_chain["Wallet and escrow"]
  node_walletcontext["Wallet context<br/>[WalletContext.tsx]"]
  node_wallet["Wallet adapter<br/>[wallet.ts]"]
  node_contract["Escrow contract client<br/>[contract.ts]"]
end

node_student(("Student"))
node_mst[("MST testnet")]

node_student -->|"opens"| node_app
node_app -->|"renders"| node_shell
node_app -->|"routes"| node_home
node_app -->|"routes"| node_market
node_app -->|"routes"| node_details
node_app -->|"routes"| node_listing
node_app -->|"routes"| node_checkout
node_app -->|"routes"| node_confirmation
node_app -->|"routes"| node_rentals
node_app -->|"routes"| node_mylistings
node_app -->|"routes"| node_transactions
node_app -->|"routes"| node_disputes
node_app -->|"routes"| node_profile
node_app -->|"routes"| node_settings
node_storage -->|"reads/writes"| node_localstorage
node_storage -->|"initializes from"| node_seeddata
node_walletcontext -->|"connects and refreshes"| node_wallet
node_mylistings -->|"fetches and confirms"| node_contract
node_mylistings -->|"switches network"| node_wallet
node_contract -.->|"reads/writes escrow"| node_mst
node_wallet -.->|"connects to"| node_mst

click node_app "https://github.com/ciphrchai/unirent/blob/main/src/App.tsx"
click node_shell "https://github.com/ciphrchai/unirent/blob/main/src/components/layout/Layout.tsx"
click node_home "https://github.com/ciphrchai/unirent/blob/main/src/pages/Home.tsx"
click node_market "https://github.com/ciphrchai/unirent/blob/main/src/pages/Marketplace.tsx"
click node_details "https://github.com/ciphrchai/unirent/blob/main/src/pages/ItemDetails.tsx"
click node_listing "https://github.com/ciphrchai/unirent/blob/main/src/pages/CreateListing.tsx"
click node_checkout "https://github.com/ciphrchai/unirent/blob/main/src/pages/Checkout.tsx"
click node_confirmation "https://github.com/ciphrchai/unirent/blob/main/src/pages/BookingConfirmation.tsx"
click node_rentals "https://github.com/ciphrchai/unirent/blob/main/src/pages/MyRentals.tsx"
click node_mylistings "https://github.com/ciphrchai/unirent/blob/main/src/pages/MyListings.tsx"
click node_transactions "https://github.com/ciphrchai/unirent/blob/main/src/pages/Transactions.tsx"
click node_disputes "https://github.com/ciphrchai/unirent/blob/main/src/pages/Disputes.tsx"
click node_profile "https://github.com/ciphrchai/unirent/blob/main/src/pages/Profile.tsx"
click node_settings "https://github.com/ciphrchai/unirent/blob/main/src/pages/Settings.tsx"
click node_storage "https://github.com/ciphrchai/unirent/blob/main/src/services/storageService.ts"
click node_seeddata "https://github.com/ciphrchai/unirent/blob/main/src/data/mockData.ts"
click node_walletcontext "https://github.com/ciphrchai/unirent/blob/main/src/context/WalletContext.tsx"
click node_wallet "https://github.com/ciphrchai/unirent/blob/main/src/blockchain/wallet.ts"
click node_contract "https://github.com/ciphrchai/unirent/blob/main/src/blockchain/contract.ts"

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_shell toneBlue
class node_home,node_market,node_details,node_listing,node_checkout,node_confirmation,node_mst toneAmber
class node_rentals,node_mylistings,node_transactions,node_disputes,node_profile,node_settings toneMint
class node_storage,node_localstorage,node_seeddata toneRose
class node_walletcontext,node_wallet,node_contract,node_student toneIndigo
```

## Components

### Marketplace app

- [Route application](https://github.com/ciphrchai/unirent/blob/main/src/App.tsx): `src/App.tsx`
- [Page shell](https://github.com/ciphrchai/unirent/blob/main/src/components/layout/Layout.tsx): `src/components/layout/Layout.tsx`

### Rental journey

- [Home](https://github.com/ciphrchai/unirent/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Marketplace](https://github.com/ciphrchai/unirent/blob/main/src/pages/Marketplace.tsx): `src/pages/Marketplace.tsx`
- [Item details](https://github.com/ciphrchai/unirent/blob/main/src/pages/ItemDetails.tsx): `src/pages/ItemDetails.tsx`
- [Create listing](https://github.com/ciphrchai/unirent/blob/main/src/pages/CreateListing.tsx): `src/pages/CreateListing.tsx`
- [Checkout](https://github.com/ciphrchai/unirent/blob/main/src/pages/Checkout.tsx): `src/pages/Checkout.tsx`
- [Booking confirmation](https://github.com/ciphrchai/unirent/blob/main/src/pages/BookingConfirmation.tsx): `src/pages/BookingConfirmation.tsx`

### Account and records

- [My rentals](https://github.com/ciphrchai/unirent/blob/main/src/pages/MyRentals.tsx): `src/pages/MyRentals.tsx`
- [My listings](https://github.com/ciphrchai/unirent/blob/main/src/pages/MyListings.tsx): `src/pages/MyListings.tsx`
- [Transactions](https://github.com/ciphrchai/unirent/blob/main/src/pages/Transactions.tsx): `src/pages/Transactions.tsx`
- [Disputes](https://github.com/ciphrchai/unirent/blob/main/src/pages/Disputes.tsx): `src/pages/Disputes.tsx`
- [Profile](https://github.com/ciphrchai/unirent/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Settings](https://github.com/ciphrchai/unirent/blob/main/src/pages/Settings.tsx): `src/pages/Settings.tsx`

### Local state

- [Storage service](https://github.com/ciphrchai/unirent/blob/main/src/services/storageService.ts): `src/services/storageService.ts`
- **Browser storage**
- [Seed datasets](https://github.com/ciphrchai/unirent/blob/main/src/data/mockData.ts): `src/data/mockData.ts`

### Wallet and escrow

- [Wallet context](https://github.com/ciphrchai/unirent/blob/main/src/context/WalletContext.tsx): `src/context/WalletContext.tsx`
- [Wallet adapter](https://github.com/ciphrchai/unirent/blob/main/src/blockchain/wallet.ts): `src/blockchain/wallet.ts`
- [Escrow contract client](https://github.com/ciphrchai/unirent/blob/main/src/blockchain/contract.ts): `src/blockchain/contract.ts`

### Other components

- **Student**
- **MST testnet**

## Connections

- Student → Route application: opens
- Route application → Page shell: renders
- Route application → Home: routes
- Route application → Marketplace: routes
- Route application → Item details: routes
- Route application → Create listing: routes
- Route application → Checkout: routes
- Route application → Booking confirmation: routes
- Route application → My rentals: routes
- Route application → My listings: routes
- Route application → Transactions: routes
- Route application → Disputes: routes
- Route application → Profile: routes
- Route application → Settings: routes
- Storage service → Browser storage: reads/writes
- Storage service → Seed datasets: initializes from
- Wallet context → Wallet adapter: connects and refreshes
- My listings → Escrow contract client: fetches and confirms
- My listings → Wallet adapter: switches network
- Escrow contract client → MST testnet: reads/writes escrow
- Wallet adapter → MST testnet: connects to
