# nischalneupanee/kitabbid architecture

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

- Interactive diagram: https://gitdiagram.com/nischalneupanee/kitabbid
- Repository: https://github.com/nischalneupanee/kitabbid

## Overview

KitabBid is a campus C2C textbook marketplace supporting fixed-price purchases and ascending English auctions, with digital-wallet payments and escrowed campus hand-off. The main workflow is students browsing or posting listings, bidding or checking out, paying through a gateway, then verifying physical hand-off. The graph includes catalog, identity, auction, and order/payment stages plus the persistence layer. Some subsystem links are based on README documentation because their implementation was not sampled; unsampled view and controller details are not assumed.

Main entry points: [`Data/ApplicationDbContext.cs`](https://github.com/nischalneupanee/kitabbid/blob/main/Data/ApplicationDbContext.cs) (PostgreSQL data), [`Controllers/OrdersController.cs`](https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/OrdersController.cs) (Order and hand-off), [`Controllers/AuctionController.cs`](https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/AuctionController.cs) (Auction actions), [`Views`](https://github.com/nischalneupanee/kitabbid/tree/main/Views) (Marketplace UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Marketplace experience"]
  node_marketplace["Marketplace UI"]
  node_catalog["Book catalog<br/>[BooksController.cs]"]
  node_home["Home discovery<br/>[HomeController.cs]"]
  node_listings["Book listings<br/>[BookListing.cs]"]
end

subgraph group_identity["Campus identity"]
  node_account["Account access"]
  node_campususer["Campus profile<br/>[ApplicationUser.cs]"]
end

subgraph group_auction["Auction system"]
  node_auctioncontroller["Auction actions"]
  node_bids["Bids<br/>[Bid.cs]"]
  node_livehub["Live bid hub<br/>[AuctionHub.cs]"]
  node_auctionworker["Auction closer"]
end

subgraph group_commerce["Orders and payments"]
  node_orders["Order and hand-off"]
  node_orderrecord["Order records<br/>[Order.cs]"]
  node_esewa["eSewa gateway<br/>[EsewaService.cs]"]
  node_khalti["Khalti gateway<br/>[KhaltiService.cs]"]
  node_wallets["Payment providers"]
end

subgraph group_persistence["Persistence"]
  node_database[("PostgreSQL data")]
end

node_student(("Student"))

node_student -->|"uses"| node_marketplace
node_marketplace -->|"requests listings"| node_catalog
node_student -->|"registers or signs in"| node_account
node_catalog -->|"queries and saves"| node_database
node_catalog -->|"creates listings"| node_listings
node_home -->|"queries catalog"| node_database
node_account -->|"uses Identity store"| node_database
node_account -->|"manages profiles"| node_campususer
node_auctioncontroller -->|"reads and writes"| node_database
node_auctioncontroller -->|"records bids"| node_bids
node_auctioncontroller -->|"broadcasts bids"| node_livehub
node_auctionworker -->|"closes auctions"| node_database
node_auctionworker -->|"notifies bidders"| node_livehub
node_orders -->|"reads and saves"| node_database
node_orders -->|"creates and updates"| node_orderrecord
node_orders -->|"signs and verifies"| node_esewa
node_orders -->|"initiates and verifies"| node_khalti
node_esewa -->|"validates payments"| node_wallets
node_khalti -->|"verifies payments"| node_wallets
node_student -->|"checks out and confirms hand-off"| node_orders
node_marketplace -->|"receives live updates"| node_livehub

click node_marketplace "https://github.com/nischalneupanee/kitabbid/tree/main/Views"
click node_catalog "https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/BooksController.cs"
click node_home "https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/HomeController.cs"
click node_listings "https://github.com/nischalneupanee/kitabbid/blob/main/Models/BookListing.cs"
click node_account "https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/AccountController.cs"
click node_campususer "https://github.com/nischalneupanee/kitabbid/blob/main/Models/ApplicationUser.cs"
click node_auctioncontroller "https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/AuctionController.cs"
click node_bids "https://github.com/nischalneupanee/kitabbid/blob/main/Models/Bid.cs"
click node_livehub "https://github.com/nischalneupanee/kitabbid/blob/main/Hubs/AuctionHub.cs"
click node_auctionworker "https://github.com/nischalneupanee/kitabbid/blob/main/Services/AuctionClosingWorker.cs"
click node_orders "https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/OrdersController.cs"
click node_orderrecord "https://github.com/nischalneupanee/kitabbid/blob/main/Models/Order.cs"
click node_esewa "https://github.com/nischalneupanee/kitabbid/blob/main/Services/EsewaService.cs"
click node_khalti "https://github.com/nischalneupanee/kitabbid/blob/main/Services/KhaltiService.cs"
click node_database "https://github.com/nischalneupanee/kitabbid/blob/main/Data/ApplicationDbContext.cs"

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_marketplace,node_catalog,node_home,node_listings toneBlue
class node_account,node_campususer toneAmber
class node_auctioncontroller,node_bids,node_livehub,node_auctionworker toneMint
class node_orders,node_orderrecord,node_esewa,node_khalti,node_wallets toneRose
class node_database,node_student toneIndigo
```

## Components

### Marketplace experience

- [Marketplace UI](https://github.com/nischalneupanee/kitabbid/tree/main/Views): `Views`
- [Book catalog](https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/BooksController.cs): `Controllers/BooksController.cs`
- [Home discovery](https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/HomeController.cs): `Controllers/HomeController.cs`
- [Book listings](https://github.com/nischalneupanee/kitabbid/blob/main/Models/BookListing.cs): `Models/BookListing.cs`

### Campus identity

- [Account access](https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/AccountController.cs): `Controllers/AccountController.cs`
- [Campus profile](https://github.com/nischalneupanee/kitabbid/blob/main/Models/ApplicationUser.cs): `Models/ApplicationUser.cs`

### Auction system

- [Auction actions](https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/AuctionController.cs): `Controllers/AuctionController.cs`
- [Bids](https://github.com/nischalneupanee/kitabbid/blob/main/Models/Bid.cs): `Models/Bid.cs`
- [Live bid hub](https://github.com/nischalneupanee/kitabbid/blob/main/Hubs/AuctionHub.cs): `Hubs/AuctionHub.cs`
- [Auction closer](https://github.com/nischalneupanee/kitabbid/blob/main/Services/AuctionClosingWorker.cs): `Services/AuctionClosingWorker.cs`

### Orders and payments

- [Order and hand-off](https://github.com/nischalneupanee/kitabbid/blob/main/Controllers/OrdersController.cs): `Controllers/OrdersController.cs`
- [Order records](https://github.com/nischalneupanee/kitabbid/blob/main/Models/Order.cs): `Models/Order.cs`
- [eSewa gateway](https://github.com/nischalneupanee/kitabbid/blob/main/Services/EsewaService.cs): `Services/EsewaService.cs`
- [Khalti gateway](https://github.com/nischalneupanee/kitabbid/blob/main/Services/KhaltiService.cs): `Services/KhaltiService.cs`
- **Payment providers**

### Persistence

- [PostgreSQL data](https://github.com/nischalneupanee/kitabbid/blob/main/Data/ApplicationDbContext.cs): `Data/ApplicationDbContext.cs`

### Other components

- **Student**

## Connections

- Student → Marketplace UI: uses (evidence: `README.md`)
- Marketplace UI → Book catalog: requests listings (evidence: `README.md`)
- Student → Account access: registers or signs in (evidence: `README.md`)
- Book catalog → PostgreSQL data: queries and saves (evidence: `Controllers/BooksController.cs`)
- Book catalog → Book listings: creates listings (evidence: `Controllers/BooksController.cs`)
- Home discovery → PostgreSQL data: queries catalog (evidence: `Controllers/HomeController.cs`)
- Account access → PostgreSQL data: uses Identity store (evidence: `Controllers/AccountController.cs`)
- Account access → Campus profile: manages profiles (evidence: `Controllers/AccountController.cs`)
- Auction actions → PostgreSQL data: reads and writes (evidence: `Controllers/AuctionController.cs`)
- Auction actions → Bids: records bids (evidence: `Controllers/AuctionController.cs`)
- Auction actions → Live bid hub: broadcasts bids (evidence: `README.md`)
- Auction closer → PostgreSQL data: closes auctions (evidence: `Services/AuctionClosingWorker.cs`)
- Auction closer → Live bid hub: notifies bidders (evidence: `README.md`)
- Order and hand-off → PostgreSQL data: reads and saves (evidence: `Controllers/OrdersController.cs`)
- Order and hand-off → Order records: creates and updates (evidence: `Controllers/OrdersController.cs`)
- Order and hand-off → eSewa gateway: signs and verifies (evidence: `Controllers/OrdersController.cs`)
- Order and hand-off → Khalti gateway: initiates and verifies (evidence: `Controllers/OrdersController.cs`)
- eSewa gateway → Payment providers: validates payments (evidence: `README.md`)
- Khalti gateway → Payment providers: verifies payments (evidence: `README.md`)
- Student → Order and hand-off: checks out and confirms hand-off (evidence: `README.md`)
- Marketplace UI → Live bid hub: receives live updates (evidence: `README.md`)
