# 2003-anonymous/lernperiode-12 architecture

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

- Interactive diagram: https://gitdiagram.com/2003-anonymous/lernperiode-12
- Repository: https://github.com/2003-anonymous/lernperiode-12

## Overview

This repository is a browser-based casino with an ASP.NET Core account API. Players browse games, register or sign in, and play frontend-driven games; account endpoints manage sessions and balances. The README describes roulette, slot machines, Mines, and scratch cards, while the tree also contains Pharaoh and Wild West games. Backend wiring is shown in sampled files; frontend-to-API balance updates are documented generally, but game-specific calls are not verified in the excerpts.

Main entry points: [`LP-12_API/Controllers/AccountController.cs`](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Controllers/AccountController.cs) (Account endpoints), [`LP-12_API/Models/CasinoContext.cs`](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Models/CasinoContext.cs) (Casino context), [`LP-12_API/Program.cs`](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Program.cs) (Static site host), [`LP-12_API/wwwroot/assets/login.js`](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/assets/login.js) (Login and registration UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Casino web"]
  node_site["Static site host<br/>[Program.cs]"]
  node_home["Home and age gate<br/>[home.js]"]
  node_login["Login and registration UI<br/>[login.js]"]
  node_balanceui["Balance UI<br/>[balance.js]"]
end

subgraph group_games["Casino games"]
  node_roulette["Roulette<br/>[roulette.html]"]
  node_slots["Slot games<br/>[pharaoh.js]"]
  node_mines["Mines<br/>[mines.js]"]
  node_scratch["Scratch cards<br/>[rubbellos.js]"]
  node_wildwest["Wild West<br/>[wildwest.js]"]
end

subgraph group_accounts["Accounts API"]
  node_accountapi["Account endpoints"]
  node_passwords["Password hashing<br/>[Password.cs]"]
end

subgraph group_data["Account data"]
  node_accountmodel["Account model<br/>[Account.cs]"]
  node_dtos["Request and response DTOs<br/>[Dtos.cs]"]
  node_context[("Casino context<br/>[CasinoContext.cs]")]
  node_seed["Seeded accounts"]
end

node_player(("Player"))
node_sql[("SQL Server")]

node_player -->|"opens"| node_site
node_site -->|"serves"| node_home
node_player -.->|"uses"| node_login
node_login -.->|"authenticates"| node_accountapi
node_player -->|"plays"| node_roulette
node_player -->|"plays"| node_slots
node_player -->|"plays"| node_mines
node_player -->|"plays"| node_scratch
node_player -.->|"plays"| node_wildwest
node_player -.->|"checks balance"| node_balanceui
node_roulette -.->|"saves results"| node_accountapi
node_slots -.->|"saves results"| node_accountapi
node_mines -.->|"saves results"| node_accountapi
node_scratch -.->|"saves results"| node_accountapi
node_accountapi -->|"hashes and verifies"| node_passwords
node_accountapi -->|"reads and writes"| node_context
node_context -->|"stores"| node_accountmodel
node_context -->|"seeds"| node_seed
node_accountapi -.->|"uses"| node_dtos
node_site -->|"configures"| node_context
node_context -->|"persists to"| node_sql

click node_site "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Program.cs"
click node_home "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/home.js"
click node_login "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/assets/login.js"
click node_balanceui "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/assets/balance.js"
click node_roulette "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/roulette.html"
click node_slots "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/pharaoh.js"
click node_mines "https://github.com/2003-anonymous/lernperiode-12/blob/main/mines.js"
click node_scratch "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/rubbellos.js"
click node_wildwest "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/wildwest.js"
click node_accountapi "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Controllers/AccountController.cs"
click node_passwords "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Services/Password.cs"
click node_accountmodel "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Models/Account.cs"
click node_dtos "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Models/Dtos.cs"
click node_context "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Models/CasinoContext.cs"
click node_seed "https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Models/ModelBuilderExtensions.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_site,node_home,node_login,node_balanceui toneBlue
class node_roulette,node_slots,node_mines,node_scratch,node_wildwest,node_sql toneAmber
class node_accountapi,node_passwords toneMint
class node_accountmodel,node_dtos,node_context,node_seed toneRose
class node_player toneIndigo
```

## Components

### Casino web

- [Static site host](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Program.cs): `LP-12_API/Program.cs`
- [Home and age gate](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/home.js): `LP-12_API/wwwroot/home.js`
- [Login and registration UI](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/assets/login.js): `LP-12_API/wwwroot/assets/login.js`
- [Balance UI](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/assets/balance.js): `LP-12_API/wwwroot/assets/balance.js`

### Casino games

- [Roulette](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/roulette.html): `LP-12_API/wwwroot/roulette.html`
- [Slot games](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/pharaoh.js): `LP-12_API/wwwroot/pharaoh.js`
- [Mines](https://github.com/2003-anonymous/lernperiode-12/blob/main/mines.js): `mines.js`
- [Scratch cards](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/rubbellos.js): `LP-12_API/wwwroot/rubbellos.js`
- [Wild West](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/wwwroot/wildwest.js): `LP-12_API/wwwroot/wildwest.js`

### Accounts API

- [Account endpoints](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Controllers/AccountController.cs): `LP-12_API/Controllers/AccountController.cs`
- [Password hashing](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Services/Password.cs): `LP-12_API/Services/Password.cs`

### Account data

- [Account model](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Models/Account.cs): `LP-12_API/Models/Account.cs`
- [Request and response DTOs](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Models/Dtos.cs): `LP-12_API/Models/Dtos.cs`
- [Casino context](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Models/CasinoContext.cs): `LP-12_API/Models/CasinoContext.cs`
- [Seeded accounts](https://github.com/2003-anonymous/lernperiode-12/blob/main/LP-12_API/Models/ModelBuilderExtensions.cs): `LP-12_API/Models/ModelBuilderExtensions.cs`

### Other components

- **Player**
- **SQL Server**

## Connections

- Player → Static site host: opens (evidence: `LP-12_API/Program.cs`)
- Static site host → Home and age gate: serves (evidence: `LP-12_API/Program.cs`)
- Player → Login and registration UI: uses (evidence: `readme.md`)
- Login and registration UI → Account endpoints: authenticates (evidence: `readme.md`)
- Player → Roulette: plays (evidence: `readme.md`)
- Player → Slot games: plays (evidence: `readme.md`)
- Player → Mines: plays (evidence: `readme.md`)
- Player → Scratch cards: plays (evidence: `readme.md`)
- Player → Wild West: plays
- Player → Balance UI: checks balance
- Roulette → Account endpoints: saves results (evidence: `readme.md`)
- Slot games → Account endpoints: saves results (evidence: `readme.md`)
- Mines → Account endpoints: saves results (evidence: `readme.md`)
- Scratch cards → Account endpoints: saves results (evidence: `readme.md`)
- Account endpoints → Password hashing: hashes and verifies (evidence: `LP-12_API/Controllers/AccountController.cs`)
- Account endpoints → Casino context: reads and writes (evidence: `LP-12_API/Controllers/AccountController.cs`)
- Casino context → Account model: stores (evidence: `LP-12_API/Models/CasinoContext.cs`)
- Casino context → Seeded accounts: seeds (evidence: `LP-12_API/Models/CasinoContext.cs`)
- Account endpoints → Request and response DTOs: uses
- Static site host → Casino context: configures (evidence: `LP-12_API/Program.cs`)
- Casino context → SQL Server: persists to
