# sardorj/labb2-dotnet architecture

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

- Interactive diagram: https://gitdiagram.com/sardorj/labb2-dotnet
- Repository: https://github.com/sardorj/labb2-dotnet

## Overview

This is an ASP.NET MVC auction application: signed-in users create auctions, inspect ongoing listings, edit their own listings, place bids, and review bids or wins; administrators manage users and auctions. Controllers coordinate the auction service, which applies domain rules and delegates persistence to a MySQL-backed implementation. Identity and auction data use separate contexts. The graph preserves these product areas and the documented-by-code wiring; the README provides no capability detail, and unsampled views and identity internals are represented conservatively.

Main entry points: [`labb2-dotnet/Controllers/AuctionsController.cs`](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Controllers/AuctionsController.cs) (Auction actions), [`labb2-dotnet/Controllers/AdminController.cs`](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Controllers/AdminController.cs) (Admin actions), [`labb2-dotnet/Core/AuctionService.cs`](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Core/AuctionService.cs) (Auction service), [`labb2-dotnet/Persistence/MySqlAuctionPersistence.cs`](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Persistence/MySqlAuctionPersistence.cs) (MySQL persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_auction_controller["Auction actions"]
  node_admin_controller["Admin actions<br/>[AdminController.cs]"]
  node_auction_views["Auction views"]
  node_admin_views["Admin views"]
  node_viewmodels["Auction view models"]
end

subgraph group_auction["Auction domain"]
  node_service["Auction service<br/>[AuctionService.cs]"]
  node_auction["Auction rules<br/>[Auction.cs]"]
  node_bid["Bid record<br/>[Bid.cs]"]
end

subgraph group_storage["Persistence"]
  node_auction_persistence["Persistence contract"]
  node_mysql_persistence["MySQL persistence"]
  node_repository["Entity repository<br/>[Repository.cs]"]
  node_auction_db[("Auction database")]
end

subgraph group_identity["Identity and admin"]
  node_identity_pages["Account pages<br/>[Register.cshtml.cs]"]
  node_identity_context[("Identity database")]
  node_admin_seed["Admin seeding<br/>[AdminDbSeed.cs]"]
end

node_user(("Signed-in user"))
node_admin(("Administrator"))

node_user -->|"requests auctions"| node_auction_controller
node_admin -->|"manages users"| node_admin_controller
node_auction_controller -->|"calls"| node_service
node_admin_controller -->|"calls"| node_service
node_auction_controller -->|"returns views"| node_auction_views
node_admin_controller -->|"returns views"| node_admin_views
node_auction_controller -->|"maps auction data"| node_viewmodels
node_service -->|"uses contract"| node_auction_persistence
node_service -->|"applies rules"| node_auction
node_auction -->|"creates bids"| node_bid
node_mysql_persistence -->|"implements"| node_auction_persistence
node_mysql_persistence -->|"uses"| node_repository
node_repository -->|"queries and saves"| node_auction_db
node_user -->|"signs in or registers"| node_identity_pages
node_admin_seed -.->|"seeds roles"| node_identity_context
node_admin_controller -.->|"uses user identity"| node_identity_pages

click node_auction_controller "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Controllers/AuctionsController.cs"
click node_admin_controller "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Controllers/AdminController.cs"
click node_auction_views "https://github.com/sardorj/labb2-dotnet/tree/main/labb2-dotnet/Views/Auctions"
click node_admin_views "https://github.com/sardorj/labb2-dotnet/tree/main/labb2-dotnet/Views/Admin"
click node_viewmodels "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Models/AuctionDetailsVm.cs"
click node_service "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Core/AuctionService.cs"
click node_auction "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Core/Auction.cs"
click node_bid "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Core/Bid.cs"
click node_auction_persistence "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Core/Interfaces/IAuctionPersistence.cs"
click node_mysql_persistence "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Persistence/MySqlAuctionPersistence.cs"
click node_repository "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Persistence/Repository.cs"
click node_auction_db "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Persistence/AuctionDbContext.cs"
click node_identity_pages "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Areas/Identity/Pages/Account/Register.cshtml.cs"
click node_identity_context "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Identity/AppIdentityDbContext.cs"
click node_admin_seed "https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Identity/AdminDbSeed.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_auction_controller,node_admin_controller,node_auction_views,node_admin_views,node_viewmodels,node_user toneBlue
class node_service,node_auction,node_bid toneAmber
class node_auction_persistence,node_mysql_persistence,node_repository,node_auction_db toneMint
class node_identity_pages,node_identity_context,node_admin_seed toneRose
class node_admin toneIndigo
```

## Components

### Web experience

- [Auction actions](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Controllers/AuctionsController.cs): `labb2-dotnet/Controllers/AuctionsController.cs`
- [Admin actions](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Controllers/AdminController.cs): `labb2-dotnet/Controllers/AdminController.cs`
- [Auction views](https://github.com/sardorj/labb2-dotnet/tree/main/labb2-dotnet/Views/Auctions): `labb2-dotnet/Views/Auctions`
- [Admin views](https://github.com/sardorj/labb2-dotnet/tree/main/labb2-dotnet/Views/Admin): `labb2-dotnet/Views/Admin`
- [Auction view models](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Models/AuctionDetailsVm.cs): `labb2-dotnet/Models/AuctionDetailsVm.cs`

### Auction domain

- [Auction service](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Core/AuctionService.cs): `labb2-dotnet/Core/AuctionService.cs`
- [Auction rules](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Core/Auction.cs): `labb2-dotnet/Core/Auction.cs`
- [Bid record](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Core/Bid.cs): `labb2-dotnet/Core/Bid.cs`

### Persistence

- [Persistence contract](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Core/Interfaces/IAuctionPersistence.cs): `labb2-dotnet/Core/Interfaces/IAuctionPersistence.cs`
- [MySQL persistence](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Persistence/MySqlAuctionPersistence.cs): `labb2-dotnet/Persistence/MySqlAuctionPersistence.cs`
- [Entity repository](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Persistence/Repository.cs): `labb2-dotnet/Persistence/Repository.cs`
- [Auction database](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Persistence/AuctionDbContext.cs): `labb2-dotnet/Persistence/AuctionDbContext.cs`

### Identity and admin

- [Account pages](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Areas/Identity/Pages/Account/Register.cshtml.cs): `labb2-dotnet/Areas/Identity/Pages/Account/Register.cshtml.cs`
- [Identity database](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Identity/AppIdentityDbContext.cs): `labb2-dotnet/Identity/AppIdentityDbContext.cs`
- [Admin seeding](https://github.com/sardorj/labb2-dotnet/blob/main/labb2-dotnet/Identity/AdminDbSeed.cs): `labb2-dotnet/Identity/AdminDbSeed.cs`

### Other components

- **Signed-in user**
- **Administrator**

## Connections

- Signed-in user → Auction actions: requests auctions
- Administrator → Admin actions: manages users (evidence: `labb2-dotnet/Controllers/AdminController.cs`)
- Auction actions → Auction service: calls (evidence: `labb2-dotnet/Controllers/AuctionsController.cs`)
- Admin actions → Auction service: calls (evidence: `labb2-dotnet/Controllers/AdminController.cs`)
- Auction actions → Auction views: returns views (evidence: `labb2-dotnet/Controllers/AuctionsController.cs`)
- Admin actions → Admin views: returns views (evidence: `labb2-dotnet/Controllers/AdminController.cs`)
- Auction actions → Auction view models: maps auction data (evidence: `labb2-dotnet/Controllers/AuctionsController.cs`)
- Auction service → Persistence contract: uses contract (evidence: `labb2-dotnet/Core/AuctionService.cs`)
- Auction service → Auction rules: applies rules (evidence: `labb2-dotnet/Core/AuctionService.cs`)
- Auction rules → Bid record: creates bids (evidence: `labb2-dotnet/Core/Auction.cs`)
- MySQL persistence → Persistence contract: implements (evidence: `labb2-dotnet/Persistence/MySqlAuctionPersistence.cs`)
- MySQL persistence → Entity repository: uses (evidence: `labb2-dotnet/Persistence/MySqlAuctionPersistence.cs`)
- Entity repository → Auction database: queries and saves (evidence: `labb2-dotnet/Persistence/Repository.cs`)
- Signed-in user → Account pages: signs in or registers
- Admin seeding → Identity database: seeds roles
- Admin actions → Account pages: uses user identity
