# 12cards

> 12 Cards is an online game (amusement only) where players can bet Game Points (GP) on any of the 12 available cards. Every 2 minutes, a roulette is spun, revealing a multiplier and the drawn card. If the player's predicted card is drawn, the player wins GP Bet * Multiplier * 10 GP. This is easily one of the best projects I have built till date.

A project by [AshterNext](https://ashternext.com), a software development studio in Nashik, Maharashtra, India. Project write-ups are written in the first person by the founder, Malik Bagwala.

## Overview

- **Page:** https://ashternext.com/p/12cards
- **Tech stack:** PostgreSQL, Django, React, GraphQL, TypeScript, Hasura
- **Category:** Professional work
- **Built by:** AshterNext (https://ashternext.com)

## Write-up

This project inherits from the [OnRoad - Project](https://gitlab.com/MalikBagwala/onroad) so much of the features are quite the same, listing a few features unique to this project.

#### ⏰ Realtime APIs

The game utilises web-sockets (WSS) to keep various part of the game in sync with each other without needed for the user to refresh the page eg. Roulette, Round History etc.

#### 🧑‍💻 In-house Algorithm

The game utilises a well-tested, configurable algorithm that ensures users have an enjoyable experience while still protecting the house from any point losses.

#### 🍀 Custom Three Layer Roulette

The core of this project is a custom 3-wheel lucky spinner that determines the outcome of a placed bet. The first wheel displays the card rank (K, Q, J), the second wheel shows the symbol (Heart, Diamond, Spade, Club), and the third wheel indicates the bonus multiplier (1-10X). All three wheels spin in alternating directions, creating a visual effect that resembles a shuffle.

[12Cards Roulette](https://videos.ctfassets.net/ij35tfpwroqj/3IY5uTUp2Culq6o79pSLMc/b809d00e2b5de67b8c1fcb4eb790e799/Screen_Recording_2024-07-11_at_6.35.58_PM.mov)

#### 🖨️ Printer Integration via Web USB

The project supports printing winning receipts via [WebUSB API](https://developer.chrome.com/docs/extensions/how-to/web-platform/webusb), allowing the printer to connect directly from the web interface. This feature is optional and can be enabled by the user.

#### 💻 Demo Video

[12 Cards Demo](https://videos.ctfassets.net/ij35tfpwroqj/7fYri7pPlVKVZpt5Flxo1t/f972de2e142eff9ca11d31ec5cf2a09c/12_cards_demo.webm)

_This project has been_ **_sold to a client_**_; therefore, I_ **_cannot share the source code or provide a live demo_**_. However, please check out the attached video for a recorded demonstration. Kindly note that this project does not involve real money in any way; it is designed purely for entertainment and to foster creativity._

## About AshterNext

AshterNext is a software development and digital solutions studio based in Nashik, Maharashtra, India, founded by Malik Bagwala. We design and build customer-first software products (apps, websites, SaaS platforms and design systems) that are easy to use and good to look at, and that help people and brands reach their business goals. We lead with product design and an understanding of the user, then pick the technology that delivers the best solution for the business.

Contact: [malik@ashternext.com](mailto:malik@ashternext.com) · More projects: https://ashternext.com/index.md
