/p2ppp

Primary LanguageTypeScript

Peer to Peer Planning Poker

P2PPP is a proof-of-concept planning poker app using peer-to-peer WebRTC data channels to coordinate voting among players at a table.

The application is implemented using Next.js 13, PeerJS, Fauna (DB) and is deployed on Vercel.

For another example of a Planning Poker implementation by a colleague of mine, see vote.poker (code).

Getting Started

First, install the project dependencies:

npm install
# or
yarn install
# or
pnpm install

Fauna is temporarily required to allow peers to discover each other

Sign up for a Fauna DB account and create a collection with the following properties:

{
  name: "players",
  history_days: 0,
  ttl_days: 1
}

Create the following indices:

{
  name: "player",
  unique: true,
  serialized: true,
  source: "players",
  terms: [
    {
      field: ["data", "tableUuid"]
    },
    {
      field: ["data", "playerUuid"]
    }
  ],
  values: [
    {
      field: ["data", "playerUuid"]
    },
    {
      field: ["data", "playerName"]
    },
    {
      field: ["ref"]
    }
  ]
}
{
  name: "table",
  unique: false,
  serialized: true,
  source: "players",
  terms: [
    {
      field: ["data", "tableUuid"]
    }
  ],
  values: [
    {
      field: ["data", "playerUuid"]
    },
    {
      field: ["data", "playerName"]
    }
  ]
}

Create a .env.local file in your working directory containing a Fauna DB key:

FAUNADB_SECRET=<key with read/write access to your DB table>

Next, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.