# estebanrcarmona/planning-pocker-angular architecture

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

- Interactive diagram: https://gitdiagram.com/estebanrcarmona/planning-pocker-angular
- Repository: https://github.com/estebanrcarmona/planning-pocker-angular

## Overview

##### Project type and purpose
- This is a front‑end single‑page application (SPA) built with Angular.
- Purpose: Provide an interactive “Planning Poker” estimation tool using Atomic Design for UI components, allowing users to join sessions, pick Fibonacci cards, reveal selections, and calculate an average.

##### File structure
- Top‑level config files: angular.json, tsconfig*.json, jest.config.js, karma.conf.js
- src/app: contains all Angular modules, components, and service implementations
- components/atoms → smallest UI building blocks (buttons, cards, inputs, toasts)
- components/molecules → composed UI pieces (create‑game form, table display)
- components/pages → route‑level views (create‑game, game session, pre‑load, register)
- shared/services → business logic and API/communication layers (GameService, communicationService, toastService, validators)
- shared/interfaces & Constants → type models and global constants
- src/environments: environment.ts / environment.prod.ts for runtime configuration (API endpoints, feature toggles)
- Testing setup: *.spec.ts alongside every component and service, Jest + Karma config
- No backend code in this repo—interacts with an external RESTful API (and possibly WebSockets via communicationService)

##### README for additional insights
- Confirms Angular + TypeScript + semantic HTML + CSS
- Mentions RESTful API integration “if applicable” (Game sessions backend)
- Emphasizes Atomic Design, responsive layout, accessibility

##### Elements
- UI → Services (HTTP call) → REST API
- UI ← Services ← API response
- UI ↔ communicationService ↔ WebSocket server
- UI components (blue)
- Services (green)
- External systems (orange)
- Labels: method names (e.g. GameService.getGame(), communicationService.connect())

Tips
- UI components visually by Atomic Design tiers.
- Routing transitions (e.g. Register Page → Create Game → Game Session).
- Environment injection for API base URL.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "App Core"
        direction TB
        AppModule["AppModule"]:::ui
        AppRouting["AppRoutingModule"]:::ui
        RootComponent["AppComponent"]:::ui
    end

    subgraph "UI Layer - Atoms"
        direction TB
        ButtonAtom["ButtonAtom"]:::ui
        CardAtom["CardAtom"]:::ui
        CartAtom["CartAtom"]:::ui
        InputAtom["InputAtom"]:::ui
        ToastAtom["ToastAtom"]:::ui
    end

    subgraph "UI Layer - Molecules"
        direction TB
        CreateGameForm["CreateGameFormMolecule"]:::ui
        TableGame["TableGameMolecule"]:::ui
    end

    subgraph "UI Layer - Pages"
        direction TB
        RegisterPage["RegisterPage"]:::ui
        CreateGamePage["CreateGamePage"]:::ui
        GameSessionPage["GameSessionPage"]:::ui
        PreloadPage["PreloadPage"]:::ui
    end

    subgraph "Service Layer"
        direction TB
        GameService["GameService"]:::service
        CommService["communicationService"]:::service
        ToastService["toastService"]:::service
        Validators["CustomValidators"]:::service
    end

    subgraph "Data & Config"
        direction TB
        GameModel["Game Model"]:::service
        UserModel["User Model"]:::service
        Constants["Constants"]:::service
        EnvDev["environment.ts (Dev)"]:::service
        EnvProd["environment.prod.ts (Prod)"]:::service
    end

    REST["REST API Server"]:::external
    WS["WebSocket Server"]:::external

    %% Connections
    RootComponent -->|"bootstraps"| AppModule
    AppModule --> AppRouting
    AppModule --> RootComponent
    AppRouting --> RegisterPage
    AppRouting --> CreateGamePage
    AppRouting --> GameSessionPage
    AppRouting --> PreloadPage

    RegisterPage --> CreateGameForm
    CreateGamePage --> CreateGameForm
    GameSessionPage --> TableGame
    CreateGameForm --> ButtonAtom
    CreateGameForm --> InputAtom
    TableGame --> CardAtom

    RegisterPage -->|calls| GameService
    CreateGamePage -->|calls| GameService
    GameSessionPage -->|calls| GameService
    PreloadPage -->|calls| GameService

    RegisterPage -->|connects| CommService
    GameSessionPage -->|connects| CommService

    RegisterPage -->|notifies via| ToastService
    CreateGamePage -->|notifies via| ToastService
    GameSessionPage -->|notifies via| ToastService

    GameService --> REST
    CommService --> WS

    GameService --> GameModel
    GameService --> UserModel
    GameService --> Constants
    RegisterPage --> Validators
    CreateGamePage --> Validators

    EnvDev --> GameService
    EnvProd --> GameService

    REST -->|response| GameService
    WS -->|messages| CommService

    %% Click Events
    click AppModule "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/app.module.ts"
    click AppRouting "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/app-routing.module.ts"
    click RootComponent "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/app.component.ts"
    click ButtonAtom "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/atoms/button/button.component.ts"
    click CardAtom "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/atoms/card/card.component.ts"
    click CartAtom "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/atoms/cart/cart.component.ts"
    click InputAtom "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/atoms/input/input.component.ts"
    click ToastAtom "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/atoms/toast/toast.component.ts"
    click CreateGameForm "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/molecules/create-game-form/create-game-molecule.component.ts"
    click TableGame "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/molecules/table-game/table.component.ts"
    click RegisterPage "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/pages/register.page/register.user.component.ts"
    click CreateGamePage "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/pages/create-game/create-game.component.ts"
    click GameSessionPage "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/pages/game.page/game.page.component.ts"
    click PreloadPage "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/components/pages/pre.loading/pre.loading.component.ts"
    click GameService "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/shared/services/functionalyty-service/GameService/game.service.impl.ts"
    click CommService "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/shared/services/functionalyty-service/comunicationService/comunicationService.ts"
    click ToastService "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/shared/services/toast/toast.service.ts"
    click Validators "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/shared/services/Validators/CustomValidators.ts"
    click GameModel "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/shared/interfaces/game.model.ts"
    click UserModel "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/shared/interfaces/user.model.ts"
    click Constants "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/app/shared/Constants.ts"
    click EnvDev "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/environments/environment.ts"
    click EnvProd "https://github.com/estebanrcarmona/planning-pocker-angular/blob/main/src/environments/environment.prod.ts"

    classDef ui fill:#e3f2fd,stroke:#1e88e5,color:#1e88e5
    classDef service fill:#e8f5e9,stroke:#43a047,color:#43a047
    classDef external fill:#ffe0b2,stroke:#fb8c00,color:#fb8c00
```
