# kuldeepydv00/99app architecture

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

- Interactive diagram: https://gitdiagram.com/kuldeepydv00/99app
- Repository: https://github.com/kuldeepydv00/99app

## Overview

99xmatka is a real-money betting platform: players use the website/PWA to browse games, place bets, and manage wallet activity; the backend serves APIs and game rounds, while administrators manage results, schedules, users, payments, and announcements. The Android wrapper opens the same website. The graph preserves the documented game, fairness, and push-notification capabilities, but several connections are omitted where implementation excerpts were unavailable; dashed edges mark documented or otherwise unverified integration.

Main entry points: [`backend/src/server.js`](https://github.com/kuldeepydv00/99app/blob/main/backend/src/server.js) (API and socket server), [`website/src/App.tsx`](https://github.com/kuldeepydv00/99app/blob/main/website/src/App.tsx) (Player website), [`backend/src/games/tradingEngine.js`](https://github.com/kuldeepydv00/99app/blob/main/backend/src/games/tradingEngine.js) (Trading rounds), [`backend/src/utils/notify.js`](https://github.com/kuldeepydv00/99app/blob/main/backend/src/utils/notify.js) (Notification service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_players["Player experience"]
  node_website["Player website<br/>[App.tsx]"]
  node_lobby["Lobby and shell<br/>[Lobby.tsx]"]
  node_game_views["Game screens<br/>[TradingPage.tsx]"]
  node_game_api["Game API client<br/>[api.ts]"]
  node_pwa["PWA behavior<br/>[webApp.tsx]"]
  node_android["Android web wrapper"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin dashboard<br/>[App.tsx]"]
  node_admin_games["Game administration<br/>[TradingAdmin.tsx]"]
end

subgraph group_api["Backend API"]
  node_server["API and socket server<br/>[server.js]"]
  node_user_routes["User routes<br/>[userRoutes.js]"]
  node_game_routes["Game routes<br/>[gamesRoutes.js]"]
  node_admin_routes["Admin routes<br/>[adminRoutes.js]"]
  node_user_controller["User accounts<br/>[userController.js]"]
  node_admin_controller["Admin operations<br/>[adminController.js]"]
end

subgraph group_games["Game runtime"]
  node_trading["Trading rounds<br/>[tradingEngine.js]"]
  node_jet["Jet rounds<br/>[jetEngine.js]"]
  node_matka["Matka markets<br/>[matka99.js]"]
  node_fairness["Fairness verification<br/>[provablyFair.js]"]
end

subgraph group_state["State and messaging"]
  node_notifications["Notification service<br/>[notify.js]"]
  node_push["Web push delivery<br/>[webPush.js]"]
  node_store[("Platform state store<br/>[store.js]")]
  node_wallet["Game wallet ledger<br/>[wallet.js]"]
  node_chart_store[("Historical charts")]
end

node_player(("Player"))

node_player -->|"uses"| node_website
node_website -->|"renders"| node_lobby
node_website -->|"renders"| node_game_views
node_website -->|"uses"| node_game_api
node_website -->|"integrates"| node_pwa
node_android -.->|"opens"| node_website
node_admin_ui -->|"renders"| node_admin_games
node_website -.->|"requests APIs"| node_server
node_admin_ui -.->|"uses admin APIs"| node_server
node_server -->|"mounts"| node_user_routes
node_server -->|"mounts"| node_game_routes
node_server -->|"mounts"| node_admin_routes
node_user_routes -->|"routes to"| node_user_controller
node_admin_routes -->|"routes to"| node_admin_controller
node_admin_routes -->|"routes to"| node_notifications
node_game_routes -.->|"dispatches to"| node_trading
node_server -->|"initializes"| node_trading
node_server -->|"initializes"| node_jet
node_server -->|"initializes"| node_matka
node_admin_controller -->|"reads and writes"| node_store
node_user_controller -->|"reads and writes"| node_store
node_admin_controller -->|"reads"| node_chart_store
node_trading -->|"settles bets"| node_wallet
node_jet -->|"credits wins"| node_wallet
node_notifications -->|"persists messages"| node_store
node_notifications -->|"sends push"| node_push
node_trading -->|"notifies players"| node_notifications
node_jet -->|"notifies players"| node_notifications
node_fairness -.->|"verifies outcomes"| node_trading

click node_website "https://github.com/kuldeepydv00/99app/blob/main/website/src/App.tsx"
click node_lobby "https://github.com/kuldeepydv00/99app/blob/main/website/src/layout/Lobby.tsx"
click node_game_views "https://github.com/kuldeepydv00/99app/blob/main/website/src/games/TradingPage.tsx"
click node_game_api "https://github.com/kuldeepydv00/99app/blob/main/website/src/games/api.ts"
click node_pwa "https://github.com/kuldeepydv00/99app/blob/main/website/src/layout/webApp.tsx"
click node_android "https://github.com/kuldeepydv00/99app/tree/main/android-app/app"
click node_admin_ui "https://github.com/kuldeepydv00/99app/blob/main/admin-panel/src/App.tsx"
click node_admin_games "https://github.com/kuldeepydv00/99app/blob/main/admin-panel/src/games/TradingAdmin.tsx"
click node_server "https://github.com/kuldeepydv00/99app/blob/main/backend/src/server.js"
click node_user_routes "https://github.com/kuldeepydv00/99app/blob/main/backend/src/routes/userRoutes.js"
click node_game_routes "https://github.com/kuldeepydv00/99app/blob/main/backend/src/routes/gamesRoutes.js"
click node_admin_routes "https://github.com/kuldeepydv00/99app/blob/main/backend/src/routes/adminRoutes.js"
click node_user_controller "https://github.com/kuldeepydv00/99app/blob/main/backend/src/controllers/userController.js"
click node_admin_controller "https://github.com/kuldeepydv00/99app/blob/main/backend/src/controllers/adminController.js"
click node_notifications "https://github.com/kuldeepydv00/99app/blob/main/backend/src/utils/notify.js"
click node_push "https://github.com/kuldeepydv00/99app/blob/main/backend/src/utils/webPush.js"
click node_store "https://github.com/kuldeepydv00/99app/blob/main/backend/src/store.js"
click node_wallet "https://github.com/kuldeepydv00/99app/blob/main/backend/src/games/wallet.js"
click node_trading "https://github.com/kuldeepydv00/99app/blob/main/backend/src/games/tradingEngine.js"
click node_jet "https://github.com/kuldeepydv00/99app/blob/main/backend/src/games/jetEngine.js"
click node_matka "https://github.com/kuldeepydv00/99app/blob/main/backend/src/games/matka99.js"
click node_fairness "https://github.com/kuldeepydv00/99app/blob/main/backend/src/utils/provablyFair.js"
click node_chart_store "https://github.com/kuldeepydv00/99app/blob/main/backend/src/historicalChartStore.js"

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_website,node_lobby,node_game_views,node_game_api,node_pwa,node_android toneBlue
class node_admin_ui,node_admin_games toneAmber
class node_server,node_user_routes,node_game_routes,node_admin_routes,node_user_controller,node_admin_controller toneMint
class node_trading,node_jet,node_matka,node_fairness toneRose
class node_notifications,node_push,node_store,node_wallet,node_chart_store,node_player toneIndigo
```

## Components

### Player experience

- [Player website](https://github.com/kuldeepydv00/99app/blob/main/website/src/App.tsx): `website/src/App.tsx`
- [Lobby and shell](https://github.com/kuldeepydv00/99app/blob/main/website/src/layout/Lobby.tsx): `website/src/layout/Lobby.tsx`
- [Game screens](https://github.com/kuldeepydv00/99app/blob/main/website/src/games/TradingPage.tsx): `website/src/games/TradingPage.tsx`
- [Game API client](https://github.com/kuldeepydv00/99app/blob/main/website/src/games/api.ts): `website/src/games/api.ts`
- [PWA behavior](https://github.com/kuldeepydv00/99app/blob/main/website/src/layout/webApp.tsx): `website/src/layout/webApp.tsx`
- [Android web wrapper](https://github.com/kuldeepydv00/99app/tree/main/android-app/app): `android-app/app`

### Administration

- [Admin dashboard](https://github.com/kuldeepydv00/99app/blob/main/admin-panel/src/App.tsx): `admin-panel/src/App.tsx`
- [Game administration](https://github.com/kuldeepydv00/99app/blob/main/admin-panel/src/games/TradingAdmin.tsx): `admin-panel/src/games/TradingAdmin.tsx`

### Backend API

- [API and socket server](https://github.com/kuldeepydv00/99app/blob/main/backend/src/server.js): `backend/src/server.js`
- [User routes](https://github.com/kuldeepydv00/99app/blob/main/backend/src/routes/userRoutes.js): `backend/src/routes/userRoutes.js`
- [Game routes](https://github.com/kuldeepydv00/99app/blob/main/backend/src/routes/gamesRoutes.js): `backend/src/routes/gamesRoutes.js`
- [Admin routes](https://github.com/kuldeepydv00/99app/blob/main/backend/src/routes/adminRoutes.js): `backend/src/routes/adminRoutes.js`
- [User accounts](https://github.com/kuldeepydv00/99app/blob/main/backend/src/controllers/userController.js): `backend/src/controllers/userController.js`
- [Admin operations](https://github.com/kuldeepydv00/99app/blob/main/backend/src/controllers/adminController.js): `backend/src/controllers/adminController.js`

### Game runtime

- [Trading rounds](https://github.com/kuldeepydv00/99app/blob/main/backend/src/games/tradingEngine.js): `backend/src/games/tradingEngine.js`
- [Jet rounds](https://github.com/kuldeepydv00/99app/blob/main/backend/src/games/jetEngine.js): `backend/src/games/jetEngine.js`
- [Matka markets](https://github.com/kuldeepydv00/99app/blob/main/backend/src/games/matka99.js): `backend/src/games/matka99.js`
- [Fairness verification](https://github.com/kuldeepydv00/99app/blob/main/backend/src/utils/provablyFair.js): `backend/src/utils/provablyFair.js`

### State and messaging

- [Notification service](https://github.com/kuldeepydv00/99app/blob/main/backend/src/utils/notify.js): `backend/src/utils/notify.js`
- [Web push delivery](https://github.com/kuldeepydv00/99app/blob/main/backend/src/utils/webPush.js): `backend/src/utils/webPush.js`
- [Platform state store](https://github.com/kuldeepydv00/99app/blob/main/backend/src/store.js): `backend/src/store.js`
- [Game wallet ledger](https://github.com/kuldeepydv00/99app/blob/main/backend/src/games/wallet.js): `backend/src/games/wallet.js`
- [Historical charts](https://github.com/kuldeepydv00/99app/blob/main/backend/src/historicalChartStore.js): `backend/src/historicalChartStore.js`

### Other components

- **Player**

## Connections

- Player → Player website: uses (evidence: `README.md`)
- Player website → Lobby and shell: renders (evidence: `website/src/App.tsx`)
- Player website → Game screens: renders (evidence: `website/src/App.tsx`)
- Player website → Game API client: uses (evidence: `website/src/App.tsx`)
- Player website → PWA behavior: integrates (evidence: `website/src/main.tsx`)
- Android web wrapper → Player website: opens (evidence: `README.md`)
- Admin dashboard → Game administration: renders (evidence: `admin-panel/src/App.tsx`)
- Player website → API and socket server: requests APIs (evidence: `README.md`)
- Admin dashboard → API and socket server: uses admin APIs (evidence: `README.md`)
- API and socket server → User routes: mounts (evidence: `backend/src/server.js`)
- API and socket server → Game routes: mounts (evidence: `backend/src/server.js`)
- API and socket server → Admin routes: mounts (evidence: `backend/src/server.js`)
- User routes → User accounts: routes to (evidence: `backend/src/routes/userRoutes.js`)
- Admin routes → Admin operations: routes to (evidence: `backend/src/routes/adminRoutes.js`)
- Admin routes → Notification service: routes to (evidence: `backend/src/routes/adminRoutes.js`)
- Game routes → Trading rounds: dispatches to
- API and socket server → Trading rounds: initializes (evidence: `backend/src/server.js`)
- API and socket server → Jet rounds: initializes (evidence: `backend/src/server.js`)
- API and socket server → Matka markets: initializes (evidence: `backend/src/server.js`)
- Admin operations → Platform state store: reads and writes (evidence: `backend/src/controllers/adminController.js`)
- User accounts → Platform state store: reads and writes (evidence: `backend/src/controllers/userController.js`)
- Admin operations → Historical charts: reads (evidence: `backend/src/controllers/adminController.js`)
- Trading rounds → Game wallet ledger: settles bets (evidence: `backend/src/games/tradingEngine.js`)
- Jet rounds → Game wallet ledger: credits wins (evidence: `backend/src/games/jetEngine.js`)
- Notification service → Platform state store: persists messages (evidence: `backend/src/utils/notify.js`)
- Notification service → Web push delivery: sends push (evidence: `backend/src/utils/notify.js`)
- Trading rounds → Notification service: notifies players (evidence: `backend/src/games/tradingEngine.js`)
- Jet rounds → Notification service: notifies players (evidence: `backend/src/games/jetEngine.js`)
- Fairness verification → Trading rounds: verifies outcomes
