Scratch and reveal symbols to win!
This demo is a compact client for a Scratch Card prototype. It demonstrates a PixiJS-powered card reveal UI, with client-side scratch interactions and integration with a backend game service.
The backend is implemented as a NestJS service exposing REST endpoints to power the UI. Key endpoints used by this demo:
/api/new (POST) — creates a new scratch card session and
returns a gameId.
/api/info (GET) — returns card metadata (prize layout,
scratchable areas, paytable).
/api/scratch (POST) — accepts
{ gameId, positions } to report scratched sections for
server-side evaluation.
/api/bet (POST) — updates the bet amount for the session.
/api/reveal (POST) — finalizes the scratch, calculates
hits/prizes, and returns payout information.
/api/paytable (POST) — returns prize multipliers for
different reveal combinations.
gameId,
betAmount, revealedPositions, and
createdAt for auditing and debugging.
The core engine handles scratch tracking, prize calculation, and payout evaluation. Conceptually:
constructor(),
setBet(bet), reveal(positions),
getScreen(), getState().
Notes: this demo is simplified for portfolio purposes.