# pandey-mohit/planningpoker architecture

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

- Interactive diagram: https://gitdiagram.com/pandey-mohit/planningpoker
- Repository: https://github.com/pandey-mohit/planningpoker

## Overview

##### Project Type and Purpose
- This is a front-end ReactJS application built for agile planning using a gamified estimation technique ("Scrum Pokermon").
- Its main purpose is to let teams estimate tasks interactively, using game elements and real-time communication provided by PubNub.
- It leverages FluentUI for styling, meaning that the UI design principles are centered around Microsoft’s design language.

##### Analyzing the File Structure
- Notice that the project is bootstrapped with Create React App; the primary entry points are in src (specifically index.tsx and main.tsx).
- The components directory under src/components contains several UI elements like header, footer, createroom, joinroom, invite, deck, and flipcard—each encapsulating a distinct piece of the UI.
- The pages directory groups higher-level views (e.g., landing page, room page with nested sections such as participantCards, result, and taskbar) that orchestrate these components and possibly routing between them.
- Other directories like public provide static assets (index.html, manifest, etc.), and configuration files like tsconfig.json and package.json indicate the project’s dependency management and TypeScript usage.
- PubNub integration is identified (via the pubnub.js file and the instructions to add .env keys), serving as the core for real-time interactions in the UI.

▪ User Interface: The React Components that include both generic (e.g., header, footer) and feature-specific ones (e.g., createroom, joinroom, deck, flipcard).
▪ Pages / Routing: The Page components in the src/pages folder, which combine various UI components to establish full-screen views and manage routing logic (landing, room, error pages).
▪ Real-Time Communication: The integration with PubNub that feeds data into different components (for chat, live updates, or notifications in the room).
▪ Environment Configuration: The use of environment variables (.env) to configure PubNub, which is key for external communication.

▪ Input Data Flows: How user actions in UI components trigger PubNub communications.
▪ Dependency Relationships: Show how pages depend on and compose various smaller React components.
▪ Configuration Flow: Illustrate how environment variables (PubNub keys) influence the PubNub integration module.

- Architectural Patterns:
▪ The separation of concerns is evident through the separation of components (reusable UI elements) and pages (views that structure these components).
▪ Emphasize the modular design (each component resides in its own folder with dedicated styling and logic).

- "Entry Point & Bootstrapping" (index.tsx, main.tsx)
- "Pages" (landing, room, error)
- "Components" (createRoom, joinRoom, deck, flipcard, header, footer, invite)
- Incorporate a note or a separate section for the Static Assets (public) which outlines its role in hosting index.html and related resources.
- Optionally, highlight configurations via an annotation that shows “.env” providing PubNub keys to the system.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Frontend (React Application)"
        subgraph "Entry Points"
            idx["index.tsx"]
            mtx["main.tsx"]
        end
        subgraph "Pages"
            landing["Landing Page"]
            room["Room Page"]
            error["Error Page"]
            subgraph "Room Details"
                participant["ParticipantCards"]
                result["Result"]
                taskbar["Taskbar"]
                login["Login"]
                roomDetail["Room Detail"]
            end
        end
        subgraph "Components"
            header["Header"]
            footer["Footer"]
            invite["Invite"]
            createRoom["CreateRoom"]
            joinRoom["JoinRoom"]
            deck["Deck"]
            flipCard["FlipCard"]
        end
    end

    subgraph "External Services"
        pubnub["PubNub Real-Time API"]
    end

    subgraph "Static Assets"
        static["public"]
    end

    conf["Configuration (.env)"]

    %% Data Flow Arrows
    static -->|"serves"| idx
    idx -->|"initializes"| mtx
    mtx -->|"boots"| landing

    landing -->|"composes"| header
    landing -->|"composes"| footer

    room -->|"composes"| header
    room -->|"composes"| footer
    room -->|"composes"| createRoom
    room -->|"composes"| joinRoom
    room -->|"composes"| deck
    room -->|"composes"| flipCard
    room -->|"composes"| invite

    room -->|"includes"| participant
    room -->|"includes"| result
    room -->|"includes"| taskbar
    room -->|"includes"| login
    room -->|"includes"| roomDetail

    room -->|"integrates"| pubnub
    pubnub -->|"updates"| room

    conf -->|"configures"| pubnub

    %% Click Events
    click idx "https://github.com/pandey-mohit/planningpoker/blob/main/src/index.tsx"
    click mtx "https://github.com/pandey-mohit/planningpoker/blob/main/src/main.tsx"
    click header "https://github.com/pandey-mohit/planningpoker/tree/main/src/components/header"
    click footer "https://github.com/pandey-mohit/planningpoker/blob/main/src/components/footer/index.tsx"
    click invite "https://github.com/pandey-mohit/planningpoker/blob/main/src/components/invite/index.tsx"
    click createRoom "https://github.com/pandey-mohit/planningpoker/blob/main/src/components/createroom/index.tsx"
    click joinRoom "https://github.com/pandey-mohit/planningpoker/blob/main/src/components/joinroom/index.tsx"
    click deck "https://github.com/pandey-mohit/planningpoker/blob/main/src/components/deck/index.tsx"
    click flipCard "https://github.com/pandey-mohit/planningpoker/blob/main/src/components/flipcard/index.tsx"
    click landing "https://github.com/pandey-mohit/planningpoker/blob/main/src/pages/landing/index.tsx"
    click room "https://github.com/pandey-mohit/planningpoker/blob/main/src/pages/room/index.tsx"
    click error "https://github.com/pandey-mohit/planningpoker/blob/main/src/pages/error/index.tsx"
    click participant "https://github.com/pandey-mohit/planningpoker/blob/main/src/pages/room/section/participantCards.tsx"
    click result "https://github.com/pandey-mohit/planningpoker/blob/main/src/pages/room/section/result.tsx"
    click taskbar "https://github.com/pandey-mohit/planningpoker/blob/main/src/pages/room/section/taskbar.tsx"
    click login "https://github.com/pandey-mohit/planningpoker/blob/main/src/pages/room/login.tsx"
    click roomDetail "https://github.com/pandey-mohit/planningpoker/blob/main/src/pages/room/room.tsx"
    click pubnub "https://github.com/pandey-mohit/planningpoker/blob/main/src/pubnub.js"
    click static "https://github.com/pandey-mohit/planningpoker/tree/main/public"

    %% Styles
    classDef react fill:#cce5ff,stroke:#000,stroke-width:1px;
    classDef external fill:#d4edda,stroke:#000,stroke-width:1px;
    classDef static fill:#fff3cd,stroke:#000,stroke-width:1px;
    classDef config fill:#f8d7da,stroke:#000,stroke-width:1px;
    
    class idx,mtx,landing,room,error,participant,result,taskbar,login,roomDetail,header,footer,invite,createRoom,joinRoom,deck,flipCard react;
    class pubnub external;
    class static static;
    class conf config;
```
