# dimorphic/pokepedia architecture

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

- Interactive diagram: https://gitdiagram.com/dimorphic/pokepedia
- Repository: https://github.com/dimorphic/pokepedia

## Overview

##### Main Components Identification

The system consists of three main parts:
- Client (Frontend React Application)
- Server (Backend Node.js Application)
- Shared Resources (Common assets and data)

##### Detailed Architecture Breakdown

Frontend (Client):
- Store (Redux) layer
- Components hierarchy (Atoms → Modules → Pages → Views)
- API integration layer
- Asset management
- Build system (Webpack)

Backend (Server):
- Express.js server structure with:
- Route handlers
- Database interface (planned MongoDB integration)
- Asset management
- Data processing utilities

Shared Resources:
- Pokemon data storage
- Multilingual support (en, de, fr)
- Asset management

**┌─────────────────────────────────────────────────────┐**
- Pokepedia                        │
- ┬─────────────────────┬──────────────────┤
- Client   │      Server         │  Shared          │
- (React)  │    (Node.js)        │  Resources       │
- ┴─────────────────────┴──────────────────┘

##### Connection Flows

- API calls between client and server
- Data flow through Redux store
- Asset loading paths
- Build process flow

##### Future expansion points (MongoDB, new features)

This will give a comprehensive view of both the current system and its planned evolution while maintaining clarity and usefulness for development purposes.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Pokepedia
        subgraph Client
            Store["Redux Store"]:::store
            click Store "https://github.com/dimorphic/pokepedia/tree/master/client/src/store/"
            
            subgraph Components
                Atoms["Atomic Components"]:::component
                click Atoms "https://github.com/dimorphic/pokepedia/tree/master/client/src/components/atoms/"
                Modules["Module Components"]:::component
                click Modules "https://github.com/dimorphic/pokepedia/tree/master/client/src/components/modules/"
                Pages["Page Components"]:::component
                click Pages "https://github.com/dimorphic/pokepedia/tree/master/client/src/components/pages/"
                Views["View Components"]:::component
                click Views "https://github.com/dimorphic/pokepedia/tree/master/client/src/components/views/"
                
                Atoms --> Modules
                Modules --> Pages
                Pages --> Views
            end
            
            APILayer["API Integration Layer"]:::api
            click APILayer "https://github.com/dimorphic/pokepedia/tree/master/client/src/api/"
            
            BuildSystem["Webpack Build System"]:::build
            click BuildSystem "https://github.com/dimorphic/pokepedia/tree/master/client/webpack/"
            
            Store --> Components
            Components --> APILayer
            BuildSystem --> Components
        end
        
        subgraph Server
            Routes["Route Handlers"]:::server
            click Routes "https://github.com/dimorphic/pokepedia/tree/master/server/src/routes/"
            
            DataProcessing["Data Processing"]:::server
            
            MongoDB["MongoDB Integration"]:::planned
            click MongoDB "https://github.com/dimorphic/pokepedia/blob/master/server/src/db.js"
            
            AssetDownloader["Asset Downloader"]:::server
            click AssetDownloader "https://github.com/dimorphic/pokepedia/blob/master/server/src/bin/assets-downloader.js"
            
            Routes --> DataProcessing
            DataProcessing --> MongoDB
            AssetDownloader --> DataProcessing
        end
        
        subgraph SharedResources
            PokemonData["Pokemon Data Storage"]:::shared
            click PokemonData "https://github.com/dimorphic/pokepedia/blob/master/shared/data/pokemon/pokedex.js"
            
            subgraph Languages
                EN["English"]:::lang
                click EN "https://github.com/dimorphic/pokepedia/blob/master/shared/data/pokemon/pokedex.en.build.json"
                DE["German"]:::lang
                click DE "https://github.com/dimorphic/pokepedia/blob/master/shared/data/pokemon/pokedex.de.build.json"
                FR["French"]:::lang
                click FR "https://github.com/dimorphic/pokepedia/blob/master/shared/data/pokemon/pokedex.fr.build.json"
            end
            
            Assets["Asset Management"]:::shared
            click Assets "https://github.com/dimorphic/pokepedia/tree/master/shared/assets/"
            
            LangPatches["Language Patches"]:::shared
            click LangPatches "https://github.com/dimorphic/pokepedia/tree/master/shared/data/pokemon/patches/"
            
            Languages --> PokemonData
            LangPatches --> Languages
        end
        
        APILayer <--> Routes
        Routes <--> PokemonData
        Assets --> Components
    end
    
    %% Styling
    classDef store fill:#3498db,stroke:#2980b9,color:white
    classDef component fill:#2ecc71,stroke:#27ae60,color:white
    classDef api fill:#e74c3c,stroke:#c0392b,color:white
    classDef build fill:#9b59b6,stroke:#8e44ad,color:white
    classDef server fill:#1abc9c,stroke:#16a085,color:white
    classDef planned fill:#95a5a6,stroke:#7f8c8d,color:white,stroke-dasharray: 5 5
    classDef shared fill:#f1c40f,stroke:#f39c12,color:black
    classDef lang fill:#e67e22,stroke:#d35400,color:white
    
    %% Legend
    subgraph Legend
        L1["Store"]:::store
        L2["Component"]:::component
        L3["API"]:::api
        L4["Build System"]:::build
        L5["Server"]:::server
        L6["Planned Feature"]:::planned
        L7["Shared Resource"]:::shared
        L8["Language"]:::lang
    end
```
