# marcisebestyen/cryptosimulator architecture

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

- Interactive diagram: https://gitdiagram.com/marcisebestyen/cryptosimulator
- Repository: https://github.com/marcisebestyen/cryptosimulator

## Overview

CryptoSimulator is a browser-based cryptocurrency exchange simulator backed by an ASP.NET Core API and PostgreSQL. The principal workflow is an authenticated user browsing crypto prices, trading directly or through P2P offers, and reviewing holdings and transaction history; deposits and account recovery are separate branches. The graph preserves documented capabilities whose implementation excerpts were not provided, but their internal calls are left unconnected. The sampled trade and offer code confirms controller-to-service and service-to-repository flow; other backend links are documented at the API level only.

Main entry points: [`CryptoSimulator/CryptoSimulator/Repositories/UnitOfWork.cs`](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Repositories/UnitOfWork.cs) (Unit of work), [`frontend/src/App.tsx`](https://github.com/marcisebestyen/cryptosimulator/blob/main/frontend/src/App.tsx) (Web routes), [`frontend/src/api/client.ts`](https://github.com/marcisebestyen/cryptosimulator/blob/main/frontend/src/api/client.ts) (HTTP client), [`CryptoSimulator/CryptoSimulator/Controllers/TradeController.cs`](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/TradeController.cs) (Trade API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Web routes<br/>[App.tsx]"]
  node_authui["Sign-in and recovery"]
  node_marketui["Crypto and market views"]
  node_tradeui["Trading and offers"]
  node_accountui["Deposit and profile"]
  node_apiclient["HTTP client<br/>[client.ts]"]
end

subgraph group_api["API and identity"]
  node_userapi["Account API<br/>[UserController.cs]"]
  node_cryptoapi["Crypto API"]
  node_tradeapi["Trade API<br/>[TradeController.cs]"]
  node_alertapi["Price alerts API"]
  node_depositapi["Deposit API"]
  node_walletapi["Wallet API"]
  node_authsvc["Identity services"]
end

subgraph group_exchange["Exchange capabilities"]
  node_price["Prices and history<br/>[CryptoService.cs]"]
  node_simulator["Price simulation"]
  node_spottrade["Spot trading and portfolio<br/>[TradeService.cs]"]
  node_offers["P2P offers<br/>[OfferService.cs]"]
  node_transactions["Transaction history"]
  node_alerts["Alert evaluation"]
  node_deposits["Deposits and cards<br/>[DepositService.cs]"]
end

subgraph group_persistence["Persistence"]
  node_dataaccess["Unit of work<br/>[UnitOfWork.cs]"]
  node_database[("PostgreSQL")]
end

node_user(("Exchange user"))

node_user -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_authui
node_webapp -->|"routes to"| node_marketui
node_webapp -->|"routes to"| node_tradeui
node_webapp -->|"routes to"| node_accountui
node_marketui -.->|"requests data"| node_apiclient
node_tradeui -.->|"submits trades"| node_apiclient
node_accountui -.->|"requests account data"| node_apiclient
node_authui -.->|"requests identity"| node_apiclient
node_userapi -.->|"handles identity"| node_authsvc
node_cryptoapi -.->|"serves prices"| node_price
node_tradeapi -->|"executes trades"| node_spottrade
node_tradeapi -->|"reads portfolio"| node_spottrade
node_tradeapi -->|"dispatches offers"| node_offers
node_alertapi -.->|"manages alerts"| node_alerts
node_depositapi -.->|"records deposits"| node_deposits
node_walletapi -.->|"manages wallets"| node_dataaccess
node_simulator -.->|"updates prices"| node_price
node_spottrade -->|"reads and writes"| node_dataaccess
node_offers -->|"reads and writes"| node_dataaccess
node_transactions -.->|"reads history"| node_dataaccess
node_alerts -.->|"reads and writes"| node_dataaccess
node_deposits -.->|"reads and writes"| node_dataaccess
node_dataaccess -.->|"persists records"| node_database

click node_webapp "https://github.com/marcisebestyen/cryptosimulator/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/marcisebestyen/cryptosimulator/tree/main/frontend/src/pages"
click node_marketui "https://github.com/marcisebestyen/cryptosimulator/tree/main/frontend/src/pages"
click node_tradeui "https://github.com/marcisebestyen/cryptosimulator/tree/main/frontend/src/pages"
click node_accountui "https://github.com/marcisebestyen/cryptosimulator/tree/main/frontend/src/pages"
click node_apiclient "https://github.com/marcisebestyen/cryptosimulator/blob/main/frontend/src/api/client.ts"
click node_userapi "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/UserController.cs"
click node_cryptoapi "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/CryptoController.cs"
click node_tradeapi "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/TradeController.cs"
click node_alertapi "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/AlertsController.cs"
click node_depositapi "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/DepositController.cs"
click node_walletapi "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/WalletController.cs"
click node_authsvc "https://github.com/marcisebestyen/cryptosimulator/tree/main/CryptoSimulator/CryptoSimulator/Services"
click node_price "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/CryptoService.cs"
click node_simulator "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/PriceUpdateService.cs"
click node_spottrade "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/TradeService.cs"
click node_offers "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/OfferService.cs"
click node_transactions "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/TransactionService.cs"
click node_alerts "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/PriceAlertService.cs"
click node_deposits "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/DepositService.cs"
click node_dataaccess "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Repositories/UnitOfWork.cs"
click node_database "https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Data/CryptoSimulationDbContext.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_webapp,node_authui,node_marketui,node_tradeui,node_accountui,node_apiclient,node_user toneBlue
class node_userapi,node_cryptoapi,node_tradeapi,node_alertapi,node_depositapi,node_walletapi,node_authsvc toneAmber
class node_price,node_simulator,node_spottrade,node_offers,node_transactions,node_alerts,node_deposits toneMint
class node_dataaccess,node_database toneRose
```

## Components

### Web application

- [Web routes](https://github.com/marcisebestyen/cryptosimulator/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Sign-in and recovery](https://github.com/marcisebestyen/cryptosimulator/tree/main/frontend/src/pages): `frontend/src/pages`
- [Crypto and market views](https://github.com/marcisebestyen/cryptosimulator/tree/main/frontend/src/pages): `frontend/src/pages`
- [Trading and offers](https://github.com/marcisebestyen/cryptosimulator/tree/main/frontend/src/pages): `frontend/src/pages`
- [Deposit and profile](https://github.com/marcisebestyen/cryptosimulator/tree/main/frontend/src/pages): `frontend/src/pages`
- [HTTP client](https://github.com/marcisebestyen/cryptosimulator/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### API and identity

- [Account API](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/UserController.cs): `CryptoSimulator/CryptoSimulator/Controllers/UserController.cs`
- [Crypto API](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/CryptoController.cs): `CryptoSimulator/CryptoSimulator/Controllers/CryptoController.cs`
- [Trade API](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/TradeController.cs): `CryptoSimulator/CryptoSimulator/Controllers/TradeController.cs`
- [Price alerts API](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/AlertsController.cs): `CryptoSimulator/CryptoSimulator/Controllers/AlertsController.cs`
- [Deposit API](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/DepositController.cs): `CryptoSimulator/CryptoSimulator/Controllers/DepositController.cs`
- [Wallet API](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Controllers/WalletController.cs): `CryptoSimulator/CryptoSimulator/Controllers/WalletController.cs`
- [Identity services](https://github.com/marcisebestyen/cryptosimulator/tree/main/CryptoSimulator/CryptoSimulator/Services): `CryptoSimulator/CryptoSimulator/Services`

### Exchange capabilities

- [Prices and history](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/CryptoService.cs): `CryptoSimulator/CryptoSimulator/Services/CryptoService.cs`
- [Price simulation](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/PriceUpdateService.cs): `CryptoSimulator/CryptoSimulator/Services/PriceUpdateService.cs`
- [Spot trading and portfolio](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/TradeService.cs): `CryptoSimulator/CryptoSimulator/Services/TradeService.cs`
- [P2P offers](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/OfferService.cs): `CryptoSimulator/CryptoSimulator/Services/OfferService.cs`
- [Transaction history](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/TransactionService.cs): `CryptoSimulator/CryptoSimulator/Services/TransactionService.cs`
- [Alert evaluation](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/PriceAlertService.cs): `CryptoSimulator/CryptoSimulator/Services/PriceAlertService.cs`
- [Deposits and cards](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Services/DepositService.cs): `CryptoSimulator/CryptoSimulator/Services/DepositService.cs`

### Persistence

- [Unit of work](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Repositories/UnitOfWork.cs): `CryptoSimulator/CryptoSimulator/Repositories/UnitOfWork.cs`
- [PostgreSQL](https://github.com/marcisebestyen/cryptosimulator/blob/main/CryptoSimulator/CryptoSimulator/Data/CryptoSimulationDbContext.cs): `CryptoSimulator/CryptoSimulator/Data/CryptoSimulationDbContext.cs`

### Other components

- **Exchange user**

## Connections

- Exchange user → Web routes: uses (evidence: `frontend/src/App.tsx`)
- Web routes → Sign-in and recovery: routes to (evidence: `frontend/src/App.tsx`)
- Web routes → Crypto and market views: routes to (evidence: `frontend/src/App.tsx`)
- Web routes → Trading and offers: routes to (evidence: `frontend/src/App.tsx`)
- Web routes → Deposit and profile: routes to (evidence: `frontend/src/App.tsx`)
- Crypto and market views → HTTP client: requests data
- Trading and offers → HTTP client: submits trades
- Deposit and profile → HTTP client: requests account data
- Sign-in and recovery → HTTP client: requests identity
- Account API → Identity services: handles identity (evidence: `README.md`)
- Crypto API → Prices and history: serves prices (evidence: `README.md`)
- Trade API → Spot trading and portfolio: executes trades (evidence: `CryptoSimulator/CryptoSimulator/Controllers/TradeController.cs`)
- Trade API → Spot trading and portfolio: reads portfolio (evidence: `CryptoSimulator/CryptoSimulator/Controllers/TradeController.cs`)
- Trade API → P2P offers: dispatches offers (evidence: `CryptoSimulator/CryptoSimulator/Controllers/TradeController.cs`)
- Price alerts API → Alert evaluation: manages alerts (evidence: `README.md`)
- Deposit API → Deposits and cards: records deposits (evidence: `README.md`)
- Wallet API → Unit of work: manages wallets (evidence: `README.md`)
- Price simulation → Prices and history: updates prices (evidence: `CryptoSimulator/CryptoSimulator/Program.cs`)
- Spot trading and portfolio → Unit of work: reads and writes (evidence: `CryptoSimulator/CryptoSimulator/Services/TradeService.cs`)
- P2P offers → Unit of work: reads and writes (evidence: `CryptoSimulator/CryptoSimulator/Services/OfferService.cs`)
- Transaction history → Unit of work: reads history (evidence: `README.md`)
- Alert evaluation → Unit of work: reads and writes (evidence: `README.md`)
- Deposits and cards → Unit of work: reads and writes (evidence: `README.md`)
- Unit of work → PostgreSQL: persists records (evidence: `README.md`)
