# 1burhanuddin/cricheros-app architecture

> Architecture diagram of the GitHub repository 1burhanuddin/cricheros-app, 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/1burhanuddin/cricheros-app
- Repository: https://github.com/1burhanuddin/cricheros-app

## Overview

CricHeros is documented as a Flutter cricket scoring and tournament-management app backed by Firebase. Its user journey spans sign-in, team and match setup, live scoring, and sharing or following scorecards; tournaments, profiles, statistics, and notifications are additional product capabilities. The supplied tree exposes backend functions and platform launchers, but not Flutter feature code, so app-stage connections are documented or unverified rather than implementation-level claims. Backend relationships below are based on sampled service/repository code; UI and Firebase client flows are not sampled.

Main entry points: [`khelo`](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo) (Flutter app), [`khelo/functions/src/user/user_repository.js`](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/user/user_repository.js) (User repository), [`khelo/functions/src/index.js`](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/index.js) (Function entry and wiring), [`khelo/functions/src/match/match_service.js`](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/match/match_service.js) (Match service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Flutter product"]
  node_app["Flutter app"]
  node_identity["Authentication"]
  node_team_setup["Team and squad setup"]
  node_match_setup["Match setup"]
  node_live_scoring["Ball-by-ball scoring"]
  node_tournaments["Tournament management"]
  node_profiles["Team and player profiles"]
  node_statistics["Player statistics"]
  node_scorecards["Shareable scorecards"]
  node_match_feed["Public match feed"]
end

subgraph group_backend["Cloud functions"]
  node_backend_entry["Function entry and wiring<br/>[index.js]"]
  node_auth_service["Auth service<br/>[auth_service.js]"]
  node_team_service["Team service<br/>[team_service.js]"]
  node_match_service["Match service<br/>[match_service.js]"]
  node_leaderboard_service["Leaderboard service"]
  node_notification_service["Notification service"]
end

subgraph group_data["Firebase data"]
  node_user_repository["User repository<br/>[user_repository.js]"]
  node_user_store[("User records<br/>[user_repository.js]")]
  node_team_repository["Team repository<br/>[team_repository.js]"]
  node_match_repository["Match repository"]
  node_leaderboard_repository["Leaderboard repository"]
  node_leaderboard_store[("Leaderboard records")]
end

node_player(("Player or organizer"))
node_firestore[("Cloud Firestore")]
node_fcm["Firebase Cloud Messaging"]

node_player -.->|"uses"| node_app
node_app -.->|"signs in"| node_identity
node_app -.->|"sets up"| node_team_setup
node_app -.->|"configures"| node_match_setup
node_app -.->|"records deliveries"| node_live_scoring
node_app -.->|"organizes"| node_tournaments
node_app -.->|"maintains"| node_profiles
node_app -.->|"tracks"| node_statistics
node_app -.->|"shares"| node_scorecards
node_app -.->|"discovers matches"| node_match_feed
node_backend_entry -->|"wires"| node_auth_service
node_backend_entry -->|"wires"| node_team_service
node_backend_entry -->|"wires"| node_match_service
node_backend_entry -->|"wires"| node_leaderboard_service
node_backend_entry -->|"wires"| node_notification_service
node_auth_service -->|"creates user"| node_user_repository
node_user_repository -->|"reads and writes"| node_user_store
node_user_repository -->|"uses"| node_firestore
node_team_service -->|"loads players"| node_user_repository
node_team_service -->|"sends alerts"| node_notification_service
node_match_repository -->|"notifies upcoming"| node_match_service
node_match_service -->|"loads teams"| node_team_repository
node_match_service -->|"loads contributors"| node_user_repository
node_match_service -->|"sends alerts"| node_notification_service
node_leaderboard_service -->|"loads and updates stats"| node_leaderboard_repository
node_leaderboard_repository -->|"reads and writes"| node_leaderboard_store
node_leaderboard_repository -->|"uses"| node_firestore
node_notification_service -->|"loads sessions"| node_user_repository
node_notification_service -->|"sends multicast"| node_fcm

click node_app "https://github.com/1burhanuddin/cricheros-app/tree/main/khelo"
click node_identity "https://github.com/1burhanuddin/cricheros-app/tree/main/khelo"
click node_team_setup "https://github.com/1burhanuddin/cricheros-app/tree/main/khelo"
click node_match_setup "https://github.com/1burhanuddin/cricheros-app/tree/main/khelo"
click node_live_scoring "https://github.com/1burhanuddin/cricheros-app/tree/main/khelo"
click node_tournaments "https://github.com/1burhanuddin/cricheros-app/tree/main/khelo"
click node_profiles "https://github.com/1burhanuddin/cricheros-app/tree/main/khelo"
click node_statistics "https://github.com/1burhanuddin/cricheros-app/tree/main/khelo"
click node_scorecards "https://github.com/1burhanuddin/cricheros-app/tree/main/khelo"
click node_match_feed "https://github.com/1burhanuddin/cricheros-app/tree/main/khelo"
click node_backend_entry "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/index.js"
click node_auth_service "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/auth/auth_service.js"
click node_user_repository "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/user/user_repository.js"
click node_user_store "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/user/user_repository.js"
click node_team_service "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/team/team_service.js"
click node_team_repository "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/team/team_repository.js"
click node_match_service "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/match/match_service.js"
click node_match_repository "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/match/match_repository.js"
click node_leaderboard_service "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/leaderboard/leaderboard_service.js"
click node_leaderboard_repository "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/leaderboard/leaderboard_repository.js"
click node_leaderboard_store "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/leaderboard/leaderboard_repository.js"
click node_notification_service "https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/notification/notification_service.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_app,node_identity,node_team_setup,node_match_setup,node_live_scoring,node_tournaments,node_profiles,node_statistics,node_scorecards,node_match_feed toneBlue
class node_backend_entry,node_auth_service,node_team_service,node_match_service,node_leaderboard_service,node_notification_service,node_firestore toneAmber
class node_user_repository,node_user_store,node_team_repository,node_match_repository,node_leaderboard_repository,node_leaderboard_store toneMint
class node_player,node_fcm toneIndigo
```

## Components

### Flutter product

- [Flutter app](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo): `khelo`
- [Authentication](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo): `khelo`
- [Team and squad setup](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo): `khelo`
- [Match setup](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo): `khelo`
- [Ball-by-ball scoring](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo): `khelo`
- [Tournament management](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo): `khelo`
- [Team and player profiles](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo): `khelo`
- [Player statistics](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo): `khelo`
- [Shareable scorecards](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo): `khelo`
- [Public match feed](https://github.com/1burhanuddin/cricheros-app/tree/main/khelo): `khelo`

### Cloud functions

- [Function entry and wiring](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/index.js): `khelo/functions/src/index.js`
- [Auth service](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/auth/auth_service.js): `khelo/functions/src/auth/auth_service.js`
- [Team service](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/team/team_service.js): `khelo/functions/src/team/team_service.js`
- [Match service](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/match/match_service.js): `khelo/functions/src/match/match_service.js`
- [Leaderboard service](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/leaderboard/leaderboard_service.js): `khelo/functions/src/leaderboard/leaderboard_service.js`
- [Notification service](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/notification/notification_service.js): `khelo/functions/src/notification/notification_service.js`

### Firebase data

- [User repository](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/user/user_repository.js): `khelo/functions/src/user/user_repository.js`
- [User records](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/user/user_repository.js): `khelo/functions/src/user/user_repository.js`
- [Team repository](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/team/team_repository.js): `khelo/functions/src/team/team_repository.js`
- [Match repository](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/match/match_repository.js): `khelo/functions/src/match/match_repository.js`
- [Leaderboard repository](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/leaderboard/leaderboard_repository.js): `khelo/functions/src/leaderboard/leaderboard_repository.js`
- [Leaderboard records](https://github.com/1burhanuddin/cricheros-app/blob/main/khelo/functions/src/leaderboard/leaderboard_repository.js): `khelo/functions/src/leaderboard/leaderboard_repository.js`

### Other components

- **Player or organizer**
- **Cloud Firestore**
- **Firebase Cloud Messaging**

## Connections

- Player or organizer → Flutter app: uses (evidence: `README.md`)
- Flutter app → Authentication: signs in (evidence: `README.md`)
- Flutter app → Team and squad setup: sets up (evidence: `README.md`)
- Flutter app → Match setup: configures (evidence: `README.md`)
- Flutter app → Ball-by-ball scoring: records deliveries (evidence: `README.md`)
- Flutter app → Tournament management: organizes (evidence: `README.md`)
- Flutter app → Team and player profiles: maintains (evidence: `README.md`)
- Flutter app → Player statistics: tracks (evidence: `README.md`)
- Flutter app → Shareable scorecards: shares (evidence: `README.md`)
- Flutter app → Public match feed: discovers matches (evidence: `README.md`)
- Function entry and wiring → Auth service: wires (evidence: `khelo/functions/src/index.js`)
- Function entry and wiring → Team service: wires (evidence: `khelo/functions/src/index.js`)
- Function entry and wiring → Match service: wires (evidence: `khelo/functions/src/index.js`)
- Function entry and wiring → Leaderboard service: wires (evidence: `khelo/functions/src/index.js`)
- Function entry and wiring → Notification service: wires (evidence: `khelo/functions/src/index.js`)
- Auth service → User repository: creates user (evidence: `khelo/functions/src/auth/auth_service.js`)
- User repository → User records: reads and writes (evidence: `khelo/functions/src/user/user_repository.js`)
- User repository → Cloud Firestore: uses (evidence: `khelo/functions/src/user/user_repository.js`)
- Team service → User repository: loads players (evidence: `khelo/functions/src/team/team_service.js`)
- Team service → Notification service: sends alerts (evidence: `khelo/functions/src/team/team_service.js`)
- Match repository → Match service: notifies upcoming (evidence: `khelo/functions/src/match/match_repository.js`)
- Match service → Team repository: loads teams (evidence: `khelo/functions/src/match/match_service.js`)
- Match service → User repository: loads contributors (evidence: `khelo/functions/src/match/match_service.js`)
- Match service → Notification service: sends alerts (evidence: `khelo/functions/src/match/match_service.js`)
- Leaderboard service → Leaderboard repository: loads and updates stats (evidence: `khelo/functions/src/leaderboard/leaderboard_service.js`)
- Leaderboard repository → Leaderboard records: reads and writes (evidence: `khelo/functions/src/leaderboard/leaderboard_repository.js`)
- Leaderboard repository → Cloud Firestore: uses (evidence: `khelo/functions/src/leaderboard/leaderboard_repository.js`)
- Notification service → User repository: loads sessions (evidence: `khelo/functions/src/notification/notification_service.js`)
- Notification service → Firebase Cloud Messaging: sends multicast (evidence: `khelo/functions/src/notification/notification_service.js`)
