# haiz3/cs2tracker architecture

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

- Interactive diagram: https://gitdiagram.com/haiz3/cs2tracker
- Repository: https://github.com/haiz3/cs2tracker

## Overview

CS2 Tracker is a CS2 skin-trading ledger: users register, create arbitrage or investment sheets, record purchases, monitor YouPin/CSFloat asking prices, and close sales to assess profit and holding time. The MVC app is the documented primary experience; a separately runnable JWT API exposes account, sheet, and entry operations. Core services enforce trade rules, compute sheet display metrics, and retrieve cached marketplace prices; SQL Server persists identity and trading records. Edges are limited to relationships explicit in README or shown excerpts/index references; unsampled dashboard, account, and MVC wiring is represented cautiously.

Main entry points: [`CS2Tracker_Core/Services/EntryService.cs`](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/EntryService.cs) (Entry service), [`CS2Tracker_Core/Services/SheetService.cs`](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/SheetService.cs) (Sheet service), [`CS2Tracker_Data/Context/CS2TrackerContext.cs`](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Data/Context/CS2TrackerContext.cs) (EF data context), [`CS2Tracker_Api/Program.cs`](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Program.cs) (Web API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interfaces"]
  node_mvc["MVC web app<br/>[Program.cs]"]
  node_mvcaccounts["Web accounts"]
  node_mvcsheets["Sheet pages"]
  node_mvcentries["Entry pages"]
  node_dashboard["Dashboard"]
end

subgraph group_trade["Trading workflow"]
  node_sheets["Sheet service<br/>[SheetService.cs]"]
  node_entries["Entry service<br/>[EntryService.cs]"]
  node_prices["Marketplace prices"]
  node_entryinterface["Entry service contract<br/>[IEntryService.cs]"]
  node_priceinterface["Price service contract"]
  node_sheetinterface["Sheet service contract<br/>[ISheetService.cs]"]
end

subgraph group_identity["Accounts and API"]
  node_api["Web API<br/>[Program.cs]"]
  node_apientries["Entry endpoints"]
  node_apisheets["Sheet endpoints"]
  node_apiusers["User endpoints<br/>[UsersController.cs]"]
  node_tokens["JWT tokens<br/>[TokenService.cs]"]
  node_users["User service<br/>[UserService.cs]"]
  node_userinterface["User service contract<br/>[IUserService.cs]"]
end

subgraph group_persistence["Persistence"]
  node_context["EF data context"]
  node_database[("SQL Server")]
end

subgraph group_shared["Shared domain"]
  node_sheetmodel["Sheet model<br/>[Sheet.cs]"]
  node_entrymodel["Entry model<br/>[Entry.cs]"]
  node_skininfo["Skin details<br/>[SkinInfo.cs]"]
  node_validations["Model rules"]
  node_results["Service results"]
  node_itemtypes["Item types<br/>[ItemType.cs]"]
  node_conditions["Skin conditions<br/>[SkinCondition.cs]"]
end

node_trader(("Trader"))
node_openskin["OpenSkin API"]

node_trader -->|"uses"| node_mvc
node_trader -.->|"optionally calls"| node_api
node_mvcaccounts -->|"delegates to"| node_users
node_mvcsheets -->|"delegates to"| node_sheets
node_mvcentries -->|"delegates to"| node_entries
node_dashboard -.->|"builds summary"| node_dashboard
node_api -.->|"routes"| node_apientries
node_api -.->|"routes"| node_apisheets
node_api -.->|"routes"| node_apiusers
node_apientries -->|"delegates to"| node_entries
node_apisheets -->|"delegates to"| node_sheets
node_apiusers -->|"delegates to"| node_users
node_apiusers -->|"requests tokens"| node_tokens
node_sheets -->|"loads prices"| node_prices
node_entries -->|"checks sheet"| node_sheets
node_entries -->|"loads prices"| node_prices
node_prices -->|"fetches prices"| node_openskin
node_entries -->|"reads and writes"| node_context
node_sheets -->|"reads and writes"| node_context
node_context -.->|"persists"| node_database
node_context -->|"maps entities"| node_sheetmodel
node_context -->|"maps entities"| node_entrymodel
node_context -->|"maps entities"| node_skininfo
node_entries -->|"creates details"| node_skininfo
node_skininfo -->|"classifies with"| node_itemtypes
node_entries -->|"validates variants"| node_conditions
node_entrymodel -->|"uses limits"| node_validations
node_entries -->|"creates and updates"| node_entrymodel
node_sheets -->|"creates and updates"| node_sheetmodel
node_entries -->|"returns outcomes"| node_results
node_sheets -->|"returns outcomes"| node_results
node_mvc -.->|"serves dashboard"| node_dashboard
node_entryinterface -.->|"implemented by"| node_entries
node_sheetinterface -.->|"implemented by"| node_sheets
node_priceinterface -.->|"implemented by"| node_prices
node_userinterface -.->|"implemented by"| node_users
node_api -->|"configures"| node_context
node_mvc -->|"configures"| node_context

click node_mvc "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_MVC/Program.cs"
click node_mvcaccounts "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_MVC/Controllers/AccountsController.cs"
click node_mvcsheets "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_MVC/Controllers/SheetsController.cs"
click node_mvcentries "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_MVC/Controllers/EntriesController.cs"
click node_dashboard "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/DashboardService.cs"
click node_api "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Program.cs"
click node_apientries "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Controllers/EntriesController.cs"
click node_apisheets "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Controllers/SheetsController.cs"
click node_apiusers "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Controllers/UsersController.cs"
click node_tokens "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Services/TokenService.cs"
click node_users "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/UserService.cs"
click node_sheets "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/SheetService.cs"
click node_entries "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/EntryService.cs"
click node_prices "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/MarketplacePriceService.cs"
click node_context "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Data/Context/CS2TrackerContext.cs"
click node_sheetmodel "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Models/Sheet.cs"
click node_entrymodel "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Models/Entry.cs"
click node_skininfo "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Models/SkinInfo.cs"
click node_validations "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Common/Validations/ModelValidations.cs"
click node_results "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Common/Responses/ServiceResultGeneric.cs"
click node_itemtypes "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Common/Enums/ItemType.cs"
click node_conditions "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Common/Enums/SkinCondition.cs"
click node_entryinterface "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Interfaces/IServices/IEntryService.cs"
click node_priceinterface "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Interfaces/IServices/IMarketplacePriceService.cs"
click node_sheetinterface "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Interfaces/IServices/ISheetService.cs"
click node_userinterface "https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Interfaces/IServices/IUserService.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_mvc,node_mvcaccounts,node_mvcsheets,node_mvcentries,node_dashboard toneBlue
class node_sheets,node_entries,node_prices,node_entryinterface,node_priceinterface,node_sheetinterface toneAmber
class node_api,node_apientries,node_apisheets,node_apiusers,node_tokens,node_users,node_userinterface,node_openskin toneMint
class node_context,node_database toneRose
class node_sheetmodel,node_entrymodel,node_skininfo,node_validations,node_results,node_itemtypes,node_conditions,node_trader toneIndigo
```

## Components

### User interfaces

- [MVC web app](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_MVC/Program.cs): `CS2Tracker_MVC/Program.cs`
- [Web accounts](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_MVC/Controllers/AccountsController.cs): `CS2Tracker_MVC/Controllers/AccountsController.cs`
- [Sheet pages](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_MVC/Controllers/SheetsController.cs): `CS2Tracker_MVC/Controllers/SheetsController.cs`
- [Entry pages](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_MVC/Controllers/EntriesController.cs): `CS2Tracker_MVC/Controllers/EntriesController.cs`
- [Dashboard](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/DashboardService.cs): `CS2Tracker_Core/Services/DashboardService.cs`

### Trading workflow

- [Sheet service](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/SheetService.cs): `CS2Tracker_Core/Services/SheetService.cs`
- [Entry service](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/EntryService.cs): `CS2Tracker_Core/Services/EntryService.cs`
- [Marketplace prices](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/MarketplacePriceService.cs): `CS2Tracker_Core/Services/MarketplacePriceService.cs`
- [Entry service contract](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Interfaces/IServices/IEntryService.cs): `CS2Tracker_Core/Interfaces/IServices/IEntryService.cs`
- [Price service contract](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Interfaces/IServices/IMarketplacePriceService.cs): `CS2Tracker_Core/Interfaces/IServices/IMarketplacePriceService.cs`
- [Sheet service contract](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Interfaces/IServices/ISheetService.cs): `CS2Tracker_Core/Interfaces/IServices/ISheetService.cs`

### Accounts and API

- [Web API](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Program.cs): `CS2Tracker_Api/Program.cs`
- [Entry endpoints](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Controllers/EntriesController.cs): `CS2Tracker_Api/Controllers/EntriesController.cs`
- [Sheet endpoints](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Controllers/SheetsController.cs): `CS2Tracker_Api/Controllers/SheetsController.cs`
- [User endpoints](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Controllers/UsersController.cs): `CS2Tracker_Api/Controllers/UsersController.cs`
- [JWT tokens](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Api/Services/TokenService.cs): `CS2Tracker_Api/Services/TokenService.cs`
- [User service](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Services/UserService.cs): `CS2Tracker_Core/Services/UserService.cs`
- [User service contract](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Core/Interfaces/IServices/IUserService.cs): `CS2Tracker_Core/Interfaces/IServices/IUserService.cs`

### Persistence

- [EF data context](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Data/Context/CS2TrackerContext.cs): `CS2Tracker_Data/Context/CS2TrackerContext.cs`
- **SQL Server**

### Shared domain

- [Sheet model](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Models/Sheet.cs): `CS2Tracker_Models/Sheet.cs`
- [Entry model](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Models/Entry.cs): `CS2Tracker_Models/Entry.cs`
- [Skin details](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Models/SkinInfo.cs): `CS2Tracker_Models/SkinInfo.cs`
- [Model rules](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Common/Validations/ModelValidations.cs): `CS2Tracker_Common/Validations/ModelValidations.cs`
- [Service results](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Common/Responses/ServiceResultGeneric.cs): `CS2Tracker_Common/Responses/ServiceResultGeneric.cs`
- [Item types](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Common/Enums/ItemType.cs): `CS2Tracker_Common/Enums/ItemType.cs`
- [Skin conditions](https://github.com/haiz3/cs2tracker/blob/Main-MVC-Api/CS2Tracker_Common/Enums/SkinCondition.cs): `CS2Tracker_Common/Enums/SkinCondition.cs`

### Other components

- **Trader**
- **OpenSkin API**

## Connections

- Trader → MVC web app: uses
- Trader → Web API: optionally calls
- Web accounts → User service: delegates to (evidence: `CS2Tracker_MVC/Controllers/AccountsController.cs`)
- Sheet pages → Sheet service: delegates to (evidence: `CS2Tracker_MVC/Controllers/SheetsController.cs`)
- Entry pages → Entry service: delegates to (evidence: `CS2Tracker_MVC/Controllers/EntriesController.cs`)
- Dashboard → Dashboard: builds summary
- Web API → Entry endpoints: routes
- Web API → Sheet endpoints: routes
- Web API → User endpoints: routes
- Entry endpoints → Entry service: delegates to (evidence: `CS2Tracker_Api/Controllers/EntriesController.cs`)
- Sheet endpoints → Sheet service: delegates to (evidence: `CS2Tracker_Api/Controllers/SheetsController.cs`)
- User endpoints → User service: delegates to (evidence: `CS2Tracker_Api/Controllers/UsersController.cs`)
- User endpoints → JWT tokens: requests tokens (evidence: `CS2Tracker_Api/Controllers/UsersController.cs`)
- Sheet service → Marketplace prices: loads prices (evidence: `CS2Tracker_Core/Services/SheetService.cs`)
- Entry service → Sheet service: checks sheet (evidence: `CS2Tracker_Core/Services/EntryService.cs`)
- Entry service → Marketplace prices: loads prices (evidence: `CS2Tracker_Core/Services/EntryService.cs`)
- Marketplace prices → OpenSkin API: fetches prices (evidence: `CS2Tracker_Core/Services/MarketplacePriceService.cs`)
- Entry service → EF data context: reads and writes (evidence: `CS2Tracker_Core/Services/EntryService.cs`)
- Sheet service → EF data context: reads and writes (evidence: `CS2Tracker_Core/Services/SheetService.cs`)
- EF data context → SQL Server: persists
- EF data context → Sheet model: maps entities (evidence: `CS2Tracker_Data/Context/CS2TrackerContext.cs`)
- EF data context → Entry model: maps entities (evidence: `CS2Tracker_Data/Context/CS2TrackerContext.cs`)
- EF data context → Skin details: maps entities (evidence: `CS2Tracker_Data/Context/CS2TrackerContext.cs`)
- Entry service → Skin details: creates details (evidence: `CS2Tracker_Core/Services/EntryService.cs`)
- Skin details → Item types: classifies with (evidence: `CS2Tracker_Models/SkinInfo.cs`)
- Entry service → Skin conditions: validates variants (evidence: `CS2Tracker_Core/Services/EntryService.cs`)
- Entry model → Model rules: uses limits (evidence: `CS2Tracker_Models/Entry.cs`)
- Entry service → Entry model: creates and updates (evidence: `CS2Tracker_Core/Services/EntryService.cs`)
- Sheet service → Sheet model: creates and updates (evidence: `CS2Tracker_Core/Services/SheetService.cs`)
- Entry service → Service results: returns outcomes (evidence: `CS2Tracker_Core/Services/EntryService.cs`)
- Sheet service → Service results: returns outcomes (evidence: `CS2Tracker_Core/Services/SheetService.cs`)
- MVC web app → Dashboard: serves dashboard (evidence: `CS2Tracker_MVC/Program.cs`)
- Entry service contract → Entry service: implemented by (evidence: `CS2Tracker_Core/Services/EntryService.cs`)
- Sheet service contract → Sheet service: implemented by (evidence: `CS2Tracker_Core/Services/SheetService.cs`)
- Price service contract → Marketplace prices: implemented by (evidence: `CS2Tracker_Core/Services/MarketplacePriceService.cs`)
- User service contract → User service: implemented by
- Web API → EF data context: configures (evidence: `CS2Tracker_Api/Program.cs`)
- MVC web app → EF data context: configures (evidence: `CS2Tracker_MVC/Program.cs`)
