# dbeniteza/pokeapex architecture

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

- Interactive diagram: https://gitdiagram.com/dbeniteza/pokeapex
- Repository: https://github.com/dbeniteza/pokeapex

## Overview

##### Project type and purpose
- This is a full-stack Progressive Web Application built on Oracle APEX, hosted on Oracle Cloud Infrastructure.
- It consumes the external PokéAPI.co service and surfaces Pokémon data via APEX pages, PL/SQL logic, and static assets.

##### File structure
- Top-level folders:
- application/ – APEX application definitions (page metadata in YAML, shared components, theme templates, static files)
- src/plsql/ – PL/SQL package bodies/specs (pkmn_data.pkb/pks) providing stored-procedure logic
- Configuration files: code ownership, license.
- The directory layout follows an APEX “export” style: pages, page groups, shared components, theme artifacts, and PL/SQL packages.

##### README for additional insights
- Stack: Oracle APEX 23.2.3, Oracle Database 19c, Oracle Linux 9.3, NGINX 1.20.1.
- The application runs as a PWA in the browser, served via NGINX/ORDS to the APEX engine, backed by an Oracle DB.
- It integrates with PokéAPI.co at runtime for live data.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        Browser["End User Browser (PWA)"]:::compute
        Browser -->|"HTTP(S) requests"| NGINX
    end

    %% Server Layer
    subgraph "Server Layer"
        direction TB
        NGINX["NGINX Web Server / ORDS Listener"]:::compute
        NGINX -->|"forwards dynamic requests"| APEX
        NGINX -->|"serves CSS/JS/images"| AppStatic
        NGINX -->|"serves PWA icons/images/JS"| PWAStatic

        APEX["Oracle APEX Engine"]:::compute
        APEX -->|"SQL/PLSQL calls"| OracleDB
        APEX -->|"REST API calls"| PokeAPI
    end

    %% APEX Components
    subgraph "APEX Application Components"
        direction TB
        Pages["APEX Page Definitions"]:::compute
        SharedComp["APEX Shared Components"]:::compute
        Theme["Universal Theme 42"]:::compute
        Supporting["Supporting Objects"]:::compute

        APEX --> Pages
        APEX --> SharedComp
        SharedComp --> Theme
        APEX --> Supporting
    end

    %% Static Assets
    AppStatic["App Static Files"]:::static
    PWAStatic["PWA Static Files"]:::static

    %% Data & External
    subgraph "Data & External Services"
        direction TB
        OracleDB["Oracle Database 19c"]:::database
        PLSpec["pkmn_data.pks"]:::database
        PLBody["pkmn_data.pkb"]:::database
        PokeAPI["PokéAPI.co REST Service"]:::external
        Docs["Architecture Docs"]:::external

        OracleDB --> PLSpec
        OracleDB --> PLBody
    end

    %% Connections
    Browser --> ServiceWorker["Service Worker (JS)"]:::compute
    ServiceWorker --> AppStatic
    APEX --> Docs

    %% Click Events
    click Browser "https://github.com/dbeniteza/pokeapex/tree/main/static_application_files/"
    click NGINX "https://github.com/dbeniteza/pokeapex/tree/main/static_application_files/"
    click AppStatic "https://github.com/dbeniteza/pokeapex/tree/main/application/shared_components/app_static_files/"
    click PWAStatic "https://github.com/dbeniteza/pokeapex/tree/main/static_application_files/"
    click APEX "https://github.com/dbeniteza/pokeapex/tree/main/application/"
    click Pages "https://github.com/dbeniteza/pokeapex/tree/main/application/pages/"
    click SharedComp "https://github.com/dbeniteza/pokeapex/tree/main/application/shared_components/"
    click Theme "https://github.com/dbeniteza/pokeapex/tree/main/application/shared_components/theme_42/"
    click Supporting "https://github.com/dbeniteza/pokeapex/tree/main/application/supporting_objects/"
    click PLSpec "https://github.com/dbeniteza/pokeapex/blob/main/src/plsql/pkmn_data.pks"
    click PLBody "https://github.com/dbeniteza/pokeapex/blob/main/src/plsql/pkmn_data.pkb"
    click Docs "https://github.com/dbeniteza/pokeapex/tree/main/docs/imgs/architecture/"

    %% Styles
    classDef compute fill:#D0E7FF,stroke:#333,stroke-width:1px
    classDef database fill:#FFDDA0,stroke:#333,stroke-width:1px
    classDef external fill:#DFFFE0,stroke:#333,stroke-width:1px
    classDef static fill:#F0F0F0,stroke:#333,stroke-width:1px
```
