# 1afs/pokedexdebriga architecture

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

- Interactive diagram: https://gitdiagram.com/1afs/pokedexdebriga
- Repository: https://github.com/1afs/pokedexdebriga

## Overview

##### Project type and purpose
- This is a single-module Android mobile application (“pokedexdebriga”) written in Kotlin.
- Its purpose is to consume one or more external RESTful Pokémon APIs for study purposes, display lists/details of Pokémon and their types in simple Activities.

##### File structure
- Top-level build files and Gradle wrapper: build.gradle, settings.gradle, gradle/… – standard Android project configuration.
- app/src/main/java/com/example/pokedexdebriga:
- UI layer: MainActivity.kt, Home.kt
- Data models: PokemonModelo.kt, TipoModelo.kt
- Network layer: RetrofitClient.kt, PokemonService.kt, TipoService.kt
- app/src/main/res: layouts (activity_main.xml, activity_home.xml), drawables, mipmaps, values – Android UI resources.
- app/src/androidTest & app/src/test: basic instrumentation and unit tests.

##### README for additional insights
- Simple description: “App de estudos sobre APIs” – this confirms the app is focused on consuming and displaying API data (no local database or advanced caching present).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        MainActivity["MainActivity.kt\n(UI Layer)"]:::presentation
        HomeActivity["Home.kt\n(UI Layer)"]:::presentation
        LayoutMain["activity_main.xml"]:::presentation
        LayoutHome["activity_home.xml"]:::presentation
    end

    %% Data Models Layer
    subgraph "Data Models"
        direction TB
        PokemonModel["PokemonModelo.kt"]:::data
        TipoModel["TipoModelo.kt"]:::data
    end

    %% Network Layer
    subgraph "Network Layer"
        direction TB
        PokemonService["PokemonService.kt\n(REST API Interface)"]:::network
        TipoService["TipoService.kt\n(REST API Interface)"]:::network
        RetrofitClient["RetrofitClient.kt\n(HTTP Client)"]:::network
    end

    %% External System
    ExternalAPI["External Pokémon REST API"]:::external

    %% Interactions
    User["User"]:::external -->|interacts with| MainActivity
    User -->|interacts with| HomeActivity

    MainActivity -->|uses layout| LayoutMain
    HomeActivity -->|uses layout| LayoutHome

    MainActivity -->|calls interface| PokemonService
    MainActivity -->|calls interface| TipoService
    HomeActivity -->|calls interface| PokemonService
    HomeActivity -->|calls interface| TipoService

    PokemonService -->|via Retrofit| RetrofitClient
    TipoService -->|via Retrofit| RetrofitClient

    RetrofitClient -->|HTTP GET /pokemon\nHTTP GET /type| ExternalAPI
    ExternalAPI -->|JSON response| RetrofitClient

    RetrofitClient -->|parses JSON| PokemonModel
    RetrofitClient -->|parses JSON| TipoModel

    PokemonModel -->|data for UI| MainActivity
    PokemonModel -->|data for UI| HomeActivity
    TipoModel -->|data for UI| MainActivity
    TipoModel -->|data for UI| HomeActivity

    %% Click events
    click MainActivity "https://github.com/1afs/pokedexdebriga/blob/master/app/src/main/java/com/example/pokedexdebriga/MainActivity.kt"
    click HomeActivity "https://github.com/1afs/pokedexdebriga/blob/master/app/src/main/java/com/example/pokedexdebriga/Home.kt"
    click LayoutMain "https://github.com/1afs/pokedexdebriga/blob/master/app/src/main/res/layout/activity_main.xml"
    click LayoutHome "https://github.com/1afs/pokedexdebriga/blob/master/app/src/main/res/layout/activity_home.xml"
    click PokemonModel "https://github.com/1afs/pokedexdebriga/blob/master/app/src/main/java/com/example/pokedexdebriga/PokemonModelo.kt"
    click TipoModel "https://github.com/1afs/pokedexdebriga/blob/master/app/src/main/java/com/example/pokedexdebriga/TipoModelo.kt"
    click RetrofitClient "https://github.com/1afs/pokedexdebriga/blob/master/app/src/main/java/com/example/pokedexdebriga/RetrofitClient.kt"
    click PokemonService "https://github.com/1afs/pokedexdebriga/blob/master/app/src/main/java/com/example/pokedexdebriga/PokemonService.kt"
    click TipoService "https://github.com/1afs/pokedexdebriga/blob/master/app/src/main/java/com/example/pokedexdebriga/TipoService.kt"
    click ExternalAPI "https://github.com/1afs/pokedexdebriga/blob/master/README.md"

    %% Styles
    classDef presentation fill:#D0E4FD,stroke:#333,stroke-width:1px
    classDef data fill:#FFE5B4,stroke:#333,stroke-width:1px
    classDef network fill:#C8E6C9,stroke:#333,stroke-width:1px
    classDef external fill:#E0E0E0,stroke:#333,stroke-width:1px
```
