# willjustplay/web-jb-prototype architecture

> Architecture diagram of the GitHub repository willjustplay/web-jb-prototype, 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/willjustplay/web-jb-prototype
- Repository: https://github.com/willjustplay/web-jb-prototype

## Overview

This is a gaming-commerce storefront with game top-ups, account/service sales, customer accounts, payments, and an administrative console. The customer workflow enters through the routed storefront, selects a top-up game, and uses the top-up hook for game data and destination validation; the source excerpts do not show the later payment handoff. Admin screens provide operational management, while a server entry point and database-related modules indicate backend and backup responsibilities. Several backend and storefront files were not sampled, so uncertain links are omitted.

Main entry points: [`src/App.jsx`](https://github.com/willjustplay/web-jb-prototype/blob/main/src/App.jsx) (Web app router), [`src/pages/Admin.jsx`](https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/Admin.jsx) (Admin console), [`server.ts`](https://github.com/willjustplay/web-jb-prototype/blob/main/server.ts) (Application server), [`src/lib/api.js`](https://github.com/willjustplay/web-jb-prototype/blob/main/src/lib/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_app["Web app router<br/>[App.jsx]"]
  node_home["Storefront<br/>[Home.jsx]"]
  node_catalog["Product catalog<br/>[Catalog.jsx]"]
  node_topup_list["Top-up games<br/>[Topup.jsx]"]
  node_account["Customer account<br/>[Account.jsx]"]
  node_auth["Authentication state<br/>[AuthContext.jsx]"]
  node_auth_modal["Sign-in and registration<br/>[AuthModal.jsx]"]
end

subgraph group_commerce["Commerce operations"]
  node_topup_detail["Top-up checkout"]
  node_topup_hook["Top-up data and validation<br/>[useTopup.js]"]
  node_wallet["Wallet funding<br/>[WalletTopup.jsx]"]
  node_payment_result["Payment result<br/>[PaymentSuccess.jsx]"]
end

subgraph group_admin["Administration"]
  node_admin_console["Admin console<br/>[Admin.jsx]"]
  node_admin_topup["Top-up management<br/>[AdminTopup.jsx]"]
  node_admin_payments["Payment management<br/>[AdminPayment.jsx]"]
  node_admin_users["User management<br/>[AdminUsers.jsx]"]
  node_admin_email["Email verification admin"]
  node_admin_paykita["Paykita integration admin<br/>[AdminPaykita.jsx]"]
  node_admin_database["Database administration<br/>[AdminDatabase.jsx]"]
end

subgraph group_backend["Backend services"]
  node_api_client["API client<br/>[api.js]"]
  node_server["Application server<br/>[server.ts]"]
  node_backup["Database backup<br/>[databaseBackup.ts]"]
  node_db_helpers["Backup helpers<br/>[helpers.ts]"]
  node_game_data["Game definitions<br/>[masterGames.ts]"]
  node_schema[("Postgres schema<br/>[postgresSchema.ts]")]
end

node_visitor(("Shopper"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_topup_list
node_app -->|"routes to"| node_topup_detail
node_app -->|"routes to"| node_account
node_app -->|"routes to"| node_wallet
node_app -->|"routes to"| node_payment_result
node_home -.->|"renders"| node_catalog
node_topup_detail -->|"validates with"| node_topup_hook
node_topup_hook -->|"requests through"| node_api_client
node_auth -->|"requests through"| node_api_client
node_auth -->|"renders"| node_auth_modal
node_admin_console -->|"renders"| node_admin_topup
node_admin_console -->|"renders"| node_admin_payments
node_admin_console -->|"renders"| node_admin_users
node_admin_console -->|"renders"| node_admin_email
node_admin_console -->|"renders"| node_admin_paykita
node_admin_console -->|"renders"| node_admin_database
node_admin_database -->|"requests through"| node_api_client
node_backup -->|"uses"| node_db_helpers
node_server -.->|"dispatches"| node_backup
node_server -.->|"uses"| node_game_data
node_server -.->|"uses"| node_schema

click node_app "https://github.com/willjustplay/web-jb-prototype/blob/main/src/App.jsx"
click node_home "https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/Home.jsx"
click node_catalog "https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/store/Catalog.jsx"
click node_topup_list "https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/Topup.jsx"
click node_topup_detail "https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/TopupGameDetail.jsx"
click node_topup_hook "https://github.com/willjustplay/web-jb-prototype/blob/main/src/hooks/useTopup.js"
click node_account "https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/Account.jsx"
click node_wallet "https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/WalletTopup.jsx"
click node_payment_result "https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/PaymentSuccess.jsx"
click node_auth "https://github.com/willjustplay/web-jb-prototype/blob/main/src/context/AuthContext.jsx"
click node_auth_modal "https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/layout/AuthModal.jsx"
click node_api_client "https://github.com/willjustplay/web-jb-prototype/blob/main/src/lib/api.js"
click node_admin_console "https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/Admin.jsx"
click node_admin_topup "https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminTopup.jsx"
click node_admin_payments "https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminPayment.jsx"
click node_admin_users "https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminUsers.jsx"
click node_admin_email "https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminEmailVerification.jsx"
click node_admin_paykita "https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminPaykita.jsx"
click node_admin_database "https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminDatabase.jsx"
click node_server "https://github.com/willjustplay/web-jb-prototype/blob/main/server.ts"
click node_backup "https://github.com/willjustplay/web-jb-prototype/blob/main/server/modules/databaseBackup.ts"
click node_db_helpers "https://github.com/willjustplay/web-jb-prototype/blob/main/server/modules/helpers.ts"
click node_game_data "https://github.com/willjustplay/web-jb-prototype/blob/main/server/modules/masterGames.ts"
click node_schema "https://github.com/willjustplay/web-jb-prototype/blob/main/server/modules/postgresSchema.ts"

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_app,node_home,node_catalog,node_topup_list,node_account,node_auth,node_auth_modal toneBlue
class node_topup_detail,node_topup_hook,node_wallet,node_payment_result toneAmber
class node_admin_console,node_admin_topup,node_admin_payments,node_admin_users,node_admin_email,node_admin_paykita,node_admin_database toneMint
class node_api_client,node_server,node_backup,node_db_helpers,node_game_data,node_schema toneRose
class node_visitor toneIndigo
```

## Components

### Customer experience

- [Web app router](https://github.com/willjustplay/web-jb-prototype/blob/main/src/App.jsx): `src/App.jsx`
- [Storefront](https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Product catalog](https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/store/Catalog.jsx): `src/components/store/Catalog.jsx`
- [Top-up games](https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/Topup.jsx): `src/pages/Topup.jsx`
- [Customer account](https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/Account.jsx): `src/pages/Account.jsx`
- [Authentication state](https://github.com/willjustplay/web-jb-prototype/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Sign-in and registration](https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/layout/AuthModal.jsx): `src/components/layout/AuthModal.jsx`

### Commerce operations

- [Top-up checkout](https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/TopupGameDetail.jsx): `src/pages/TopupGameDetail.jsx`
- [Top-up data and validation](https://github.com/willjustplay/web-jb-prototype/blob/main/src/hooks/useTopup.js): `src/hooks/useTopup.js`
- [Wallet funding](https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/WalletTopup.jsx): `src/pages/WalletTopup.jsx`
- [Payment result](https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/PaymentSuccess.jsx): `src/pages/PaymentSuccess.jsx`

### Administration

- [Admin console](https://github.com/willjustplay/web-jb-prototype/blob/main/src/pages/Admin.jsx): `src/pages/Admin.jsx`
- [Top-up management](https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminTopup.jsx): `src/components/admin/AdminTopup.jsx`
- [Payment management](https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminPayment.jsx): `src/components/admin/AdminPayment.jsx`
- [User management](https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminUsers.jsx): `src/components/admin/AdminUsers.jsx`
- [Email verification admin](https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminEmailVerification.jsx): `src/components/admin/AdminEmailVerification.jsx`
- [Paykita integration admin](https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminPaykita.jsx): `src/components/admin/AdminPaykita.jsx`
- [Database administration](https://github.com/willjustplay/web-jb-prototype/blob/main/src/components/admin/AdminDatabase.jsx): `src/components/admin/AdminDatabase.jsx`

### Backend services

- [API client](https://github.com/willjustplay/web-jb-prototype/blob/main/src/lib/api.js): `src/lib/api.js`
- [Application server](https://github.com/willjustplay/web-jb-prototype/blob/main/server.ts): `server.ts`
- [Database backup](https://github.com/willjustplay/web-jb-prototype/blob/main/server/modules/databaseBackup.ts): `server/modules/databaseBackup.ts`
- [Backup helpers](https://github.com/willjustplay/web-jb-prototype/blob/main/server/modules/helpers.ts): `server/modules/helpers.ts`
- [Game definitions](https://github.com/willjustplay/web-jb-prototype/blob/main/server/modules/masterGames.ts): `server/modules/masterGames.ts`
- [Postgres schema](https://github.com/willjustplay/web-jb-prototype/blob/main/server/modules/postgresSchema.ts): `server/modules/postgresSchema.ts`

### Other components

- **Shopper**

## Connections

- Shopper → Web app router: opens
- Web app router → Storefront: routes to (evidence: `src/App.jsx`)
- Web app router → Top-up games: routes to (evidence: `src/App.jsx`)
- Web app router → Top-up checkout: routes to (evidence: `src/App.jsx`)
- Web app router → Customer account: routes to (evidence: `src/App.jsx`)
- Web app router → Wallet funding: routes to (evidence: `src/App.jsx`)
- Web app router → Payment result: routes to (evidence: `src/App.jsx`)
- Storefront → Product catalog: renders
- Top-up checkout → Top-up data and validation: validates with (evidence: `src/pages/TopupGameDetail.jsx`)
- Top-up data and validation → API client: requests through (evidence: `src/hooks/useTopup.js`)
- Authentication state → API client: requests through (evidence: `src/context/AuthContext.jsx`)
- Authentication state → Sign-in and registration: renders (evidence: `src/context/AuthContext.jsx`)
- Admin console → Top-up management: renders (evidence: `src/pages/Admin.jsx`)
- Admin console → Payment management: renders (evidence: `src/pages/Admin.jsx`)
- Admin console → User management: renders (evidence: `src/pages/Admin.jsx`)
- Admin console → Email verification admin: renders (evidence: `src/pages/Admin.jsx`)
- Admin console → Paykita integration admin: renders (evidence: `src/pages/Admin.jsx`)
- Admin console → Database administration: renders (evidence: `src/pages/Admin.jsx`)
- Database administration → API client: requests through (evidence: `src/components/admin/AdminDatabase.jsx`)
- Database backup → Backup helpers: uses (evidence: `server/modules/databaseBackup.ts`)
- Application server → Database backup: dispatches
- Application server → Game definitions: uses
- Application server → Postgres schema: uses
