# guilhermerm-a1/sacidex architecture

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

- Interactive diagram: https://gitdiagram.com/guilhermerm-a1/sacidex
- Repository: https://github.com/guilhermerm-a1/sacidex

## Overview

##### Project type and purpose
- This is a purely front-end, static web application (“Pokedex”) that runs entirely in the user’s browser.
- It consumes the external PokeAPI to list Pokémon and show their details, applying HTML5, CSS3, and ES6+ JavaScript.

##### File structure
- Top-level:
- README.md, LICENSE (documentation)
- assets/ (images, design prototypes)
- modules/ (all the code and pages)
- Under modules/:
- index.html (entry point)
- style.css + modules/css/*.css (global & component styles)
- modules/js/ (logic split into api.js, data.js, ui.js, details.js)
- main.js (initial bootstrap)
- modules/pages/pokemon.html (detail page template)

##### README
- Static front-end, no server or database.
- Architecture revolves around modular JS layers: API access, data modeling, UI rendering.

##### Detailed coverage
- Client-side routing component in main.js
- How modules/pages/pokemon.html is loaded or injected
- Assets folder as a supporting repository for images and CSS
- User interactions (click → navigation → fetch → render)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Browser
    Browser["User's Browser"]:::external

    %% Static Host / File System
    Host["Static Web Host / File System"]:::host

    %% Assets Store
    Assets["Assets Store (images, prototypes, git)"]:::assets

    %% Documentation
    README["README.md"]:::doc
    LICENSE["LICENSE"]:::doc

    %% Entry & Static Files
    Entry["index.html"]:::host
    click Entry "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/index.html"
    Style["style.css"]:::host
    click Style "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/style.css"
    CardCSS["cards.css"]:::host
    click CardCSS "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/css/cards.css"
    DetailsCSS["details.css"]:::host
    click DetailsCSS "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/css/details.css"
    TypesCSS["types.css"]:::host
    click TypesCSS "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/css/types.css"
    PageTemplate["pokemon.html"]:::host
    click PageTemplate "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/pages/pokemon.html"

    %% Assets Sub-components
    Img["assets/img"]:::assets
    click Img "https://github.com/guilhermerm-a1/sacidex/tree/main/assets/img"
    Prototipo["assets/Prototipo Alta fidelidade"]:::assets
    click Prototipo "https://github.com/guilhermerm-a1/sacidex/tree/main/assets/Prototipo Alta fidelidade"
    GitAssets["assets/git"]:::assets
    click GitAssets "https://github.com/guilhermerm-a1/sacidex/tree/main/assets/git"

    %% JavaScript Modules
    subgraph "JavaScript Modules"
        direction TB
        Main["main.js: bootstrap & routing"]:::js
        API["api.js: Fetch layer"]:::js
        Data["data.js: Normalize/Process JSON"]:::js
        UI["ui.js: Render list view"]:::js
        Details["details.js: Render detail view"]:::js
    end
    click Main "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/main.js"
    click API "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/js/api.js"
    click Data "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/js/data.js"
    click UI "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/js/ui.js"
    click Details "https://github.com/guilhermerm-a1/sacidex/blob/main/modules/js/details.js"

    %% External Service
    PokeAPI["PokeAPI Service"]:::external

    %% Flows
    Browser -->|HTTP GET HTML/CSS/JS| Host
    Host --> Entry
    Host --> Style
    Host --> CardCSS
    Host --> DetailsCSS
    Host --> TypesCSS
    Host --> Assets
    Host --> PageTemplate
    Host --> Main

    Assets --> Img
    Assets --> Prototipo
    Assets --> GitAssets

    Main --> UI
    Main --> Details

    UI -->|calls data layer| Data
    Details -->|calls data layer| Data
    Data -->|calls fetch| API
    API -->|Fetch GET /pokemon| PokeAPI
    PokeAPI -->|JSON response| Data
    Data -->|Processed data| UI
    Main -->|on click Pokémon| Details

    %% Documentation links
    Host --> README
    Host --> LICENSE

    %% Styles
    classDef host fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef js fill:#90EE90,stroke:#000,stroke-width:1px
    classDef external fill:#FFA500,stroke:#000,stroke-width:1px
    classDef assets fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef doc fill:#F0E68C,stroke:#000,stroke-width:1px
```
