# juanpa90cap/ci-test architecture

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

- Interactive diagram: https://gitdiagram.com/juanpa90cap/ci-test
- Repository: https://github.com/juanpa90cap/ci-test

## Overview

##### Project type and purpose
- This is a single‐page React frontend application (“Pokedex”) that fetches data from a public Pokémon REST API.
- It is set up with a full CI/CD pipeline (GitHub Actions), unit tests (Jest), end-to-end tests (Cypress), linting (ESLint), and a Webpack‐based build + production serve setup.

##### File structure
- Top level: configuration files (.babelrc, .eslintrc.js, webpack.config.js), CI workflows (.github/workflows), package.json scripts.
- “src/”: React components and custom hook (useApi.js).
- “public/”: static index.html.
- “test/”: Jest unit tests for components.
- “cypress/” and “ci-test/”: Cypress e2e tests + configs.
- app.js: entry point for production server.

##### README for additional insights
- Key commands: start dev server, run tests, lint, build, start production.
- Emphasis on CI/CD pipeline badge and exercises for the Full Stack open course.
- No backend service in this code base; external API is the PokeAPI.

##### Elements
- Blue for developer/build artifacts
- Green for CI/CD stages
- Orange for runtime/third-party services

##### Detail level
- CI stage as its own node (Install & Lint → Unit Tests → E2E Tests → Build → Deploy).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Local Environment
    subgraph "Developer Local Environment"
        direction TB
        WebpackConfig["webpack.config.js"]:::dev
        srcDir["src/"]:::dev
        publicIndexDev["public/index.html"]:::dev
        subgraph "SPA UI Components"
            direction TB
            ReactEntry["src/index.jsx"]:::dev
            AppJSX["src/App.jsx"]:::dev
            PokemonList["src/PokemonList.jsx"]:::dev
            PokemonPage["src/PokemonPage.jsx"]:::dev
            PokemonAbility["src/PokemonAbility.jsx"]:::dev
            LoadingSpinner["src/LoadingSpinner.jsx"]:::dev
            ErrorMessage["src/ErrorMessage.jsx"]:::dev
            UseApi["src/useApi.js"]:::dev
            Styles["src/styles.css"]:::dev
        end
    end

    %% Source Control & CI/CD
    GitHubRepo["GitHub Repository"]:::ci
    WebpackConfig -->|edit/push| GitHubRepo
    srcDir -->|edit/push| GitHubRepo
    publicIndexDev -->|edit/push| GitHubRepo
    ReactEntry -->|edit/push| GitHubRepo
    AppJSX -->|edit/push| GitHubRepo

    subgraph "CI/CD Pipeline" 
        direction TB
        ActionsRunner["GitHub Actions Runner"]:::ci
        LintStage["Lint Stage"]:::ci
        UnitTests["Unit Tests"]:::ci
        E2ETests["E2E Tests"]:::ci
        BuildStage["Build Stage"]:::ci
        DeployStage["Deploy Stage"]:::ci

        GitHubRepo -->|push triggers| ActionsRunner
        ActionsRunner -->|run lint| LintStage
        LintStage -->|run unit tests| UnitTests
        UnitTests -->|run e2e tests| E2ETests
        E2ETests -->|run build| BuildStage
        BuildStage -->|deploy artifacts| DeployStage
    end

    %% Deployment / Hosting
    subgraph "Deployment / Hosting"
        direction TB
        ProdServer["Node.js Server (app.js)"]:::host
        PublicAssets["public/ (built static assets & index.html)"]:::host
    end

    DeployStage -->|deploy to host| ProdServer
    ProdServer -->|serves assets| PublicAssets

    %% Production Runtime
    subgraph "Production Runtime"
        direction TB
        Browser["Client Browser"]:::runtime
        PokeAPI["External Pokémon REST API"]:::runtime
    end

    PublicAssets -->|served to| Browser
    Browser -->|HTTP requests| PokeAPI

    %% Click Events
    click WebpackConfig "https://github.com/juanpa90cap/ci-test/blob/main/webpack.config.js"
    click srcDir "https://github.com/juanpa90cap/ci-test/tree/main/src/"
    click publicIndexDev "https://github.com/juanpa90cap/ci-test/blob/main/public/index.html"
    click ReactEntry "https://github.com/juanpa90cap/ci-test/blob/main/src/index.jsx"
    click AppJSX "https://github.com/juanpa90cap/ci-test/blob/main/src/App.jsx"
    click PokemonList "https://github.com/juanpa90cap/ci-test/blob/main/src/PokemonList.jsx"
    click PokemonPage "https://github.com/juanpa90cap/ci-test/blob/main/src/PokemonPage.jsx"
    click PokemonAbility "https://github.com/juanpa90cap/ci-test/blob/main/src/PokemonAbility.jsx"
    click LoadingSpinner "https://github.com/juanpa90cap/ci-test/blob/main/src/LoadingSpinner.jsx"
    click ErrorMessage "https://github.com/juanpa90cap/ci-test/blob/main/src/ErrorMessage.jsx"
    click UseApi "https://github.com/juanpa90cap/ci-test/blob/main/src/useApi.js"
    click Styles "https://github.com/juanpa90cap/ci-test/blob/main/src/styles.css"
    click GitHubRepo "https://github.com/juanpa90cap/ci-test/blob/main/.gitignore"
    click GitHubRepo "https://github.com/juanpa90cap/ci-test/blob/main/.gitattributes"
    click GitHubRepo "https://github.com/juanpa90cap/ci-test/blob/main/README.md"
    click GitHubRepo "https://github.com/juanpa90cap/ci-test/blob/main/package.json"
    click LintStage "https://github.com/juanpa90cap/ci-test/blob/main/.eslintrc.js"
    click LintStage "https://github.com/juanpa90cap/ci-test/blob/main/.eslintignore"
    click LintStage "https://github.com/juanpa90cap/ci-test/blob/main/eslint.config.mjs"
    click UnitTests "https://github.com/juanpa90cap/ci-test/blob/main/test/App.jest.spec.jsx"
    click UnitTests "https://github.com/juanpa90cap/ci-test/blob/main/test/PokemonList.jest.spec.jsx"
    click UnitTests "https://github.com/juanpa90cap/ci-test/blob/main/test/PokemonPage.jest.spec.jsx"
    click E2ETests "https://github.com/juanpa90cap/ci-test/blob/main/cypress/e2e/app.cy.js"
    click E2ETests "https://github.com/juanpa90cap/ci-test/blob/main/cypress/support/e2e.js"
    click E2ETests "https://github.com/juanpa90cap/ci-test/blob/main/cypress.config.js"
    click E2ETests "https://github.com/juanpa90cap/ci-test/blob/main/ci-test/cypress.config.js"
    click BuildStage "https://github.com/juanpa90cap/ci-test/blob/main/webpack.config.js"
    click BuildStage "https://github.com/juanpa90cap/ci-test/blob/main/package.json"
    click ProdServer "https://github.com/juanpa90cap/ci-test/blob/main/app.js"
    click PublicAssets "https://github.com/juanpa90cap/ci-test/tree/main/public/"
    
    %% Styles
    classDef dev fill:#E3F2FD,stroke:#1E88E5,stroke-width:1px
    classDef ci fill:#C8E6C9,stroke:#43A047,stroke-width:1px
    classDef host fill:#FFF3E0,stroke:#FB8C00,stroke-width:1px
    classDef runtime fill:#FFECB3,stroke:#FDD835,stroke-width:1px
```
