# mahbub9277/sportzonebd architecture

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

- Interactive diagram: https://gitdiagram.com/mahbub9277/sportzonebd
- Repository: https://github.com/mahbub9277/sportzonebd

## Overview

SportZoneBD is a sports-streaming platform with a React client and an Express/Prisma API. Users browse matches and channels, watch streams, and can access premium content through subscriptions and payments; staff manage matches and other platform content. The graph highlights those domain areas and shared infrastructure. Evidence is limited to the supplied source index and excerpts; unsampled features are represented by their exact tree directories, and uncertain links are omitted.

Main entry points: [`backend/src/core/prisma.ts`](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/core/prisma.ts) (PostgreSQL database), [`backend/src/modules/admin/admin.matches.controller.ts`](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/modules/admin/admin.matches.controller.ts) (Match administration), [`backend/src/services/notification.service.ts`](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/services/notification.service.ts) (Notifications), [`frontend/src/App.tsx`](https://github.com/mahbub9277/sportzonebd/blob/main/frontend/src/App.tsx) (Web app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_webapp["Web app<br/>[App.tsx]"]
  node_watch["Watch experience"]
  node_matchpages["Match browsing<br/>[AllMatchesPage.tsx]"]
end

subgraph group_sports["Sports content"]
  node_matchapi["Match API<br/>[matchController.ts]"]
  node_matchadmin["Match administration"]
  node_matchautomation["Match automation"]
  node_channels["Channels and streams"]
  node_externaldata["Sports data providers"]
end

subgraph group_accounts["Accounts and commerce"]
  node_auth["Authentication<br/>[auth.controller.ts]"]
  node_payment["Payments"]
  node_subscriptions["Subscriptions"]
end

subgraph group_operations["Platform operations"]
  node_ads["Advertising"]
  node_analytics["Analytics"]
  node_notifications["Notifications"]
  node_admin["Admin tools"]
  node_realtime["Realtime events<br/>[socketManager.ts]"]
  node_db[("PostgreSQL database<br/>[prisma.ts]")]
end

node_viewer(("Viewer"))
node_staff(("Staff"))
node_cloudinary["Cloudinary"]
node_email["Email service"]

node_viewer -->|"uses"| node_webapp
node_webapp -.->|"routes viewers"| node_watch
node_webapp -.->|"routes viewers"| node_matchpages
node_matchpages -.->|"requests matches"| node_matchapi
node_matchapi -->|"queries"| node_db
node_staff -->|"manages matches"| node_matchadmin
node_matchadmin -.->|"updates records"| node_db
node_matchadmin -->|"emits updates"| node_realtime
node_matchadmin -->|"notifies starts"| node_notifications
node_auth -->|"reads and writes"| node_db
node_auth -->|"sends email"| node_email
node_payment -.->|"records payments"| node_db
node_ads -.->|"tracks engagement"| node_analytics
node_channels -.->|"uses channel service"| node_db
node_channels -->|"emits updates"| node_realtime
node_notifications -->|"stores notifications"| node_db
node_notifications -->|"dispatches events"| node_realtime
node_notifications -.->|"sends notifications"| node_email
node_admin -.->|"manages media"| node_cloudinary

click node_webapp "https://github.com/mahbub9277/sportzonebd/blob/main/frontend/src/App.tsx"
click node_watch "https://github.com/mahbub9277/sportzonebd/blob/main/frontend/src/pages/explore/WatchChannelPage.tsx"
click node_matchpages "https://github.com/mahbub9277/sportzonebd/blob/main/frontend/src/pages/matches/AllMatchesPage.tsx"
click node_matchapi "https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/controllers/matchController.ts"
click node_matchadmin "https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/modules/admin/admin.matches.controller.ts"
click node_matchautomation "https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/services/matchAutomation.service.ts"
click node_channels "https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/modules/channels/channel.controller.ts"
click node_externaldata "https://github.com/mahbub9277/sportzonebd/tree/main/backend/src/modules/providers"
click node_auth "https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/modules/auth/auth.controller.ts"
click node_payment "https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/modules/payments/payment.controller.ts"
click node_subscriptions "https://github.com/mahbub9277/sportzonebd/tree/main/backend/src/modules/subscriptions"
click node_ads "https://github.com/mahbub9277/sportzonebd/tree/main/backend/src/modules/advertisements"
click node_analytics "https://github.com/mahbub9277/sportzonebd/tree/main/backend/src/modules/analytics"
click node_notifications "https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/services/notification.service.ts"
click node_admin "https://github.com/mahbub9277/sportzonebd/tree/main/backend/src/modules/admin"
click node_realtime "https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/core/socketManager.ts"
click node_db "https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/core/prisma.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_webapp,node_watch,node_matchpages,node_viewer toneBlue
class node_matchapi,node_matchadmin,node_matchautomation,node_channels,node_externaldata toneAmber
class node_auth,node_payment,node_subscriptions toneMint
class node_ads,node_analytics,node_notifications,node_admin,node_realtime,node_db toneRose
class node_staff,node_cloudinary,node_email toneIndigo
```

## Components

### Web experience

- [Web app](https://github.com/mahbub9277/sportzonebd/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Watch experience](https://github.com/mahbub9277/sportzonebd/blob/main/frontend/src/pages/explore/WatchChannelPage.tsx): `frontend/src/pages/explore/WatchChannelPage.tsx`
- [Match browsing](https://github.com/mahbub9277/sportzonebd/blob/main/frontend/src/pages/matches/AllMatchesPage.tsx): `frontend/src/pages/matches/AllMatchesPage.tsx`

### Sports content

- [Match API](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/controllers/matchController.ts): `backend/src/controllers/matchController.ts`
- [Match administration](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/modules/admin/admin.matches.controller.ts): `backend/src/modules/admin/admin.matches.controller.ts`
- [Match automation](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/services/matchAutomation.service.ts): `backend/src/services/matchAutomation.service.ts`
- [Channels and streams](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/modules/channels/channel.controller.ts): `backend/src/modules/channels/channel.controller.ts`
- [Sports data providers](https://github.com/mahbub9277/sportzonebd/tree/main/backend/src/modules/providers): `backend/src/modules/providers`

### Accounts and commerce

- [Authentication](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/modules/auth/auth.controller.ts): `backend/src/modules/auth/auth.controller.ts`
- [Payments](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/modules/payments/payment.controller.ts): `backend/src/modules/payments/payment.controller.ts`
- [Subscriptions](https://github.com/mahbub9277/sportzonebd/tree/main/backend/src/modules/subscriptions): `backend/src/modules/subscriptions`

### Platform operations

- [Advertising](https://github.com/mahbub9277/sportzonebd/tree/main/backend/src/modules/advertisements): `backend/src/modules/advertisements`
- [Analytics](https://github.com/mahbub9277/sportzonebd/tree/main/backend/src/modules/analytics): `backend/src/modules/analytics`
- [Notifications](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/services/notification.service.ts): `backend/src/services/notification.service.ts`
- [Admin tools](https://github.com/mahbub9277/sportzonebd/tree/main/backend/src/modules/admin): `backend/src/modules/admin`
- [Realtime events](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/core/socketManager.ts): `backend/src/core/socketManager.ts`
- [PostgreSQL database](https://github.com/mahbub9277/sportzonebd/blob/main/backend/src/core/prisma.ts): `backend/src/core/prisma.ts`

### Other components

- **Viewer**
- **Staff**
- **Cloudinary**
- **Email service**

## Connections

- Viewer → Web app: uses
- Web app → Watch experience: routes viewers
- Web app → Match browsing: routes viewers
- Match browsing → Match API: requests matches
- Match API → PostgreSQL database: queries (evidence: `backend/src/controllers/matchController.ts`)
- Staff → Match administration: manages matches
- Match administration → PostgreSQL database: updates records (evidence: `backend/src/modules/admin/admin.matches.controller.ts`)
- Match administration → Realtime events: emits updates (evidence: `backend/src/modules/admin/admin.matches.controller.ts`)
- Match administration → Notifications: notifies starts (evidence: `backend/src/modules/admin/admin.matches.controller.ts`)
- Authentication → PostgreSQL database: reads and writes (evidence: `backend/src/modules/auth/auth.controller.ts`)
- Authentication → Email service: sends email (evidence: `backend/src/modules/auth/auth.controller.ts`)
- Payments → PostgreSQL database: records payments (evidence: `backend/src/modules/payments/payment.controller.ts`)
- Advertising → Analytics: tracks engagement
- Channels and streams → PostgreSQL database: uses channel service (evidence: `backend/src/modules/channels/channel.controller.ts`)
- Channels and streams → Realtime events: emits updates (evidence: `backend/src/modules/channels/channel.controller.ts`)
- Notifications → PostgreSQL database: stores notifications (evidence: `backend/src/services/notification.service.ts`)
- Notifications → Realtime events: dispatches events (evidence: `backend/src/services/notification.service.ts`)
- Notifications → Email service: sends notifications
- Admin tools → Cloudinary: manages media
