# israsaiid/labb2-ds architecture

> Architecture diagram of the GitHub repository israsaiid/labb2-ds, 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/israsaiid/labb2-ds
- Repository: https://github.com/israsaiid/labb2-ds

## Overview

AuctionLab is an authenticated auction web application. Users register or sign in, browse active auctions and details, create auctions, edit their own descriptions, place bids, and view auctions they bid on or won. The MVC controller coordinates requests and identity lookups; the auction service enforces bidding and ownership rules, while a repository persists auctions and bids. Identity uses a separate store from auction data. The graph reflects the shown controller, service, repository, and registration code; views and some Identity behavior are documented or represented only by the tree.

Main entry points: [`AuctionLab.Web/Program.cs`](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Program.cs) (Application startup), [`AuctionLab.Web/Controllers/AuctionController.cs`](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Controllers/AuctionController.cs) (Auction controller), [`AuctionLab.Web/Persistence/Contexts/AuctionDbContext.cs`](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Persistence/Contexts/AuctionDbContext.cs) (Auction database context), [`AuctionLab.Web/BusinessLogic/Services/AuctionService.cs`](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Services/AuctionService.cs) (Auction service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Web presentation"]
  node_controller["Auction controller"]
  node_viewmodels["Auction view models<br/>[Models]"]
end

subgraph group_business["Auction domain"]
  node_auction["Auction entity<br/>[Auction.cs]"]
  node_bid["Bid entity<br/>[Bid.cs]"]
  node_serviceinterface["Auction service contract<br/>[IAuctionService.cs]"]
  node_datainterface["Auction data contract<br/>[IAuctionData.cs]"]
  node_service["Auction service<br/>[AuctionService.cs]"]
end

subgraph group_persistence["Data persistence"]
  node_repository["Auction repository<br/>[AuctionData.cs]"]
  node_auctiondb[("Auction database context")]
end

subgraph group_identity["Identity"]
  node_identitypages["Identity pages<br/>[Account]"]
  node_identitycontext[("Identity database context")]
  node_identityservice["ASP.NET Identity"]
end

node_visitor(("User"))
node_startup["Application startup<br/>[Program.cs]"]

node_visitor -->|"uses auctions"| node_controller
node_visitor -->|"registers and signs in"| node_identitypages
node_controller -->|"requests auction operations"| node_serviceinterface
node_controller -->|"maps request and response data"| node_viewmodels
node_controller -->|"looks up users"| node_identityservice
node_service -->|"requests persistence"| node_datainterface
node_service -->|"checks auction rules"| node_auction
node_service -->|"creates bids"| node_bid
node_repository -->|"queries and saves"| node_auctiondb
node_auctiondb -->|"stores auctions"| node_auction
node_auctiondb -->|"stores bids"| node_bid
node_startup -->|"registers implementation"| node_serviceinterface
node_startup -->|"registers implementation"| node_datainterface
node_startup -->|"configures SQLite context"| node_auctiondb
node_startup -->|"configures SQLite context"| node_identitycontext
node_startup -->|"configures Identity store"| node_identityservice
node_identityservice -->|"stores identity data"| node_identitycontext
node_visitor -.->|"manages account"| node_identitypages

click node_controller "https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Controllers/AuctionController.cs"
click node_viewmodels "https://github.com/israsaiid/labb2-ds/tree/master/AuctionLab.Web/Models"
click node_auction "https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Auction.cs"
click node_bid "https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Bid.cs"
click node_serviceinterface "https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Interfaces/IAuctionService.cs"
click node_datainterface "https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Interfaces/IAuctionData.cs"
click node_service "https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Services/AuctionService.cs"
click node_repository "https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Persistence/Repositories/AuctionData.cs"
click node_auctiondb "https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Persistence/Contexts/AuctionDbContext.cs"
click node_identitypages "https://github.com/israsaiid/labb2-ds/tree/master/AuctionLab.Web/Areas/Identity/Pages/Account"
click node_identitycontext "https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Persistence/Contexts/UserIdentityContext.cs"
click node_startup "https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Program.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_controller,node_viewmodels,node_visitor toneBlue
class node_auction,node_bid,node_serviceinterface,node_datainterface,node_service toneAmber
class node_repository,node_auctiondb toneMint
class node_identitypages,node_identitycontext,node_identityservice toneRose
class node_startup toneTeal
```

## Components

### Web presentation

- [Auction controller](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Controllers/AuctionController.cs): `AuctionLab.Web/Controllers/AuctionController.cs`
- [Auction view models](https://github.com/israsaiid/labb2-ds/tree/master/AuctionLab.Web/Models): `AuctionLab.Web/Models`

### Auction domain

- [Auction entity](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Auction.cs): `AuctionLab.Web/BusinessLogic/Auction.cs`
- [Bid entity](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Bid.cs): `AuctionLab.Web/BusinessLogic/Bid.cs`
- [Auction service contract](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Interfaces/IAuctionService.cs): `AuctionLab.Web/BusinessLogic/Interfaces/IAuctionService.cs`
- [Auction data contract](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Interfaces/IAuctionData.cs): `AuctionLab.Web/BusinessLogic/Interfaces/IAuctionData.cs`
- [Auction service](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/BusinessLogic/Services/AuctionService.cs): `AuctionLab.Web/BusinessLogic/Services/AuctionService.cs`

### Data persistence

- [Auction repository](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Persistence/Repositories/AuctionData.cs): `AuctionLab.Web/Persistence/Repositories/AuctionData.cs`
- [Auction database context](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Persistence/Contexts/AuctionDbContext.cs): `AuctionLab.Web/Persistence/Contexts/AuctionDbContext.cs`

### Identity

- [Identity pages](https://github.com/israsaiid/labb2-ds/tree/master/AuctionLab.Web/Areas/Identity/Pages/Account): `AuctionLab.Web/Areas/Identity/Pages/Account`
- [Identity database context](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Persistence/Contexts/UserIdentityContext.cs): `AuctionLab.Web/Persistence/Contexts/UserIdentityContext.cs`
- **ASP.NET Identity**

### Other components

- **User**
- [Application startup](https://github.com/israsaiid/labb2-ds/blob/master/AuctionLab.Web/Program.cs): `AuctionLab.Web/Program.cs`

## Connections

- User → Auction controller: uses auctions
- User → Identity pages: registers and signs in
- Auction controller → Auction service contract: requests auction operations (evidence: `AuctionLab.Web/Controllers/AuctionController.cs`)
- Auction controller → Auction view models: maps request and response data (evidence: `AuctionLab.Web/Controllers/AuctionController.cs`)
- Auction controller → ASP.NET Identity: looks up users (evidence: `AuctionLab.Web/Controllers/AuctionController.cs`)
- Auction service → Auction data contract: requests persistence (evidence: `AuctionLab.Web/BusinessLogic/Services/AuctionService.cs`)
- Auction service → Auction entity: checks auction rules (evidence: `AuctionLab.Web/BusinessLogic/Services/AuctionService.cs`)
- Auction service → Bid entity: creates bids (evidence: `AuctionLab.Web/BusinessLogic/Services/AuctionService.cs`)
- Auction repository → Auction database context: queries and saves (evidence: `AuctionLab.Web/Persistence/Repositories/AuctionData.cs`)
- Auction database context → Auction entity: stores auctions (evidence: `AuctionLab.Web/Persistence/Contexts/AuctionDbContext.cs`)
- Auction database context → Bid entity: stores bids (evidence: `AuctionLab.Web/Persistence/Contexts/AuctionDbContext.cs`)
- Application startup → Auction service contract: registers implementation (evidence: `AuctionLab.Web/Program.cs`)
- Application startup → Auction data contract: registers implementation (evidence: `AuctionLab.Web/Program.cs`)
- Application startup → Auction database context: configures SQLite context (evidence: `AuctionLab.Web/Program.cs`)
- Application startup → Identity database context: configures SQLite context (evidence: `AuctionLab.Web/Program.cs`)
- Application startup → ASP.NET Identity: configures Identity store (evidence: `AuctionLab.Web/Program.cs`)
- ASP.NET Identity → Identity database context: stores identity data
- User → Identity pages: manages account
