# coryrylan/ng-pokedex architecture

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

- Interactive diagram: https://gitdiagram.com/coryrylan/ng-pokedex
- Repository: https://github.com/coryrylan/ng-pokedex

## Overview

##### Project type and purpose
- This is a single‐page, Progressive Web App (PWA) built in Angular 12.0.2, called “NgPokedex.”
- Its purpose is to display a list of Pokémon and details for each. It uses a static JSON data file, supports offline mode via service worker, and is set up for Firebase hosting/deployment.

##### File structure
- Top-level config: angular.json, tsconfig.*, tslint.json, karma.conf.js, protractor config, firebase.json, .firebaserc, ngsw-config.json.
- src/ holds the entire front-end:
- src/app/ contains three feature modules—about, common, pokemon—plus AppRoutingModule and root AppComponent.
- src/app/common/services hosts data-fetching (pokemon-data.service.ts) and viewport utilities.
- src/api/pokemon.json is the static “backend” data source.
- src/assets/, src/environments/, styling under src/styles/, and PWA manifest/polyfills are present.
- e2e/ and test.ts / karma/protractor configs support automated tests.

##### README for additional insights
- Confirms Angular CLI usage, test commands, build output to dist/, and no separate backend.
- PWA support implicit via ngsw-config.json and manifest.webmanifest.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Infrastructure Layer
    Browser["Client Browser"]:::infrastructure
    FirebaseHosting["Firebase Hosting"]:::infrastructure
    ServiceWorker["Angular Service Worker"]:::infrastructure

    %% Angular Application
    subgraph "Angular App" 
        direction TB
        AppModule["AppModule"]:::angular
        AppRouting["AppRoutingModule"]:::angular
        subgraph "Feature Modules"
            direction TB
            AboutModule["AboutModule"]:::angular
            PokemonModule["PokemonModule"]:::angular
            SharedModule["SharedModule"]:::angular
        end
        subgraph "UI Components"
            direction TB
            HeaderComp["HeaderComponent"]:::angular
            FooterComp["FooterComponent"]:::angular
            SearchComp["SearchFormComponent"]:::angular
            PokemonListComp["PokemonListComponent"]:::angular
            PokemonDetailComp["PokemonDetailComponent"]:::angular
            AboutComp["AboutComponent"]:::angular
        end
        subgraph "Services"
            direction TB
            DataService["PokemonDataService"]:::service
            ViewportSvc["ViewportService"]:::service
        end
    end

    %% Data Source
    PokemonJSON["/api/pokemon.json"]:::data

    %% Tools & Config
    subgraph "Build & Test Tools"
        direction TB
        AngularCLI["Angular CLI\n(angular.json,\ntsconfig.app.json)"]:::tool
        UnitTest["Karma & Jasmine\n(karma.conf.js,\ntscnfig.spec.json)"]:::tool
        E2ETest["Protractor E2E\n(protractor.conf.js,\ne2e-spec.ts)"]:::tool
    end

    %% PWA & Firebase Config
    ngswConfig["ngsw-config.json"]:::config
    Manifest["manifest.webmanifest"]:::config
    FirebaseConfig["firebase.json\n.firebaserc"]:::config

    %% Flows
    Browser -->|"GET /"| FirebaseHosting
    FirebaseHosting -->|"serve index.html, main.js, assets"| Browser

    Browser -->|"bootstrap AppModule"| AppModule
    AppModule --> AppRouting
    AppModule --> ServiceWorker
    ServiceWorker -->|"caches assets & API"| FirebaseHosting

    AppRouting --> AboutModule
    AppRouting --> PokemonModule

    SharedModule --> HeaderComp
    SharedModule --> FooterComp
    SharedModule --> SearchComp

    PokemonModule --> PokemonListComp
    PokemonModule --> PokemonDetailComp

    AboutModule --> AboutComp

    PokemonListComp --> DataService
    PokemonDetailComp --> DataService
    DataService -->|"HTTP GET /api/pokemon.json"| ServiceWorker
    ServiceWorker --> PokemonJSON

    ViewportSvc --> HeaderComp

    AngularCLI --> FirebaseHosting
    AngularCLI --> ServiceWorker

    %% Click Events
    click AppModule "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/app.module.ts"
    click AppRouting "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/app-routing.module.ts"
    click AboutModule "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/about/about.module.ts"
    click PokemonModule "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/pokemon/pokemon.module.ts"
    click SharedModule "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/common/shared/shared.module.ts"
    click HeaderComp "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/common/shared/layout/header/header.component.ts"
    click FooterComp "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/common/shared/layout/footer/footer.component.ts"
    click SearchComp "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/common/shared/components/form-search/form-search.component.ts"
    click PokemonListComp "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/pokemon/pokemon-list/pokemon-list.component.ts"
    click PokemonDetailComp "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/pokemon/pokemon-detail/pokemon-detail.component.ts"
    click AboutComp "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/about/about.component.ts"
    click DataService "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/common/services/pokemon-data.service.ts"
    click ViewportSvc "https://github.com/coryrylan/ng-pokedex/blob/master/src/app/common/services/viewport.service.ts"
    click PokemonJSON "https://github.com/coryrylan/ng-pokedex/blob/master/src/api/pokemon.json"
    click ngswConfig "https://github.com/coryrylan/ng-pokedex/blob/master/ngsw-config.json"
    click Manifest "https://github.com/coryrylan/ng-pokedex/blob/master/src/manifest.webmanifest"
    click FirebaseConfig "https://github.com/coryrylan/ng-pokedex/blob/master/firebase.json"
    click AngularCLI "https://github.com/coryrylan/ng-pokedex/blob/master/angular.json"
    click UnitTest "https://github.com/coryrylan/ng-pokedex/blob/master/karma.conf.js"
    click E2ETest "https://github.com/coryrylan/ng-pokedex/blob/master/e2e/protractor.conf.js"

    %% Styles and Configs
    classDef infrastructure fill:#E0F7FA,stroke:#006064
    classDef angular fill:#E8F5E9,stroke:#2E7D32
    classDef service fill:#FFF3E0,stroke:#EF6C00
    classDef data fill:#FFFDE7,stroke:#F9A825
    classDef tool fill:#EDE7F6,stroke:#5E35B1
    classDef config fill:#ECEFF1,stroke:#37474F
```
