Skip to content

Real-time Planning Poker app built with Phoenix 1.8 + LiveView 1.0. No database required (GenServer only).

License

Notifications You must be signed in to change notification settings

daisuke8000/phx-poker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhxPoker

Elixir Phoenix LiveView

Real-time planning poker built with Phoenix LiveView. No database required.

Features

  • Real-time voting with WebSocket sync
  • Multiple card presets (Fibonacci, T-Shirt, Powers of 2, etc.)
  • Player and Spectator roles
  • Vote statistics (avg, min, max)
  • Round history (last 10 rounds)
  • Room link sharing with clipboard copy
  • Results export as Markdown

Tech Stack

  • Phoenix 1.8 + LiveView 1.1 - Real-time UI without JavaScript
  • GenServer - In-memory room state (no database)
  • PubSub + Presence - Real-time synchronization
  • Tailwind CSS + daisyUI - Modern UI components

Architecture

┌─────────────────────────────────────────────────────────────┐
│                      Supervision Tree                       │
├─────────────────────────────────────────────────────────────┤
│  Application                                                │
│  ├── PubSub           (message broadcasting)                │
│  ├── Registry         (room process lookup)                 │
│  ├── RoomSupervisor   (DynamicSupervisor)                   │
│  │   └── RoomServer   (1 GenServer per room)                │
│  ├── Presence         (online user tracking)                │
│  └── Endpoint         (HTTP/WebSocket)                      │
└─────────────────────────────────────────────────────────────┘

Data Flow

Browser ←──WebSocket──→ LiveView ←──PubSub──→ RoomServer (GenServer)
                            ↑                       │
                            └───── broadcast ───────┘
  1. LiveView handles UI events (phx-click, phx-submit)
  2. RoomServer manages room state (players, votes, history)
  3. PubSub broadcasts state changes to all connected clients
  4. Presence tracks online users per room

Project Structure

lib/
├── planning_poker/
│   ├── application.ex        # Supervision tree
│   └── rooms/
│       ├── room.ex           # Room state struct & logic
│       ├── room_server.ex    # GenServer (1 per room)
│       └── room_supervisor.ex # DynamicSupervisor
└── planning_poker_web/
    ├── live/
    │   ├── lobby_live.ex     # Room creation/joining
    │   └── room_live.ex      # Main game UI
    ├── presence.ex           # Phoenix.Presence
    └── router.ex             # Routes: /, /room/:id

Quick Start

Prerequisites: Elixir 1.16+, Erlang/OTP 26+

# Install dependencies
mix setup

# Start server
mix phx.server

Visit localhost:4000

Development

# Run tests
mix test

# Format code
mix format

License

MIT License - see LICENSE file for details.

About

Real-time Planning Poker app built with Phoenix 1.8 + LiveView 1.0. No database required (GenServer only).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published