# projeffboy/my-pokemon-team architecture

> Architecture diagram of the GitHub repository projeffboy/my-pokemon-team, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/projeffboy/my-pokemon-team
- Repository: https://github.com/projeffboy/my-pokemon-team

## Overview

##### Main Components

A. Core Application Layer:
- React Application Container (root)
- MobX State Management Store
- Main App Component (src/app.js)

B. Feature Components:
- Team Builder Interface
- Pokemon Card System
- Team Stats Calculator
- Pokemon Showdown Integration
- Type Chart System

C. Data Layer:
- Pokemon Data Store (pokedex, moves, items)
- Type Chart Data
- Learnsets
- Format Configurations

**[User Interface Layer]**

- [Component Layer]
- Team Viewer Component
- Pokemon Cards
- Pokemon Input
- Sprite Display
- More Info Panel
- Team Stats

- [State Management Layer]
- MobX Store
- Team State
- Pokemon Selection State
- UI State

- [Data Layer]
- Pokemon Data
- Moves Database
- Type Charts
- Format Rules

##### Key Interactions to Highlight

- Data flow between MobX store and UI components
- Pokemon selection and team building process
- Type calculation and stat computation paths
- Import/Export functionality with Pokemon Showdown

##### Implementation Details

- Use double lines for external system interactions
- MobX indicators for observable components

##### Additional Notes

- A section showing the Pokemon Showdown import/export functionality
- Type calculation system as it's a core feature
- Relationship between the team checklist and team validation
- Sprite handling system

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface Layer"
        UI[React Application Root]
        AppComponent["Main App Component"]:::react
        TeamViewer["Team Viewer"]:::react
        TeamStats["Team Stats"]:::react
        ShowdownIntegration["Pokemon Showdown Integration"]:::react
    end

    subgraph "Component Layer"
        PokemonCard["Pokemon Card System"]:::react
        PokemonInput["Pokemon Input Interface"]:::react
        SpriteDisplay["Sprite Display"]:::react
        MoreInfo["More Info Panel"]:::react
        TeamChecklist["Team Checklist"]:::react
    end

    subgraph "State Management Layer"
        MobXStore["MobX Store"]:::store
        TeamState["Team State"]:::store
        PokemonState["Pokemon Selection State"]:::store
        UIState["UI State"]:::store
    end

    subgraph "Data Layer"
        PokemonData["Pokemon Data Store"]:::data
        MovesDB["Moves Database"]:::data
        TypeCharts["Type Charts"]:::data
        FormatRules["Format Rules"]:::data
        Learnsets["Learnsets"]:::data
        TypeChartSystem["Type Chart System"]:::util
        HelperFunctions["Helper Functions"]:::util
    end

    UI --> AppComponent
    AppComponent --> TeamViewer
    AppComponent --> TeamStats
    AppComponent --> ShowdownIntegration

    TeamViewer --> PokemonCard
    PokemonCard --> PokemonInput
    PokemonCard --> SpriteDisplay
    PokemonCard --> MoreInfo
    MoreInfo --> TeamChecklist

    MobXStore --> TeamState
    MobXStore --> PokemonState
    MobXStore --> UIState

    TeamState -.-> TeamViewer
    PokemonState -.-> PokemonCard
    UIState -.-> AppComponent

    PokemonInput -.-> PokemonData
    PokemonInput -.-> MovesDB
    TeamStats -.-> TypeCharts
    TeamStats -.-> TypeChartSystem
    ShowdownIntegration -.-> FormatRules
    PokemonCard -.-> Learnsets
    
    HelperFunctions -.-> PokemonCard
    HelperFunctions -.-> TeamStats
    HelperFunctions -.-> TypeChartSystem

    %% Click Events
    click AppComponent "https://github.com/projeffboy/my-pokemon-team/blob/master/src/app.js"
    click MobXStore "https://github.com/projeffboy/my-pokemon-team/blob/master/src/store.js"
    click PokemonCard "https://github.com/projeffboy/my-pokemon-team/blob/master/src/components/cards/pokemon.js"
    click TeamStats "https://github.com/projeffboy/my-pokemon-team/blob/master/src/components/cards/team-stats.js"
    click ShowdownIntegration "https://github.com/projeffboy/my-pokemon-team/blob/master/src/components/cards/more-info/pokemon-showdown-team.js"
    click TypeChartSystem "https://github.com/projeffboy/my-pokemon-team/blob/master/src/type-chart.js"
    click TeamViewer "https://github.com/projeffboy/my-pokemon-team/blob/master/src/components/cards/team-viewer.js"
    click PokemonInput "https://github.com/projeffboy/my-pokemon-team/blob/master/src/components/cards/pokemon/pokemon-input/pokemon-input-select.js"
    click SpriteDisplay "https://github.com/projeffboy/my-pokemon-team/blob/master/src/components/cards/pokemon/sprite.js"
    click MoreInfo "https://github.com/projeffboy/my-pokemon-team/blob/master/src/components/cards/more-info.js"
    click PokemonData "https://github.com/projeffboy/my-pokemon-team/blob/master/src/data/pokedex.js"
    click MovesDB "https://github.com/projeffboy/my-pokemon-team/blob/master/src/data/moves.js"
    click TypeCharts "https://github.com/projeffboy/my-pokemon-team/blob/master/src/data/typechart.js"
    click FormatRules "https://github.com/projeffboy/my-pokemon-team/blob/master/src/data/formats.js"
    click Learnsets "https://github.com/projeffboy/my-pokemon-team/blob/master/src/data/learnsets.js"
    click TeamChecklist "https://github.com/projeffboy/my-pokemon-team/blob/master/src/components/cards/more-info/team-checklist.js"
    click HelperFunctions "https://github.com/projeffboy/my-pokemon-team/blob/master/src/helper-functions.js"

    classDef react fill:#61DAFB,stroke:#61DAFB,color:#000000
    classDef store fill:#FF7518,stroke:#FF7518,color:#000000
    classDef data fill:#4CAF50,stroke:#4CAF50,color:#FFFFFF
    classDef util fill:#9C27B0,stroke:#9C27B0,color:#FFFFFF

    %% Legend
    subgraph Legend
        React["React Component"]:::react
        Store["State Store"]:::store
        Data["Data Store"]:::data
        Util["Utility/Helper"]:::util
    end
```
