DEV: The Gathering

A decentralized/centralized collectible card game.

Which version do you wanna play?

CENTRALIZEDDECENTRALIZED (CRYPTO)

How does it work?

There are 21 (9 commons, six uncommon, four rare, two epic, and one legendary) cards based on programming languages, frameworks, and libs. Each card has attributes like name, rarity, number, and art. The goal is to collect them all. For each booster pack a user opens, he gets three random cards.

The probability of obtaining a card by its rarity is:

  • 40% chance for common cards;
  • 30% chance for uncommon cards;
  • 17% chance for rare cards;
  • 08% chance for epic cards;
  • 05% chance for a legendary card.

Every card has a 5% chance of being a foil.

How do the users get a booster pack?

In the centralized version, the user can open one booster pack daily.
In the decentralized version, the user can open as many as he likes.

Is there a cost?

In the centralized version, no, but in the decentralized its costs 0.05 MATIC and the gas fee.

Why is there a cost for the decentralized version?

Smart contracts running on the blockchain have a problem generating real random numbers. To surpass that problem, we have to use an oracle service, which charges for every random data provided beside the transaction's gas fee.

In the decentralized version, is the card an NFT?

Not really. It's similar in the sense that the card has an owner, the contract can't change the ownership or any property of a card, and the data is stored on a blockchain, but the smart contract doesn't implement the ERC-721 standard.

What is the tech stack used to build DEV: The Gathering?

The web application uses React with Next.js, Typescript, styled-components, Bootstrap, Apollo Client, Firebase, and Ethers.js.
The centralized API uses an Apollo Server running on Firebase Cloud Functions, Firebase Authentication to handle authentication, and Firebase Firestore as a document database.
The decentralized version uses a Subgraph in The Graph for blockchain data indexation, Polygon as layer 2 Ethereum network, chainlink as oracle provider, and Solidity to develop the smart contract.

Who is behind this project, and what's it's purpose?

My name is Paulo Tarso. I'm a senior full-stack developer from Brazil. For this project, I decided to go for technologies I'm new to, so it was a learning effort aiming to improve my knowledge of the stack and technology.
While I'm well versed in React with javascript, Typescript, and Bootstrap, there was still much room to improve and learn React with Typescript and Next.js.
All the other technologies were my learning target, being my first time dealing with them.

There's a public source code?

Yeah, you can check it out on GitHub: