# sirfilips/centmeta-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/sirfilips/centmeta-frontend
- Repository: https://github.com/sirfilips/centmeta-frontend

## Overview

CentMeta is a frontend for Centurion Commander metagame analysis. The main journey is from the dashboard’s unified search and filters to commander or card statistics, with drag-and-drop deckbuilding as an action; separate areas provide community voting/rankings and historical trends. The README documents FastAPI and Scryfall integrations, while the supplied excerpts do not show the API calls or most community-page data wiring, so those connections are not asserted as observed runtime calls.

Main entry points: [`components/CentMetaApp.tsx`](https://github.com/sirfilips/centmeta-frontend/blob/main/components/CentMetaApp.tsx) (Dashboard & Analysis), [`utils/dragCard.ts`](https://github.com/sirfilips/centmeta-frontend/blob/main/utils/dragCard.ts) (Card Drag & Drop), [`utils/analytics.ts`](https://github.com/sirfilips/centmeta-frontend/blob/main/utils/analytics.ts) (Event Analytics), [`components/HeroSection.tsx`](https://github.com/sirfilips/centmeta-frontend/blob/main/components/HeroSection.tsx) (Unified Search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard &amp; Analysis"]
  node_home["Dashboard Route<br/>[page.tsx]"]
  node_commander_route["Commander Route<br/>[page.tsx]"]
  node_dashboard_app["Dashboard &amp; Analysis<br/>[CentMetaApp.tsx]"]
  node_hero["Unified Search<br/>[HeroSection.tsx]"]
  node_commander_analysis["Commander Analysis"]
  node_card_analysis["Card Analysis<br/>[CardDetail.tsx]"]
  node_card_filters["Card Filters<br/>[CardsFilterBar.tsx]"]
  node_cards_grid["Cards Grid<br/>[CardsGrid.tsx]"]
  node_commanders_grid["Commanders Grid<br/>[CommandersGrid.tsx]"]
  node_deck_compare["Deck Comparison"]
end

subgraph group_community["Community"]
  node_community_home["Community Overview<br/>[page.tsx]"]
  node_community_rank["Community Ranking<br/>[page.tsx]"]
  node_community_vote["Community Voting<br/>[page.tsx]"]
  node_community_nav["Community Navigation<br/>[CommunityNav.tsx]"]
end

subgraph group_history["Metagame History"]
  node_history_page["History View<br/>[page.tsx]"]
  node_history_chart["Metagame Chart"]
end

subgraph group_shared["Shared UI &amp; Utilities"]
  node_header["Site Navigation<br/>[Header.tsx]"]
  node_mtg_utils["MTG Filters<br/>[mtg.ts]"]
  node_navigation_utils["URL Navigation<br/>[navigation.tsx]"]
  node_drag_utils["Card Drag &amp; Drop<br/>[dragCard.ts]"]
  node_analytics["Event Analytics<br/>[analytics.ts]"]
end

subgraph group_integrations["External Integrations"]
  node_backend["FastAPI Backend"]
  node_scryfall["Scryfall API"]
  node_moxfield["Moxfield Deckbuilder"]
  node_umami["Umami Analytics"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"opens"| node_commander_route
node_home -->|"renders"| node_dashboard_app
node_commander_route -->|"renders"| node_dashboard_app
node_dashboard_app -->|"renders"| node_hero
node_dashboard_app -->|"renders"| node_commander_analysis
node_dashboard_app -->|"renders"| node_card_analysis
node_dashboard_app -->|"renders"| node_card_filters
node_dashboard_app -->|"renders"| node_cards_grid
node_dashboard_app -->|"renders"| node_commanders_grid
node_dashboard_app -->|"renders"| node_deck_compare
node_dashboard_app -->|"filters with"| node_mtg_utils
node_hero -->|"uses"| node_navigation_utils
node_hero -->|"uses"| node_mtg_utils
node_commander_analysis -->|"starts card drag"| node_drag_utils
node_card_analysis -->|"starts card drag"| node_drag_utils
node_card_analysis -->|"handles navigation"| node_navigation_utils
node_card_filters -->|"uses filters"| node_mtg_utils
node_card_filters -->|"updates URL"| node_navigation_utils
node_visitor -->|"opens"| node_community_home
node_community_home -->|"renders"| node_community_nav
node_visitor -->|"opens"| node_community_rank
node_community_rank -->|"uses"| node_community_nav
node_visitor -->|"opens"| node_community_vote
node_community_vote -->|"uses"| node_community_nav
node_visitor -->|"opens"| node_history_page
node_history_page -->|"renders"| node_history_chart
node_header -->|"tracks events"| node_analytics
node_history_page -->|"tracks events"| node_analytics
node_drag_utils -->|"tracks drag"| node_analytics
node_dashboard_app -.->|"fetches metagame data"| node_backend
node_dashboard_app -.->|"fetches card metadata"| node_scryfall
node_drag_utils -->|"provides deck payload"| node_moxfield
node_analytics -->|"sends events"| node_umami

click node_home "https://github.com/sirfilips/centmeta-frontend/blob/main/app/page.tsx"
click node_commander_route "https://github.com/sirfilips/centmeta-frontend/blob/main/app/commander/%5Bnome%5D/page.tsx"
click node_dashboard_app "https://github.com/sirfilips/centmeta-frontend/blob/main/components/CentMetaApp.tsx"
click node_hero "https://github.com/sirfilips/centmeta-frontend/blob/main/components/HeroSection.tsx"
click node_commander_analysis "https://github.com/sirfilips/centmeta-frontend/blob/main/components/CommanderOverview.tsx"
click node_card_analysis "https://github.com/sirfilips/centmeta-frontend/blob/main/components/CardDetail.tsx"
click node_card_filters "https://github.com/sirfilips/centmeta-frontend/blob/main/components/CardsFilterBar.tsx"
click node_cards_grid "https://github.com/sirfilips/centmeta-frontend/blob/main/components/CardsGrid.tsx"
click node_commanders_grid "https://github.com/sirfilips/centmeta-frontend/blob/main/components/CommandersGrid.tsx"
click node_deck_compare "https://github.com/sirfilips/centmeta-frontend/blob/main/components/DeckCompareModal.tsx"
click node_community_home "https://github.com/sirfilips/centmeta-frontend/blob/main/app/community/page.tsx"
click node_community_rank "https://github.com/sirfilips/centmeta-frontend/blob/main/app/community/classifica/page.tsx"
click node_community_vote "https://github.com/sirfilips/centmeta-frontend/blob/main/app/community/vota/page.tsx"
click node_community_nav "https://github.com/sirfilips/centmeta-frontend/blob/main/components/CommunityNav.tsx"
click node_history_page "https://github.com/sirfilips/centmeta-frontend/blob/main/app/storico/page.tsx"
click node_history_chart "https://github.com/sirfilips/centmeta-frontend/blob/main/components/MetagameHistoryChart.tsx"
click node_header "https://github.com/sirfilips/centmeta-frontend/blob/main/components/Header.tsx"
click node_mtg_utils "https://github.com/sirfilips/centmeta-frontend/blob/main/utils/mtg.ts"
click node_navigation_utils "https://github.com/sirfilips/centmeta-frontend/blob/main/utils/navigation.tsx"
click node_drag_utils "https://github.com/sirfilips/centmeta-frontend/blob/main/utils/dragCard.ts"
click node_analytics "https://github.com/sirfilips/centmeta-frontend/blob/main/utils/analytics.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_home,node_commander_route,node_dashboard_app,node_hero,node_commander_analysis,node_card_analysis,node_card_filters,node_cards_grid,node_commanders_grid,node_deck_compare toneBlue
class node_community_home,node_community_rank,node_community_vote,node_community_nav toneAmber
class node_history_page,node_history_chart toneMint
class node_header,node_mtg_utils,node_navigation_utils,node_drag_utils,node_analytics toneRose
class node_backend,node_scryfall,node_moxfield,node_umami,node_visitor toneIndigo
```

## Components

### Dashboard & Analysis

- [Dashboard Route](https://github.com/sirfilips/centmeta-frontend/blob/main/app/page.tsx): `app/page.tsx`
- [Commander Route](https://github.com/sirfilips/centmeta-frontend/blob/main/app/commander/%5Bnome%5D/page.tsx): `app/commander/[nome]/page.tsx`
- [Dashboard & Analysis](https://github.com/sirfilips/centmeta-frontend/blob/main/components/CentMetaApp.tsx): `components/CentMetaApp.tsx`
- [Unified Search](https://github.com/sirfilips/centmeta-frontend/blob/main/components/HeroSection.tsx): `components/HeroSection.tsx`
- [Commander Analysis](https://github.com/sirfilips/centmeta-frontend/blob/main/components/CommanderOverview.tsx): `components/CommanderOverview.tsx`
- [Card Analysis](https://github.com/sirfilips/centmeta-frontend/blob/main/components/CardDetail.tsx): `components/CardDetail.tsx`
- [Card Filters](https://github.com/sirfilips/centmeta-frontend/blob/main/components/CardsFilterBar.tsx): `components/CardsFilterBar.tsx`
- [Cards Grid](https://github.com/sirfilips/centmeta-frontend/blob/main/components/CardsGrid.tsx): `components/CardsGrid.tsx`
- [Commanders Grid](https://github.com/sirfilips/centmeta-frontend/blob/main/components/CommandersGrid.tsx): `components/CommandersGrid.tsx`
- [Deck Comparison](https://github.com/sirfilips/centmeta-frontend/blob/main/components/DeckCompareModal.tsx): `components/DeckCompareModal.tsx`

### Community

- [Community Overview](https://github.com/sirfilips/centmeta-frontend/blob/main/app/community/page.tsx): `app/community/page.tsx`
- [Community Ranking](https://github.com/sirfilips/centmeta-frontend/blob/main/app/community/classifica/page.tsx): `app/community/classifica/page.tsx`
- [Community Voting](https://github.com/sirfilips/centmeta-frontend/blob/main/app/community/vota/page.tsx): `app/community/vota/page.tsx`
- [Community Navigation](https://github.com/sirfilips/centmeta-frontend/blob/main/components/CommunityNav.tsx): `components/CommunityNav.tsx`

### Metagame History

- [History View](https://github.com/sirfilips/centmeta-frontend/blob/main/app/storico/page.tsx): `app/storico/page.tsx`
- [Metagame Chart](https://github.com/sirfilips/centmeta-frontend/blob/main/components/MetagameHistoryChart.tsx): `components/MetagameHistoryChart.tsx`

### Shared UI & Utilities

- [Site Navigation](https://github.com/sirfilips/centmeta-frontend/blob/main/components/Header.tsx): `components/Header.tsx`
- [MTG Filters](https://github.com/sirfilips/centmeta-frontend/blob/main/utils/mtg.ts): `utils/mtg.ts`
- [URL Navigation](https://github.com/sirfilips/centmeta-frontend/blob/main/utils/navigation.tsx): `utils/navigation.tsx`
- [Card Drag & Drop](https://github.com/sirfilips/centmeta-frontend/blob/main/utils/dragCard.ts): `utils/dragCard.ts`
- [Event Analytics](https://github.com/sirfilips/centmeta-frontend/blob/main/utils/analytics.ts): `utils/analytics.ts`

### External Integrations

- **FastAPI Backend**
- **Scryfall API**
- **Moxfield Deckbuilder**
- **Umami Analytics**

### Other components

- **Visitor**

## Connections

- Visitor → Dashboard Route: opens (evidence: `README.md`)
- Visitor → Commander Route: opens (evidence: `README.md`)
- Dashboard Route → Dashboard & Analysis: renders (evidence: `app/page.tsx`)
- Commander Route → Dashboard & Analysis: renders (evidence: `app/commander/[nome]/page.tsx`)
- Dashboard & Analysis → Unified Search: renders (evidence: `components/CentMetaApp.tsx`)
- Dashboard & Analysis → Commander Analysis: renders (evidence: `components/CentMetaApp.tsx`)
- Dashboard & Analysis → Card Analysis: renders (evidence: `components/CentMetaApp.tsx`)
- Dashboard & Analysis → Card Filters: renders (evidence: `components/CentMetaApp.tsx`)
- Dashboard & Analysis → Cards Grid: renders (evidence: `components/CentMetaApp.tsx`)
- Dashboard & Analysis → Commanders Grid: renders (evidence: `components/CentMetaApp.tsx`)
- Dashboard & Analysis → Deck Comparison: renders (evidence: `components/CentMetaApp.tsx`)
- Dashboard & Analysis → MTG Filters: filters with (evidence: `components/CentMetaApp.tsx`)
- Unified Search → URL Navigation: uses (evidence: `components/HeroSection.tsx`)
- Unified Search → MTG Filters: uses (evidence: `components/HeroSection.tsx`)
- Commander Analysis → Card Drag & Drop: starts card drag (evidence: `components/CommanderOverview.tsx`)
- Card Analysis → Card Drag & Drop: starts card drag (evidence: `components/CardDetail.tsx`)
- Card Analysis → URL Navigation: handles navigation (evidence: `components/CardDetail.tsx`)
- Card Filters → MTG Filters: uses filters (evidence: `components/CardsFilterBar.tsx`)
- Card Filters → URL Navigation: updates URL (evidence: `components/CardsFilterBar.tsx`)
- Visitor → Community Overview: opens (evidence: `README.md`)
- Community Overview → Community Navigation: renders (evidence: `app/community/page.tsx`)
- Visitor → Community Ranking: opens (evidence: `README.md`)
- Community Ranking → Community Navigation: uses (evidence: `app/community/classifica/page.tsx`)
- Visitor → Community Voting: opens (evidence: `README.md`)
- Community Voting → Community Navigation: uses (evidence: `app/community/vota/page.tsx`)
- Visitor → History View: opens (evidence: `README.md`)
- History View → Metagame Chart: renders (evidence: `app/storico/page.tsx`)
- Site Navigation → Event Analytics: tracks events (evidence: `components/Header.tsx`)
- History View → Event Analytics: tracks events (evidence: `app/storico/page.tsx`)
- Card Drag & Drop → Event Analytics: tracks drag (evidence: `utils/dragCard.ts`)
- Dashboard & Analysis → FastAPI Backend: fetches metagame data
- Dashboard & Analysis → Scryfall API: fetches card metadata
- Card Drag & Drop → Moxfield Deckbuilder: provides deck payload (evidence: `utils/dragCard.ts`)
- Event Analytics → Umami Analytics: sends events (evidence: `utils/analytics.ts`)
