# chetan-1-hash/criclively architecture

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

- Interactive diagram: https://gitdiagram.com/chetan-1-hash/criclively
- Repository: https://github.com/chetan-1-hash/criclively

## Overview

CricLively is a cricket tournament and match-management application: users register and manage profiles, organizers configure tournaments, teams, and matches, scorers record ball-by-ball play, and users view match and tournament information. The frontend routes these experiences and shares an HTTP client; the backend exposes REST controllers, applies domain services, and persists application data through repositories. The excerpts establish player/profile and scoring paths particularly well; several other capabilities are visible in the route tree but their internal calls were not sampled, so those links are omitted.

Main entry points: [`Frontend/CricLively/src/App.tsx`](https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/App.tsx) (Application routes), [`Backend/CricLively/src/main/java/com/CricLively/Service/ProfileService.java`](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/ProfileService.java) (Profile service), [`Backend/CricLively/src/main/java/com/CricLively/Service/ScoringService.java`](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/ScoringService.java) (Scoring rules), [`Backend/CricLively/src/main/java/com/CricLively/Service/PlayerService.java`](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/PlayerService.java) (Player service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Application routes<br/>[App.tsx]"]
  node_webapi["HTTP client<br/>[client.ts]"]
  node_profileui["Profile experiences<br/>[ProfilePage.tsx]"]
  node_matchui["Match experiences<br/>[Matches.tsx]"]
  node_tournamentui["Tournament dashboard"]
  node_scorerui["Scorer interface<br/>[Scorer.tsx]"]
  node_viewerui["Score viewer<br/>[viewer.tsx]"]
end

subgraph group_identity["Identity and players"]
  node_playercontroller["Player endpoints"]
  node_profilecontroller["Profile endpoints"]
  node_profileservice["Profile service"]
  node_playerservice["Player service<br/>[PlayerService.java]"]
  node_playerentity["Player records<br/>[Player.java]"]
  node_profiledto["Profile list DTO<br/>[ProfileList.java]"]
  node_roles["Account roles<br/>[Role.java]"]
end

subgraph group_competition["Competition management"]
  node_matchservice["Match service<br/>[MatchService.java]"]
end

subgraph group_liveplay["Live scoring"]
  node_scoringcontroller["Scoring endpoints"]
  node_scoringservice["Scoring rules"]
end

subgraph group_persistence["Persistence"]
  node_playerrepo[("Player repository")]
  node_profilerepo[("Profile repository")]
  node_imagestore["Image storage"]
  node_teamrepo[("Team repository")]
  node_tournamentrepo[("Tournament repository")]
  node_ballrepo[("Ball repository")]
  node_matchrepo[("Match repository")]
end

node_user(("User"))
node_gridfs[("Mongo GridFS")]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_profileui
node_app -->|"routes to"| node_matchui
node_app -->|"routes to"| node_tournamentui
node_app -->|"routes to"| node_scorerui
node_app -->|"routes to"| node_viewerui
node_webapi -->|"requests"| node_user
node_playercontroller -->|"registers via"| node_profileservice
node_playercontroller -->|"updates via"| node_playerservice
node_profilecontroller -->|"delegates to"| node_profileservice
node_profileservice -->|"accesses players"| node_playerrepo
node_profileservice -->|"accesses profiles"| node_profilerepo
node_playerservice -->|"loads and saves"| node_playerrepo
node_playerservice -->|"stores images"| node_imagestore
node_imagestore -->|"stores and loads"| node_gridfs
node_matchservice -->|"looks up teams"| node_teamrepo
node_matchservice -->|"looks up tournaments"| node_tournamentrepo
node_scoringcontroller -->|"dispatches scoring"| node_scoringservice
node_scoringservice -->|"reads and writes balls"| node_ballrepo
node_scoringservice -->|"loads and saves matches"| node_matchrepo
node_scoringservice -->|"loads player names"| node_playerrepo
node_profileservice -->|"maps profiles"| node_profiledto

click node_app "https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/App.tsx"
click node_webapi "https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/API/client.ts"
click node_profileui "https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/components/ProfilePage.tsx"
click node_matchui "https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/components/Matches.tsx"
click node_tournamentui "https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/components/DashboardTournament.tsx"
click node_scorerui "https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/components/Scorer.tsx"
click node_viewerui "https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/components/viewer.tsx"
click node_playercontroller "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/RestController/PlayerController.java"
click node_profilecontroller "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/RestController/ProfileController.java"
click node_profileservice "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/ProfileService.java"
click node_playerservice "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/PlayerService.java"
click node_playerrepo "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/PlayerRepository.java"
click node_profilerepo "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/ProfileRepository.java"
click node_imagestore "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/ImageStorageService.java"
click node_matchservice "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/MatchService.java"
click node_teamrepo "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/TeamRepository.java"
click node_tournamentrepo "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/TournamentRepository.java"
click node_scoringcontroller "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/RestController/ScoringController.java"
click node_scoringservice "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/ScoringService.java"
click node_ballrepo "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/BallByBallRepository.java"
click node_matchrepo "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/MatchRepository.java"
click node_playerentity "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Entities/Player.java"
click node_profiledto "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/DTO/ProfileList.java"
click node_roles "https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Entities/Enums/Role.java"

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_webapi,node_profileui,node_matchui,node_tournamentui,node_scorerui,node_viewerui,node_user toneBlue
class node_playercontroller,node_profilecontroller,node_profileservice,node_playerservice,node_playerentity,node_profiledto,node_roles,node_gridfs toneAmber
class node_matchservice toneMint
class node_scoringcontroller,node_scoringservice toneRose
class node_playerrepo,node_profilerepo,node_imagestore,node_teamrepo,node_tournamentrepo,node_ballrepo,node_matchrepo toneIndigo
```

## Components

### Web application

- [Application routes](https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/App.tsx): `Frontend/CricLively/src/App.tsx`
- [HTTP client](https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/API/client.ts): `Frontend/CricLively/src/API/client.ts`
- [Profile experiences](https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/components/ProfilePage.tsx): `Frontend/CricLively/src/components/ProfilePage.tsx`
- [Match experiences](https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/components/Matches.tsx): `Frontend/CricLively/src/components/Matches.tsx`
- [Tournament dashboard](https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/components/DashboardTournament.tsx): `Frontend/CricLively/src/components/DashboardTournament.tsx`
- [Scorer interface](https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/components/Scorer.tsx): `Frontend/CricLively/src/components/Scorer.tsx`
- [Score viewer](https://github.com/chetan-1-hash/criclively/blob/main/Frontend/CricLively/src/components/viewer.tsx): `Frontend/CricLively/src/components/viewer.tsx`

### Identity and players

- [Player endpoints](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/RestController/PlayerController.java): `Backend/CricLively/src/main/java/com/CricLively/RestController/PlayerController.java`
- [Profile endpoints](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/RestController/ProfileController.java): `Backend/CricLively/src/main/java/com/CricLively/RestController/ProfileController.java`
- [Profile service](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/ProfileService.java): `Backend/CricLively/src/main/java/com/CricLively/Service/ProfileService.java`
- [Player service](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/PlayerService.java): `Backend/CricLively/src/main/java/com/CricLively/Service/PlayerService.java`
- [Player records](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Entities/Player.java): `Backend/CricLively/src/main/java/com/CricLively/Entities/Player.java`
- [Profile list DTO](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/DTO/ProfileList.java): `Backend/CricLively/src/main/java/com/CricLively/DTO/ProfileList.java`
- [Account roles](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Entities/Enums/Role.java): `Backend/CricLively/src/main/java/com/CricLively/Entities/Enums/Role.java`

### Competition management

- [Match service](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/MatchService.java): `Backend/CricLively/src/main/java/com/CricLively/Service/MatchService.java`

### Live scoring

- [Scoring endpoints](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/RestController/ScoringController.java): `Backend/CricLively/src/main/java/com/CricLively/RestController/ScoringController.java`
- [Scoring rules](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/ScoringService.java): `Backend/CricLively/src/main/java/com/CricLively/Service/ScoringService.java`

### Persistence

- [Player repository](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/PlayerRepository.java): `Backend/CricLively/src/main/java/com/CricLively/Repository/PlayerRepository.java`
- [Profile repository](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/ProfileRepository.java): `Backend/CricLively/src/main/java/com/CricLively/Repository/ProfileRepository.java`
- [Image storage](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Service/ImageStorageService.java): `Backend/CricLively/src/main/java/com/CricLively/Service/ImageStorageService.java`
- [Team repository](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/TeamRepository.java): `Backend/CricLively/src/main/java/com/CricLively/Repository/TeamRepository.java`
- [Tournament repository](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/TournamentRepository.java): `Backend/CricLively/src/main/java/com/CricLively/Repository/TournamentRepository.java`
- [Ball repository](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/BallByBallRepository.java): `Backend/CricLively/src/main/java/com/CricLively/Repository/BallByBallRepository.java`
- [Match repository](https://github.com/chetan-1-hash/criclively/blob/main/Backend/CricLively/src/main/java/com/CricLively/Repository/MatchRepository.java): `Backend/CricLively/src/main/java/com/CricLively/Repository/MatchRepository.java`

### Other components

- **User**
- **Mongo GridFS**

## Connections

- User → Application routes: uses
- Application routes → Profile experiences: routes to (evidence: `Frontend/CricLively/src/App.tsx`)
- Application routes → Match experiences: routes to (evidence: `Frontend/CricLively/src/App.tsx`)
- Application routes → Tournament dashboard: routes to (evidence: `Frontend/CricLively/src/App.tsx`)
- Application routes → Scorer interface: routes to (evidence: `Frontend/CricLively/src/App.tsx`)
- Application routes → Score viewer: routes to (evidence: `Frontend/CricLively/src/App.tsx`)
- HTTP client → User: requests (evidence: `Frontend/CricLively/src/API/client.ts`)
- Player endpoints → Profile service: registers via (evidence: `Backend/CricLively/src/main/java/com/CricLively/RestController/PlayerController.java`)
- Player endpoints → Player service: updates via (evidence: `Backend/CricLively/src/main/java/com/CricLively/RestController/PlayerController.java`)
- Profile endpoints → Profile service: delegates to (evidence: `Backend/CricLively/src/main/java/com/CricLively/RestController/ProfileController.java`)
- Profile service → Player repository: accesses players (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/ProfileService.java`)
- Profile service → Profile repository: accesses profiles (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/ProfileService.java`)
- Player service → Player repository: loads and saves (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/PlayerService.java`)
- Player service → Image storage: stores images (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/PlayerService.java`)
- Image storage → Mongo GridFS: stores and loads (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/ImageStorageService.java`)
- Match service → Team repository: looks up teams (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/MatchService.java`)
- Match service → Tournament repository: looks up tournaments (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/MatchService.java`)
- Scoring endpoints → Scoring rules: dispatches scoring (evidence: `Backend/CricLively/src/main/java/com/CricLively/RestController/ScoringController.java`)
- Scoring rules → Ball repository: reads and writes balls (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/ScoringService.java`)
- Scoring rules → Match repository: loads and saves matches (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/ScoringService.java`)
- Scoring rules → Player repository: loads player names (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/ScoringService.java`)
- Profile service → Profile list DTO: maps profiles (evidence: `Backend/CricLively/src/main/java/com/CricLively/Service/ProfileService.java`)
