# keep-xylent/project-kartel-shop architecture

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

- Interactive diagram: https://gitdiagram.com/keep-xylent/project-kartel-shop
- Repository: https://github.com/keep-xylent/project-kartel-shop

## Overview

Kartel Shop is a C++ console app for game top-ups and member entertainment. Users register or log in, then add balance, buy Mobile Legends diamonds or PUBG UC, play mini-games, and redeem vouchers; admins manage prices, vouchers, transactions, and members. The main program dispatches these workflows, while shared state and file persistence support them. The graph follows the README and shown call sites; some subsystem behavior is documented but its full implementation was not sampled.

Main entry points: [`include/database.h`](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/database.h) (Persistent app data), [`src/main.cpp`](https://github.com/keep-xylent/project-kartel-shop/blob/main/src/main.cpp) (Application menu), [`include/model.h`](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/model.h) (Member menu), [`include/admin.h`](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h) (Admin control panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Console Entry"]
  node_main["Application menu<br/>[main.cpp]"]
  node_ui["Console presentation<br/>[utils.h]"]
end

subgraph group_members["Member Services"]
  node_member["Registration and login<br/>[model.h]"]
  node_member_menu["Member menu<br/>[model.h]"]
  node_wallet["Balance top-up<br/>[model.h]"]
  node_database[("Persistent app data<br/>[database.h]")]
end

subgraph group_commerce["Top-up Commerce"]
  node_game_choice["Game selection<br/>[model.h]"]
  node_ml["Mobile Legends top-up<br/>[modelml.h]"]
  node_pubg["PUBG Mobile top-up<br/>[modelpubg.h]"]
end

subgraph group_games["Games and Rewards"]
  node_mini_games["Mini-games menu<br/>[games.h]"]
  node_rewards["Voucher redemption<br/>[games.h]"]
end

subgraph group_admin["Administration"]
  node_admin_menu["Admin control panel<br/>[admin.h]"]
  node_prices["Price management<br/>[admin.h]"]
  node_voucher_admin["Voucher settings<br/>[admin.h]"]
  node_transactions["Transaction history<br/>[admin.h]"]
  node_members_admin["Member management<br/>[admin.h]"]
end

node_customer(("Console user"))

node_customer -->|"uses"| node_main
node_main -->|"loads data"| node_database
node_main -->|"dispatches login"| node_member
node_main -->|"dispatches registration"| node_member
node_main -->|"lists members"| node_member
node_main -->|"opens admin"| node_admin_menu
node_main -->|"opens member area"| node_member_menu
node_member -->|"saves registration"| node_database
node_member_menu -->|"dispatches top-up"| node_wallet
node_member_menu -->|"dispatches game purchase"| node_game_choice
node_member_menu -->|"opens games"| node_mini_games
node_member_menu -->|"dispatches redemption"| node_rewards
node_game_choice -->|"opens ML shop"| node_ml
node_game_choice -->|"opens PUBG shop"| node_pubg
node_ml -->|"records purchase"| node_database
node_pubg -->|"records purchase"| node_database
node_mini_games -->|"records wins"| node_database
node_rewards -->|"saves redemption"| node_database
node_admin_menu -->|"opens settings"| node_prices
node_admin_menu -->|"opens settings"| node_voucher_admin
node_admin_menu -->|"opens history"| node_transactions
node_admin_menu -->|"opens management"| node_members_admin
node_prices -->|"saves prices"| node_database
node_voucher_admin -->|"saves settings"| node_database
node_transactions -->|"reads history"| node_database
node_members_admin -->|"saves changes"| node_database

click node_main "https://github.com/keep-xylent/project-kartel-shop/blob/main/src/main.cpp"
click node_ui "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/utils.h"
click node_member "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/model.h"
click node_member_menu "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/model.h"
click node_wallet "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/model.h"
click node_database "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/database.h"
click node_game_choice "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/model.h"
click node_ml "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/modelml.h"
click node_pubg "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/modelpubg.h"
click node_mini_games "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/games.h"
click node_rewards "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/games.h"
click node_admin_menu "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h"
click node_prices "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h"
click node_voucher_admin "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h"
click node_transactions "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h"
click node_members_admin "https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h"

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_main,node_ui,node_customer toneBlue
class node_member,node_member_menu,node_wallet,node_database toneAmber
class node_game_choice,node_ml,node_pubg toneMint
class node_mini_games,node_rewards toneRose
class node_admin_menu,node_prices,node_voucher_admin,node_transactions,node_members_admin toneIndigo
```

## Components

### Console Entry

- [Application menu](https://github.com/keep-xylent/project-kartel-shop/blob/main/src/main.cpp): `src/main.cpp`
- [Console presentation](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/utils.h): `include/utils.h`

### Member Services

- [Registration and login](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/model.h): `include/model.h`
- [Member menu](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/model.h): `include/model.h`
- [Balance top-up](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/model.h): `include/model.h`
- [Persistent app data](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/database.h): `include/database.h`

### Top-up Commerce

- [Game selection](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/model.h): `include/model.h`
- [Mobile Legends top-up](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/modelml.h): `include/modelml.h`
- [PUBG Mobile top-up](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/modelpubg.h): `include/modelpubg.h`

### Games and Rewards

- [Mini-games menu](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/games.h): `include/games.h`
- [Voucher redemption](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/games.h): `include/games.h`

### Administration

- [Admin control panel](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h): `include/admin.h`
- [Price management](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h): `include/admin.h`
- [Voucher settings](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h): `include/admin.h`
- [Transaction history](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h): `include/admin.h`
- [Member management](https://github.com/keep-xylent/project-kartel-shop/blob/main/include/admin.h): `include/admin.h`

### Other components

- **Console user**

## Connections

- Console user → Application menu: uses (evidence: `src/main.cpp`)
- Application menu → Persistent app data: loads data (evidence: `src/main.cpp`)
- Application menu → Registration and login: dispatches login (evidence: `src/main.cpp`)
- Application menu → Registration and login: dispatches registration (evidence: `src/main.cpp`)
- Application menu → Registration and login: lists members (evidence: `src/main.cpp`)
- Application menu → Admin control panel: opens admin (evidence: `src/main.cpp`)
- Application menu → Member menu: opens member area (evidence: `src/main.cpp`)
- Registration and login → Persistent app data: saves registration (evidence: `include/model.h`)
- Member menu → Balance top-up: dispatches top-up (evidence: `include/model.h`)
- Member menu → Game selection: dispatches game purchase (evidence: `include/model.h`)
- Member menu → Mini-games menu: opens games (evidence: `include/model.h`)
- Member menu → Voucher redemption: dispatches redemption (evidence: `include/model.h`)
- Game selection → Mobile Legends top-up: opens ML shop (evidence: `include/model.h`)
- Game selection → PUBG Mobile top-up: opens PUBG shop (evidence: `include/model.h`)
- Mobile Legends top-up → Persistent app data: records purchase (evidence: `include/modelml.h`)
- PUBG Mobile top-up → Persistent app data: records purchase (evidence: `include/modelpubg.h`)
- Mini-games menu → Persistent app data: records wins (evidence: `include/games.h`)
- Voucher redemption → Persistent app data: saves redemption (evidence: `include/games.h`)
- Admin control panel → Price management: opens settings (evidence: `include/admin.h`)
- Admin control panel → Voucher settings: opens settings (evidence: `include/admin.h`)
- Admin control panel → Transaction history: opens history (evidence: `include/admin.h`)
- Admin control panel → Member management: opens management (evidence: `include/admin.h`)
- Price management → Persistent app data: saves prices (evidence: `include/admin.h`)
- Voucher settings → Persistent app data: saves settings (evidence: `include/admin.h`)
- Transaction history → Persistent app data: reads history (evidence: `include/admin.h`)
- Member management → Persistent app data: saves changes (evidence: `include/admin.h`)
