# doyelg/fulbitogm architecture

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

- Interactive diagram: https://gitdiagram.com/doyelg/fulbitogm
- Repository: https://github.com/doyelg/fulbitogm

## Overview

FulbitoGM is a football-match management product with web and mobile clients, shared Firebase-backed services, and a read-only MCP server for Claude. The main user workflow spans tournament and player management, match preparation and recording, then match history and statistics; related capabilities include awards, comments, video clips, and notifications. Arrows reflect the sampled source index, excerpts, or README. Many feature implementations were not sampled, so their internal calls are not expanded.

Main entry points: [`apps/web/src/app`](https://github.com/doyelg/fulbitogm/tree/master/apps/web/src/app) (Web App), [`packages/firebase/src/tournaments.ts`](https://github.com/doyelg/fulbitogm/blob/master/packages/firebase/src/tournaments.ts) (Firebase Client Services), [`apps/web/src/app/match/matchClient.tsx`](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/match/matchClient.tsx) (Match Preparation), [`apps/mcp/src/tools`](https://github.com/doyelg/fulbitogm/tree/master/apps/mcp/src/tools) (Read-only Tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Web and Mobile"]
  node_web["Web App"]
  node_mobile["Mobile App"]
  node_players["Player Management<br/>[playersClient.tsx]"]
  node_statistics["Statistics"]
  node_home["Home and Leaderboards"]
  node_awards["Awards<br/>[awardsClient.tsx]"]
end

subgraph group_match["Match Lifecycle"]
  node_matchprep["Match Preparation<br/>[matchClient.tsx]"]
  node_matchform["Match Forms<br/>[draftForm.tsx]"]
  node_history["Match History<br/>[historyClient.tsx]"]
end

subgraph group_community["Tournament Community"]
  node_tournaments["Tournament Management"]
  node_tournamentdetail["Tournament Details"]
  node_members["Members and Requests"]
  node_comments["Comments and Messaging"]
  node_clips["Video Clips"]
end

subgraph group_shared["Shared Services"]
  node_addresses["Court Addresses"]
  node_image["Match Image API<br/>[route.tsx]"]
  node_firebase["Firebase Client Services<br/>[tournaments.ts]"]
  node_types["Domain Types<br/>[match.ts]"]
  node_utils["Domain Utilities<br/>[match.ts]"]
end

subgraph group_assistant["MCP Access"]
  node_mcp["MCP Server<br/>[index.ts]"]
  node_mcp_tools["Read-only Tools"]
  node_mcp_firebase["MCP Firebase Session<br/>[firebase.ts]"]
  node_mcp_result["Tool Results<br/>[tool-result.ts]"]
end

node_user(("Players and Managers"))
node_firebase_service[("Firebase")]
node_mcp_client(("Claude MCP Client"))

node_user -->|"uses"| node_web
node_user -->|"uses"| node_mobile
node_web -->|"manages players"| node_players
node_web -->|"prepares matches"| node_matchprep
node_matchprep -->|"uses form"| node_matchform
node_web -->|"views history"| node_history
node_web -->|"views statistics"| node_statistics
node_web -.->|"views dashboard"| node_home
node_web -->|"views awards"| node_awards
node_web -->|"manages tournaments"| node_tournaments
node_web -->|"views details"| node_tournamentdetail
node_web -.->|"manages members"| node_members
node_web -->|"manages comments"| node_comments
node_web -.->|"views clips"| node_clips
node_web -->|"manages courts"| node_addresses
node_web -.->|"requests image"| node_image
node_matchprep -->|"balances teams"| node_utils
node_history -->|"parses dates"| node_utils
node_statistics -->|"uses calculations"| node_utils
node_awards -->|"calculates awards"| node_utils
node_matchprep -->|"uses match types"| node_types
node_history -->|"uses match types"| node_types
node_tournaments -->|"loads drafts"| node_firebase
node_comments -->|"reads and writes"| node_firebase
node_firebase -.->|"persists data"| node_firebase_service
node_mobile -.->|"uses shared services"| node_firebase
node_mcp_client -->|"sends tool requests"| node_mcp
node_mcp -.->|"dispatches tools"| node_mcp_tools
node_mcp_tools -->|"authenticates session"| node_mcp_firebase
node_mcp_tools -->|"formats results"| node_mcp_result
node_mcp_firebase -->|"signs in"| node_firebase
node_mcp_tools -->|"queries data"| node_firebase

click node_web "https://github.com/doyelg/fulbitogm/tree/master/apps/web/src/app"
click node_mobile "https://github.com/doyelg/fulbitogm/tree/master/apps/mobile/app"
click node_players "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/players/playersClient.tsx"
click node_matchprep "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/match/matchClient.tsx"
click node_matchform "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/match/draftForm.tsx"
click node_history "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/history/historyClient.tsx"
click node_statistics "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/statistics/statisticsClient.tsx"
click node_home "https://github.com/doyelg/fulbitogm/tree/master/apps/web/src/components/home"
click node_awards "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/awards/awardsClient.tsx"
click node_tournaments "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/tournaments/tournamentsClient.tsx"
click node_tournamentdetail "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/tournaments/%5Bid%5D/tournamentDetailClient.tsx"
click node_members "https://github.com/doyelg/fulbitogm/tree/master/apps/web/src/app/tournaments/%5Bid%5D/members"
click node_comments "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/store/useTournamentDetailStore.ts"
click node_clips "https://github.com/doyelg/fulbitogm/tree/master/apps/web/src/components/videoClips"
click node_addresses "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/components/addresses/AddressManagerModal.tsx"
click node_image "https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/api/match-image/route.tsx"
click node_firebase "https://github.com/doyelg/fulbitogm/blob/master/packages/firebase/src/tournaments.ts"
click node_types "https://github.com/doyelg/fulbitogm/blob/master/packages/types/src/match.ts"
click node_utils "https://github.com/doyelg/fulbitogm/blob/master/packages/utils/src/match.ts"
click node_mcp "https://github.com/doyelg/fulbitogm/blob/master/apps/mcp/src/index.ts"
click node_mcp_tools "https://github.com/doyelg/fulbitogm/tree/master/apps/mcp/src/tools"
click node_mcp_firebase "https://github.com/doyelg/fulbitogm/blob/master/apps/mcp/src/firebase.ts"
click node_mcp_result "https://github.com/doyelg/fulbitogm/blob/master/apps/mcp/src/tool-result.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_web,node_mobile,node_players,node_statistics,node_home,node_awards,node_mcp_client toneBlue
class node_matchprep,node_matchform,node_history,node_firebase_service toneAmber
class node_tournaments,node_tournamentdetail,node_members,node_comments,node_clips toneMint
class node_addresses,node_image,node_firebase,node_types,node_utils toneRose
class node_mcp,node_mcp_tools,node_mcp_firebase,node_mcp_result,node_user toneIndigo
```

## Components

### Web and Mobile

- [Web App](https://github.com/doyelg/fulbitogm/tree/master/apps/web/src/app): `apps/web/src/app`
- [Mobile App](https://github.com/doyelg/fulbitogm/tree/master/apps/mobile/app): `apps/mobile/app`
- [Player Management](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/players/playersClient.tsx): `apps/web/src/app/players/playersClient.tsx`
- [Statistics](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/statistics/statisticsClient.tsx): `apps/web/src/app/statistics/statisticsClient.tsx`
- [Home and Leaderboards](https://github.com/doyelg/fulbitogm/tree/master/apps/web/src/components/home): `apps/web/src/components/home`
- [Awards](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/awards/awardsClient.tsx): `apps/web/src/app/awards/awardsClient.tsx`

### Match Lifecycle

- [Match Preparation](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/match/matchClient.tsx): `apps/web/src/app/match/matchClient.tsx`
- [Match Forms](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/match/draftForm.tsx): `apps/web/src/app/match/draftForm.tsx`
- [Match History](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/history/historyClient.tsx): `apps/web/src/app/history/historyClient.tsx`

### Tournament Community

- [Tournament Management](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/tournaments/tournamentsClient.tsx): `apps/web/src/app/tournaments/tournamentsClient.tsx`
- [Tournament Details](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/tournaments/%5Bid%5D/tournamentDetailClient.tsx): `apps/web/src/app/tournaments/[id]/tournamentDetailClient.tsx`
- [Members and Requests](https://github.com/doyelg/fulbitogm/tree/master/apps/web/src/app/tournaments/%5Bid%5D/members): `apps/web/src/app/tournaments/[id]/members`
- [Comments and Messaging](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/store/useTournamentDetailStore.ts): `apps/web/src/store/useTournamentDetailStore.ts`
- [Video Clips](https://github.com/doyelg/fulbitogm/tree/master/apps/web/src/components/videoClips): `apps/web/src/components/videoClips`

### Shared Services

- [Court Addresses](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/components/addresses/AddressManagerModal.tsx): `apps/web/src/components/addresses/AddressManagerModal.tsx`
- [Match Image API](https://github.com/doyelg/fulbitogm/blob/master/apps/web/src/app/api/match-image/route.tsx): `apps/web/src/app/api/match-image/route.tsx`
- [Firebase Client Services](https://github.com/doyelg/fulbitogm/blob/master/packages/firebase/src/tournaments.ts): `packages/firebase/src/tournaments.ts`
- [Domain Types](https://github.com/doyelg/fulbitogm/blob/master/packages/types/src/match.ts): `packages/types/src/match.ts`
- [Domain Utilities](https://github.com/doyelg/fulbitogm/blob/master/packages/utils/src/match.ts): `packages/utils/src/match.ts`

### MCP Access

- [MCP Server](https://github.com/doyelg/fulbitogm/blob/master/apps/mcp/src/index.ts): `apps/mcp/src/index.ts`
- [Read-only Tools](https://github.com/doyelg/fulbitogm/tree/master/apps/mcp/src/tools): `apps/mcp/src/tools`
- [MCP Firebase Session](https://github.com/doyelg/fulbitogm/blob/master/apps/mcp/src/firebase.ts): `apps/mcp/src/firebase.ts`
- [Tool Results](https://github.com/doyelg/fulbitogm/blob/master/apps/mcp/src/tool-result.ts): `apps/mcp/src/tool-result.ts`

### Other components

- **Players and Managers**
- **Firebase**
- **Claude MCP Client**

## Connections

- Players and Managers → Web App: uses (evidence: `README.md`)
- Players and Managers → Mobile App: uses (evidence: `README.md`)
- Web App → Player Management: manages players (evidence: `apps/web/src/app/players/playersClient.tsx`)
- Web App → Match Preparation: prepares matches (evidence: `apps/web/src/app/match/matchClient.tsx`)
- Match Preparation → Match Forms: uses form (evidence: `apps/web/src/app/match/matchClient.tsx`)
- Web App → Match History: views history (evidence: `apps/web/src/app/history/historyClient.tsx`)
- Web App → Statistics: views statistics (evidence: `apps/web/src/app/statistics/statisticsClient.tsx`)
- Web App → Home and Leaderboards: views dashboard
- Web App → Awards: views awards (evidence: `apps/web/src/app/awards/awardsClient.tsx`)
- Web App → Tournament Management: manages tournaments (evidence: `apps/web/src/app/tournaments/tournamentsClient.tsx`)
- Web App → Tournament Details: views details (evidence: `apps/web/src/app/tournaments/[id]/tournamentDetailClient.tsx`)
- Web App → Members and Requests: manages members
- Web App → Comments and Messaging: manages comments (evidence: `apps/web/src/store/useTournamentDetailStore.ts`)
- Web App → Video Clips: views clips
- Web App → Court Addresses: manages courts (evidence: `apps/web/src/components/addresses/AddressManagerModal.tsx`)
- Web App → Match Image API: requests image (evidence: `apps/web/src/app/api/match-image/route.tsx`)
- Match Preparation → Domain Utilities: balances teams (evidence: `apps/web/src/app/match/matchClient.tsx`)
- Match History → Domain Utilities: parses dates (evidence: `apps/web/src/app/history/historyClient.tsx`)
- Statistics → Domain Utilities: uses calculations (evidence: `apps/web/src/app/statistics/statisticsClient.tsx`)
- Awards → Domain Utilities: calculates awards (evidence: `apps/web/src/app/awards/awardsClient.tsx`)
- Match Preparation → Domain Types: uses match types (evidence: `apps/web/src/app/match/matchClient.tsx`)
- Match History → Domain Types: uses match types (evidence: `apps/web/src/app/history/historyClient.tsx`)
- Tournament Management → Firebase Client Services: loads drafts (evidence: `apps/web/src/app/tournaments/tournamentsClient.tsx`)
- Comments and Messaging → Firebase Client Services: reads and writes (evidence: `apps/web/src/store/useTournamentDetailStore.ts`)
- Firebase Client Services → Firebase: persists data
- Mobile App → Firebase Client Services: uses shared services
- Claude MCP Client → MCP Server: sends tool requests (evidence: `README.md`)
- MCP Server → Read-only Tools: dispatches tools
- Read-only Tools → MCP Firebase Session: authenticates session (evidence: `apps/mcp/src/tools/stats.ts`)
- Read-only Tools → Tool Results: formats results (evidence: `apps/mcp/src/tools/stats.ts`)
- MCP Firebase Session → Firebase Client Services: signs in (evidence: `apps/mcp/src/firebase.ts`)
- Read-only Tools → Firebase Client Services: queries data (evidence: `apps/mcp/src/tools/stats.ts`)
