# harshitjainhj01/cricmaster architecture

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

- Interactive diagram: https://gitdiagram.com/harshitjainhj01/cricmaster
- Repository: https://github.com/harshitjainhj01/cricmaster

## Overview

CRICMASTER is a cricket web application spanning account onboarding, cricket and IPL data, match/player/team views, and supporting features such as news, search, standings, statistics, reviews, and administration. The clearest end-to-end workflow is Firebase sign-in in the browser, token submission to the FastAPI auth route, and session/account persistence. The graph preserves documented-by-source-tree feature branches, but several frontend and route implementations were not sampled; their detailed calls are therefore not inferred.

Main entry points: [`backend/app/main.py`](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/main.py) (FastAPI application), [`frontend/js/auth.js`](https://github.com/harshitjainhj01/cricmaster/blob/main/frontend/js/auth.js) (Sign-in UI), [`backend/app/routes/auth.py`](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/auth.py) (Session and auth API), [`backend/app/database/connection.py`](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/database/connection.py) (Database connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_auth_ui["Sign-in UI<br/>[auth.js]"]
  node_firebase_client["Firebase client setup<br/>[firebase-config.js]"]
  node_cricket_ui["Cricket feature views<br/>[matches.js]"]
end

subgraph group_api["API features"]
  node_ipl_api["IPL archive API<br/>[ipl.py]"]
  node_extra_api["Insights and extras API<br/>[extra.py]"]
  node_auth_api["Session and auth API<br/>[auth.py]"]
  node_cricket_api["Cricket data API<br/>[cricket.py]"]
  node_matches_api["Matches API<br/>[matches.py]"]
  node_api_app["FastAPI application<br/>[main.py]"]
end

subgraph group_domain["Cricket domain"]
  node_match_data[("Matches and deliveries<br/>[match.py]")]
  node_delivery_data[("Ball-by-ball records<br/>[delivery.py]")]
  node_user_data[("Accounts and profiles<br/>[user.py]")]
end

subgraph group_storage["Persistence and integrations"]
  node_db_connection["Database connection<br/>[connection.py]"]
  node_database[("Application database")]
  node_firebase_admin["Firebase token verification<br/>[firebase_auth.py]"]
end

node_user(("Cricket fan"))
node_cricket_provider(("Cricket data provider"))
node_news_feed(("RSS news feed"))

node_user -->|"signs in"| node_auth_ui
node_auth_ui -->|"initializes"| node_firebase_client
node_auth_ui -->|"gets ID token"| node_firebase_admin
node_auth_ui -->|"posts session"| node_auth_api
node_auth_api -->|"verifies token"| node_firebase_admin
node_auth_api -->|"opens session"| node_db_connection
node_db_connection -->|"connects"| node_database
node_api_app -->|"registers route"| node_auth_api
node_api_app -->|"registers route"| node_cricket_api
node_api_app -->|"registers route"| node_matches_api
node_api_app -->|"registers route"| node_ipl_api
node_api_app -->|"registers route"| node_extra_api
node_ipl_api -->|"queries database"| node_db_connection
node_extra_api -->|"queries database"| node_db_connection
node_extra_api -->|"fetches RSS"| node_news_feed
node_cricket_api -.->|"requests data"| node_cricket_provider
node_matches_api -.->|"requests data"| node_cricket_provider
node_cricket_ui -.->|"loads IPL data"| node_ipl_api

click node_auth_ui "https://github.com/harshitjainhj01/cricmaster/blob/main/frontend/js/auth.js"
click node_firebase_client "https://github.com/harshitjainhj01/cricmaster/blob/main/frontend/js/firebase-config.js"
click node_cricket_ui "https://github.com/harshitjainhj01/cricmaster/blob/main/frontend/js/matches.js"
click node_ipl_api "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/ipl.py"
click node_extra_api "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/extra.py"
click node_auth_api "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/auth.py"
click node_cricket_api "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/cricket.py"
click node_matches_api "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/matches.py"
click node_match_data "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/models/match.py"
click node_delivery_data "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/models/delivery.py"
click node_user_data "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/models/user.py"
click node_db_connection "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/database/connection.py"
click node_firebase_admin "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/services/firebase_auth.py"
click node_api_app "https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/main.py"

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_auth_ui,node_firebase_client,node_cricket_ui toneBlue
class node_ipl_api,node_extra_api,node_auth_api,node_cricket_api,node_matches_api,node_api_app toneAmber
class node_match_data,node_delivery_data,node_user_data toneMint
class node_db_connection,node_database,node_firebase_admin toneRose
class node_user,node_cricket_provider,node_news_feed toneIndigo
```

## Components

### Web client

- [Sign-in UI](https://github.com/harshitjainhj01/cricmaster/blob/main/frontend/js/auth.js): `frontend/js/auth.js`
- [Firebase client setup](https://github.com/harshitjainhj01/cricmaster/blob/main/frontend/js/firebase-config.js): `frontend/js/firebase-config.js`
- [Cricket feature views](https://github.com/harshitjainhj01/cricmaster/blob/main/frontend/js/matches.js): `frontend/js/matches.js`

### API features

- [IPL archive API](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/ipl.py): `backend/app/routes/ipl.py`
- [Insights and extras API](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/extra.py): `backend/app/routes/extra.py`
- [Session and auth API](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/auth.py): `backend/app/routes/auth.py`
- [Cricket data API](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/cricket.py): `backend/app/routes/cricket.py`
- [Matches API](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/routes/matches.py): `backend/app/routes/matches.py`
- [FastAPI application](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/main.py): `backend/app/main.py`

### Cricket domain

- [Matches and deliveries](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/models/match.py): `backend/app/models/match.py`
- [Ball-by-ball records](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/models/delivery.py): `backend/app/models/delivery.py`
- [Accounts and profiles](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/models/user.py): `backend/app/models/user.py`

### Persistence and integrations

- [Database connection](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/database/connection.py): `backend/app/database/connection.py`
- **Application database**
- [Firebase token verification](https://github.com/harshitjainhj01/cricmaster/blob/main/backend/app/services/firebase_auth.py): `backend/app/services/firebase_auth.py`

### Other components

- **Cricket fan**
- **Cricket data provider**
- **RSS news feed**

## Connections

- Cricket fan → Sign-in UI: signs in (evidence: `frontend/js/auth.js`)
- Sign-in UI → Firebase client setup: initializes (evidence: `frontend/js/auth.js`)
- Sign-in UI → Firebase token verification: gets ID token (evidence: `frontend/js/auth.js`)
- Sign-in UI → Session and auth API: posts session (evidence: `frontend/js/auth.js`)
- Session and auth API → Firebase token verification: verifies token (evidence: `backend/app/routes/auth.py`)
- Session and auth API → Database connection: opens session (evidence: `backend/app/routes/auth.py`)
- Database connection → Application database: connects (evidence: `backend/app/database/connection.py`)
- FastAPI application → Session and auth API: registers route (evidence: `backend/app/main.py`)
- FastAPI application → Cricket data API: registers route (evidence: `backend/app/main.py`)
- FastAPI application → Matches API: registers route (evidence: `backend/app/main.py`)
- FastAPI application → IPL archive API: registers route (evidence: `backend/app/main.py`)
- FastAPI application → Insights and extras API: registers route (evidence: `backend/app/main.py`)
- IPL archive API → Database connection: queries database (evidence: `backend/app/routes/ipl.py`)
- Insights and extras API → Database connection: queries database (evidence: `backend/app/routes/extra.py`)
- Insights and extras API → RSS news feed: fetches RSS (evidence: `backend/app/routes/extra.py`)
- Cricket data API → Cricket data provider: requests data
- Matches API → Cricket data provider: requests data
- Cricket feature views → IPL archive API: loads IPL data
