# l30-r1b/tec-web architecture

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

- Interactive diagram: https://gitdiagram.com/l30-r1b/tec-web
- Repository: https://github.com/l30-r1b/tec-web

## Overview

This repository implements a bingo platform: players browse rooms and games, purchase cards, follow live draws, and manage accounts and credits; administrators manage users and game content. The backend is a NestJS API with separate domain services, a scheduled game engine, WebSocket updates, and Prisma persistence. The tree and excerpts establish engine and some controller relationships, but the README is empty and most frontend-to-API wiring was not sampled, so those connections are shown as unverified rather than asserted.

Main entry points: [`backend/src/app.module.js`](https://github.com/l30-r1b/tec-web/blob/main/backend/src/app.module.js) (API composition), [`backend/src/shared/prisma/prisma.service.ts`](https://github.com/l30-r1b/tec-web/blob/main/backend/src/shared/prisma/prisma.service.ts) (Prisma access), [`frontend/src/app/admin/page.tsx`](https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/admin/page.tsx) (Admin console), [`backend/src/bingo-engine/bingo-engine.module.ts`](https://github.com/l30-r1b/tec-web/blob/main/backend/src/bingo-engine/bingo-engine.module.ts) (Engine module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_rooms_ui["Room browsing<br/>[page.tsx]"]
  node_game_ui["Game experience<br/>[page.tsx]"]
  node_cart_ui["Card purchase<br/>[page.tsx]"]
  node_account_ui["Account and credits<br/>[UserLayout.tsx]"]
  node_admin_ui["Admin console<br/>[page.tsx]"]
  node_reports_ui["Reports<br/>[page.tsx]"]
end

subgraph group_domain["API domains"]
  node_app["API composition<br/>[app.module.js]"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_users["User accounts<br/>[users.service.ts]"]
  node_user_routes["User routes"]
  node_rooms["Room management<br/>[rooms.service.ts]"]
  node_room_routes["Room routes"]
  node_games["Game management<br/>[games.service.ts]"]
  node_game_routes["Game routes"]
  node_cards["Bingo cards<br/>[cards.service.ts]"]
  node_card_routes["Card routes"]
  node_prizes["Prize management<br/>[prizes.service.ts]"]
  node_prize_routes["Prize routes"]
end

subgraph group_engine["Game runtime"]
  node_engine_module["Engine module"]
  node_scheduler["Game scheduler"]
  node_logic["Draw and winners"]
  node_realtime["Realtime gateway"]
  node_prisma["Prisma access<br/>[prisma.service.ts]"]
  node_database[("Database")]
end

node_player(("Player"))
node_admin(("Administrator"))

node_player -.->|"browses"| node_rooms_ui
node_player -.->|"plays"| node_game_ui
node_player -.->|"buys cards"| node_cart_ui
node_player -.->|"manages account"| node_account_ui
node_admin -.->|"manages platform"| node_admin_ui
node_admin -.->|"views reports"| node_reports_ui
node_app -->|"registers"| node_auth
node_app -->|"registers"| node_users
node_app -->|"registers"| node_rooms
node_app -->|"registers"| node_games
node_app -->|"registers"| node_prizes
node_app -->|"registers"| node_engine_module
node_user_routes -.->|"calls"| node_users
node_room_routes -.->|"calls"| node_rooms
node_game_routes -->|"calls"| node_games
node_prize_routes -->|"calls"| node_prizes
node_card_routes -->|"calls"| node_cards
node_games -.->|"buys cards"| node_cards
node_engine_module -->|"provides"| node_logic
node_engine_module -->|"provides"| node_realtime
node_engine_module -->|"provides"| node_scheduler
node_scheduler -->|"invokes"| node_logic
node_logic -->|"reads and writes"| node_prisma
node_logic -->|"broadcasts"| node_realtime
node_users -.->|"accesses data"| node_prisma
node_rooms -.->|"accesses data"| node_prisma
node_games -.->|"accesses data"| node_prisma
node_cards -->|"accesses data"| node_prisma
node_prizes -.->|"accesses data"| node_prisma
node_prisma -.->|"persists"| node_database
node_rooms_ui -.->|"requests rooms"| node_room_routes
node_game_ui -.->|"requests game"| node_game_routes
node_cart_ui -.->|"buys cards"| node_game_routes
node_account_ui -.->|"requests account"| node_user_routes
node_admin_ui -.->|"administers games"| node_game_routes
node_admin_ui -.->|"administers rooms"| node_room_routes
node_admin_ui -.->|"administers prizes"| node_prize_routes
node_admin_ui -.->|"administers users"| node_user_routes
node_game_ui -.->|"follows draws"| node_realtime

click node_rooms_ui "https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/rooms/page.tsx"
click node_game_ui "https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/game/page.tsx"
click node_cart_ui "https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/cart/page.tsx"
click node_account_ui "https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/components/UserLayout.tsx"
click node_admin_ui "https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/admin/page.tsx"
click node_reports_ui "https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/reports/page.tsx"
click node_app "https://github.com/l30-r1b/tec-web/blob/main/backend/src/app.module.js"
click node_auth "https://github.com/l30-r1b/tec-web/blob/main/backend/src/auth/auth.service.ts"
click node_users "https://github.com/l30-r1b/tec-web/blob/main/backend/src/users/users.service.ts"
click node_user_routes "https://github.com/l30-r1b/tec-web/blob/main/backend/src/users/users.controller.ts"
click node_rooms "https://github.com/l30-r1b/tec-web/blob/main/backend/src/rooms/rooms.service.ts"
click node_room_routes "https://github.com/l30-r1b/tec-web/blob/main/backend/src/rooms/rooms.controller.js"
click node_games "https://github.com/l30-r1b/tec-web/blob/main/backend/src/games/games.service.ts"
click node_game_routes "https://github.com/l30-r1b/tec-web/blob/main/backend/src/games/games.controller.js"
click node_cards "https://github.com/l30-r1b/tec-web/blob/main/backend/src/cards/cards.service.ts"
click node_card_routes "https://github.com/l30-r1b/tec-web/blob/main/backend/src/cards/cards.controller.ts"
click node_prizes "https://github.com/l30-r1b/tec-web/blob/main/backend/src/prizes/prizes.service.ts"
click node_prize_routes "https://github.com/l30-r1b/tec-web/blob/main/backend/src/prizes/prizes.controller.js"
click node_engine_module "https://github.com/l30-r1b/tec-web/blob/main/backend/src/bingo-engine/bingo-engine.module.ts"
click node_scheduler "https://github.com/l30-r1b/tec-web/blob/main/backend/src/bingo-engine/scheduler/scheduler.service.ts"
click node_logic "https://github.com/l30-r1b/tec-web/blob/main/backend/src/bingo-engine/game-logic/game-logic.service.ts"
click node_realtime "https://github.com/l30-r1b/tec-web/blob/main/backend/src/bingo-engine/realtime/realtime.gateway.ts"
click node_prisma "https://github.com/l30-r1b/tec-web/blob/main/backend/src/shared/prisma/prisma.service.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_rooms_ui,node_game_ui,node_cart_ui,node_account_ui,node_admin_ui,node_reports_ui toneBlue
class node_app,node_auth,node_users,node_user_routes,node_rooms,node_room_routes,node_games,node_game_routes,node_cards,node_card_routes,node_prizes,node_prize_routes toneAmber
class node_engine_module,node_scheduler,node_logic,node_realtime,node_prisma,node_database toneMint
class node_player,node_admin toneIndigo
```

## Components

### Web client

- [Room browsing](https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/rooms/page.tsx): `frontend/src/app/rooms/page.tsx`
- [Game experience](https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/game/page.tsx): `frontend/src/app/game/page.tsx`
- [Card purchase](https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/cart/page.tsx): `frontend/src/app/cart/page.tsx`
- [Account and credits](https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/components/UserLayout.tsx): `frontend/src/app/components/UserLayout.tsx`
- [Admin console](https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/admin/page.tsx): `frontend/src/app/admin/page.tsx`
- [Reports](https://github.com/l30-r1b/tec-web/blob/main/frontend/src/app/reports/page.tsx): `frontend/src/app/reports/page.tsx`

### API domains

- [API composition](https://github.com/l30-r1b/tec-web/blob/main/backend/src/app.module.js): `backend/src/app.module.js`
- [Authentication](https://github.com/l30-r1b/tec-web/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [User accounts](https://github.com/l30-r1b/tec-web/blob/main/backend/src/users/users.service.ts): `backend/src/users/users.service.ts`
- [User routes](https://github.com/l30-r1b/tec-web/blob/main/backend/src/users/users.controller.ts): `backend/src/users/users.controller.ts`
- [Room management](https://github.com/l30-r1b/tec-web/blob/main/backend/src/rooms/rooms.service.ts): `backend/src/rooms/rooms.service.ts`
- [Room routes](https://github.com/l30-r1b/tec-web/blob/main/backend/src/rooms/rooms.controller.js): `backend/src/rooms/rooms.controller.js`
- [Game management](https://github.com/l30-r1b/tec-web/blob/main/backend/src/games/games.service.ts): `backend/src/games/games.service.ts`
- [Game routes](https://github.com/l30-r1b/tec-web/blob/main/backend/src/games/games.controller.js): `backend/src/games/games.controller.js`
- [Bingo cards](https://github.com/l30-r1b/tec-web/blob/main/backend/src/cards/cards.service.ts): `backend/src/cards/cards.service.ts`
- [Card routes](https://github.com/l30-r1b/tec-web/blob/main/backend/src/cards/cards.controller.ts): `backend/src/cards/cards.controller.ts`
- [Prize management](https://github.com/l30-r1b/tec-web/blob/main/backend/src/prizes/prizes.service.ts): `backend/src/prizes/prizes.service.ts`
- [Prize routes](https://github.com/l30-r1b/tec-web/blob/main/backend/src/prizes/prizes.controller.js): `backend/src/prizes/prizes.controller.js`

### Game runtime

- [Engine module](https://github.com/l30-r1b/tec-web/blob/main/backend/src/bingo-engine/bingo-engine.module.ts): `backend/src/bingo-engine/bingo-engine.module.ts`
- [Game scheduler](https://github.com/l30-r1b/tec-web/blob/main/backend/src/bingo-engine/scheduler/scheduler.service.ts): `backend/src/bingo-engine/scheduler/scheduler.service.ts`
- [Draw and winners](https://github.com/l30-r1b/tec-web/blob/main/backend/src/bingo-engine/game-logic/game-logic.service.ts): `backend/src/bingo-engine/game-logic/game-logic.service.ts`
- [Realtime gateway](https://github.com/l30-r1b/tec-web/blob/main/backend/src/bingo-engine/realtime/realtime.gateway.ts): `backend/src/bingo-engine/realtime/realtime.gateway.ts`
- [Prisma access](https://github.com/l30-r1b/tec-web/blob/main/backend/src/shared/prisma/prisma.service.ts): `backend/src/shared/prisma/prisma.service.ts`
- **Database**

### Other components

- **Player**
- **Administrator**

## Connections

- Player → Room browsing: browses
- Player → Game experience: plays
- Player → Card purchase: buys cards
- Player → Account and credits: manages account
- Administrator → Admin console: manages platform
- Administrator → Reports: views reports
- API composition → Authentication: registers (evidence: `backend/src/app.module.js`)
- API composition → User accounts: registers (evidence: `backend/src/app.module.js`)
- API composition → Room management: registers (evidence: `backend/src/app.module.js`)
- API composition → Game management: registers (evidence: `backend/src/app.module.js`)
- API composition → Prize management: registers (evidence: `backend/src/app.module.js`)
- API composition → Engine module: registers (evidence: `backend/src/app.module.js`)
- User routes → User accounts: calls
- Room routes → Room management: calls
- Game routes → Game management: calls (evidence: `backend/src/games/games.controller.js`)
- Prize routes → Prize management: calls (evidence: `backend/src/prizes/prizes.controller.js`)
- Card routes → Bingo cards: calls (evidence: `backend/src/cards/cards.controller.ts`)
- Game management → Bingo cards: buys cards
- Engine module → Draw and winners: provides (evidence: `backend/src/bingo-engine/bingo-engine.module.ts`)
- Engine module → Realtime gateway: provides (evidence: `backend/src/bingo-engine/bingo-engine.module.ts`)
- Engine module → Game scheduler: provides (evidence: `backend/src/bingo-engine/bingo-engine.module.ts`)
- Game scheduler → Draw and winners: invokes (evidence: `backend/src/bingo-engine/scheduler/scheduler.service.ts`)
- Draw and winners → Prisma access: reads and writes (evidence: `backend/src/bingo-engine/game-logic/game-logic.service.ts`)
- Draw and winners → Realtime gateway: broadcasts (evidence: `backend/src/bingo-engine/game-logic/game-logic.service.ts`)
- User accounts → Prisma access: accesses data
- Room management → Prisma access: accesses data
- Game management → Prisma access: accesses data
- Bingo cards → Prisma access: accesses data (evidence: `backend/src/cards/cards.service.ts`)
- Prize management → Prisma access: accesses data
- Prisma access → Database: persists
- Room browsing → Room routes: requests rooms
- Game experience → Game routes: requests game
- Card purchase → Game routes: buys cards
- Account and credits → User routes: requests account
- Admin console → Game routes: administers games
- Admin console → Room routes: administers rooms
- Admin console → Prize routes: administers prizes
- Admin console → User routes: administers users
- Game experience → Realtime gateway: follows draws
