# enkh-ebash/-mlbb_alpha architecture

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

- Interactive diagram: https://gitdiagram.com/enkh-ebash/-mlbb_alpha
- Repository: https://github.com/enkh-ebash/-mlbb_alpha

## Overview

mlbb_play is a FACEIT-style competitive platform for Mobile Legends: Bang Bang. Players register or log in, join an Elo-aware matchmaking queue, get paired into a match, submit results, and—if approved—have ratings updated. Moderators can review disputed results. The README also documents profile/leaderboard, hero, team, tournament, news, and notification capabilities; several services are explicitly skeletons. Inter-service matchmaking, match creation, and Elo updates are documented, but unsampled wiring for other capabilities is not inferred.

Main entry points: [`web/lib/api.ts`](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/web/lib/api.ts) (API Client), [`services/elo-service/src/controllers/elo.controller.ts`](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/elo-service/src/controllers/elo.controller.ts) (Elo Result API), [`services/auth-service/src/controllers/auth.controller.ts`](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/auth-service/src/controllers/auth.controller.ts) (Accounts & Profiles), [`services/matchmaking-service/src/controllers/matchmaking.controller.ts`](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/matchmaking-service/src/controllers/matchmaking.controller.ts) (Queue Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Player Web App"]
  node_webapp["Web Pages"]
  node_webapi["API Client<br/>[api.ts]"]
end

subgraph group_identity["Identity &amp; Profiles"]
  node_authroutes["Auth Routes<br/>[auth.routes.ts]"]
  node_authcontroller["Accounts &amp; Profiles<br/>[auth.controller.ts]"]
  node_authdb[("Auth Store<br/>[db.ts]")]
  node_internalroutes["Internal User API<br/>[internal.routes.ts]"]
end

subgraph group_competition["Match Competition"]
  node_matchmakingroutes["Queue Routes"]
  node_matchmakingcontroller["Queue Management"]
  node_matchingjob["Pairing Job<br/>[matching.job.ts]"]
  node_matchclient["Match Client<br/>[match-client.ts]"]
  node_matchroutes["Match Routes<br/>[match.routes.ts]"]
  node_matchcontroller["Match &amp; Review"]
  node_matchdb[("Match Store<br/>[db.ts]")]
  node_eloclient["Elo Client<br/>[elo-client.ts]"]
end

subgraph group_rating["Ratings"]
  node_eloresult["Elo Result API<br/>[elo.controller.ts]"]
  node_elomath["Elo Calculation<br/>[elo-math.ts]"]
  node_elodb[("Rating Store<br/>[db.ts]")]
  node_authclient["Auth Elo Client<br/>[auth-client.ts]"]
end

subgraph group_extensions["Platform Extensions"]
  node_hero["Hero Catalog<br/>[hero.controller.ts]"]
  node_team["Team Management<br/>[team.controller.ts]"]
  node_tournament["Tournaments<br/>[index.ts]"]
  node_news["News<br/>[index.ts]"]
  node_notifications["Notifications &amp; Chat<br/>[index.ts]"]
end

node_player(("Player"))
node_authservice{{"Auth Service"}}

node_player -->|"uses"| node_webapp
node_webapp -->|"API requests"| node_webapi
node_webapi -->|"auth calls"| node_authroutes
node_webapi -->|"queue calls"| node_matchmakingroutes
node_webapi -->|"match calls"| node_matchroutes
node_webapi -.->|"team requests"| node_team
node_webapi -.->|"hero requests"| node_hero
node_webapi -.->|"tournament requests"| node_tournament
node_webapi -.->|"news requests"| node_news
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"reads/writes"| node_authdb
node_authcontroller -->|"returns token/profile"| node_player
node_matchmakingroutes -->|"dispatches"| node_matchmakingcontroller
node_matchmakingcontroller -->|"fetches player MMR"| node_authservice
node_matchmakingcontroller -->|"queues players"| node_matchingjob
node_matchingjob -->|"requests match creation"| node_matchclient
node_matchclient -->|"creates match"| node_matchroutes
node_matchroutes -->|"dispatches"| node_matchcontroller
node_matchcontroller -->|"reads/writes"| node_matchdb
node_matchcontroller -->|"sends approved result"| node_eloclient
node_eloclient -->|"applies result"| node_eloresult
node_eloresult -->|"calculates rating change"| node_elomath
node_eloresult -->|"reads/writes history &amp; baseline"| node_elodb
node_eloresult -->|"gets/sets player Elo"| node_authclient
node_authclient -->|"reads/writes Elo"| node_internalroutes
node_internalroutes -->|"dispatches"| node_authcontroller

click node_webapp "https://github.com/enkh-ebash/-mlbb_alpha/tree/main/web/app"
click node_webapi "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/web/lib/api.ts"
click node_authroutes "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/auth-service/src/routes/auth.routes.ts"
click node_authcontroller "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/auth-service/src/controllers/auth.controller.ts"
click node_authdb "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/auth-service/src/config/db.ts"
click node_internalroutes "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/auth-service/src/routes/internal.routes.ts"
click node_matchmakingroutes "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/matchmaking-service/src/routes/matchmaking.routes.ts"
click node_matchmakingcontroller "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/matchmaking-service/src/controllers/matchmaking.controller.ts"
click node_matchingjob "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/matchmaking-service/src/jobs/matching.job.ts"
click node_matchclient "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/matchmaking-service/src/services/match-client.ts"
click node_matchroutes "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/match-service/src/routes/match.routes.ts"
click node_matchcontroller "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/match-service/src/controllers/match.controller.ts"
click node_matchdb "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/match-service/src/config/db.ts"
click node_eloclient "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/match-service/src/services/elo-client.ts"
click node_eloresult "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/elo-service/src/controllers/elo.controller.ts"
click node_elomath "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/elo-service/src/services/elo-math.ts"
click node_elodb "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/elo-service/src/config/db.ts"
click node_authclient "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/elo-service/src/services/auth-client.ts"
click node_hero "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/hero-service/src/controllers/hero.controller.ts"
click node_team "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/team-service/src/controllers/team.controller.ts"
click node_tournament "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/tournament-service/src/index.ts"
click node_news "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/news-service/src/index.ts"
click node_notifications "https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/notification-service/src/index.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_webapi toneBlue
class node_authroutes,node_authcontroller,node_authdb,node_internalroutes toneAmber
class node_matchmakingroutes,node_matchmakingcontroller,node_matchingjob,node_matchclient,node_matchroutes,node_matchcontroller,node_matchdb,node_eloclient toneMint
class node_eloresult,node_elomath,node_elodb,node_authclient toneRose
class node_hero,node_team,node_tournament,node_news,node_notifications,node_player,node_authservice toneIndigo
```

## Components

### Player Web App

- [Web Pages](https://github.com/enkh-ebash/-mlbb_alpha/tree/main/web/app): `web/app`
- [API Client](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/web/lib/api.ts): `web/lib/api.ts`

### Identity & Profiles

- [Auth Routes](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/auth-service/src/routes/auth.routes.ts): `services/auth-service/src/routes/auth.routes.ts`
- [Accounts & Profiles](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/auth-service/src/controllers/auth.controller.ts): `services/auth-service/src/controllers/auth.controller.ts`
- [Auth Store](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/auth-service/src/config/db.ts): `services/auth-service/src/config/db.ts`
- [Internal User API](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/auth-service/src/routes/internal.routes.ts): `services/auth-service/src/routes/internal.routes.ts`

### Match Competition

- [Queue Routes](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/matchmaking-service/src/routes/matchmaking.routes.ts): `services/matchmaking-service/src/routes/matchmaking.routes.ts`
- [Queue Management](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/matchmaking-service/src/controllers/matchmaking.controller.ts): `services/matchmaking-service/src/controllers/matchmaking.controller.ts`
- [Pairing Job](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/matchmaking-service/src/jobs/matching.job.ts): `services/matchmaking-service/src/jobs/matching.job.ts`
- [Match Client](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/matchmaking-service/src/services/match-client.ts): `services/matchmaking-service/src/services/match-client.ts`
- [Match Routes](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/match-service/src/routes/match.routes.ts): `services/match-service/src/routes/match.routes.ts`
- [Match & Review](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/match-service/src/controllers/match.controller.ts): `services/match-service/src/controllers/match.controller.ts`
- [Match Store](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/match-service/src/config/db.ts): `services/match-service/src/config/db.ts`
- [Elo Client](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/match-service/src/services/elo-client.ts): `services/match-service/src/services/elo-client.ts`

### Ratings

- [Elo Result API](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/elo-service/src/controllers/elo.controller.ts): `services/elo-service/src/controllers/elo.controller.ts`
- [Elo Calculation](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/elo-service/src/services/elo-math.ts): `services/elo-service/src/services/elo-math.ts`
- [Rating Store](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/elo-service/src/config/db.ts): `services/elo-service/src/config/db.ts`
- [Auth Elo Client](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/elo-service/src/services/auth-client.ts): `services/elo-service/src/services/auth-client.ts`

### Platform Extensions

- [Hero Catalog](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/hero-service/src/controllers/hero.controller.ts): `services/hero-service/src/controllers/hero.controller.ts`
- [Team Management](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/team-service/src/controllers/team.controller.ts): `services/team-service/src/controllers/team.controller.ts`
- [Tournaments](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/tournament-service/src/index.ts): `services/tournament-service/src/index.ts`
- [News](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/news-service/src/index.ts): `services/news-service/src/index.ts`
- [Notifications & Chat](https://github.com/enkh-ebash/-mlbb_alpha/blob/main/services/notification-service/src/index.ts): `services/notification-service/src/index.ts`

### Other components

- **Player**
- **Auth Service**

## Connections

- Player → Web Pages: uses
- Web Pages → API Client: API requests
- API Client → Auth Routes: auth calls
- API Client → Queue Routes: queue calls
- API Client → Match Routes: match calls
- API Client → Team Management: team requests
- API Client → Hero Catalog: hero requests
- API Client → Tournaments: tournament requests
- API Client → News: news requests
- Auth Routes → Accounts & Profiles: dispatches
- Accounts & Profiles → Auth Store: reads/writes
- Accounts & Profiles → Player: returns token/profile
- Queue Routes → Queue Management: dispatches
- Queue Management → Auth Service: fetches player MMR
- Queue Management → Pairing Job: queues players
- Pairing Job → Match Client: requests match creation
- Match Client → Match Routes: creates match
- Match Routes → Match & Review: dispatches
- Match & Review → Match Store: reads/writes
- Match & Review → Elo Client: sends approved result
- Elo Client → Elo Result API: applies result
- Elo Result API → Elo Calculation: calculates rating change
- Elo Result API → Rating Store: reads/writes history & baseline
- Elo Result API → Auth Elo Client: gets/sets player Elo
- Auth Elo Client → Internal User API: reads/writes Elo
- Internal User API → Accounts & Profiles: dispatches
