Sealva-Devs
Packdraw-Bet
TypeScriptโœจ New

A pack-opening platform that combines real-time reward mechanics, crypto payments, and scalable backend infrastructure.

Last updated Jul 1, 2026
61
Stars
819
Forks
0
Issues
0
Stars/day
Attention Score
97
Language breakdown
No language data available.
โ–ธ Files click to expand
README

PackDraw / HypePack

A pack-opening platform that combines real-time reward mechanics, crypto payments, and scalable backend infrastructure. Built for production deploymentโ€”not a proof-of-conceptโ€”with emphasis on performance, security, and operational flexibility.

This repository contains the frontend only.
It is published publicly so potential builders, clients, and collaborators can review the UI, product flows, and implementation quality. The full codebaseโ€”including the backend API, admin dashboard, payment webhooks, and database layerโ€”is available on request. See Contact & Collaboration below.

https://github.com/user-attachments/assets/0c5b220c-3641-4127-af8d-99fccab0bc73


What's in This Repo

| Included | Not included (full platform) | | ------------------------------------------------- | ----------------------------------- | | Next.js user-facing web app | Backend API & services | | Pack store, opening animations, battles, upgrader | Admin dashboard | | Account, wallet, and history UI | Database & server-side reward logic | | Real-time client (Socket.io) | NOWPayments webhook handling | | Auth UI (email + Google OAuth) | Production deployment configs |

The frontend expects a running backend API. Most screens will load, but login, payments, pack opens, and live updates require the backend from the full platform.


Overview

PackDraw (HypePack) delivers an instant, engaging unboxing experience where users purchase digital packs, open them in real time, and receive randomized rewards. The platform integrates cryptocurrency payments, persistent user accounts, transaction history, and an administrative layer for day-to-day operations.

The product sits at the intersection of gaming mechanics, digital collectibles, and seamless Web3 paymentsโ€”a pattern that continues to drive strong user engagement when execution is fast, fair, and transparent.


Key Features

| Feature | Description | | ---------------------------------- | --------------------------------------------------------------------------- | | Real-time pack opening | Live, animated pack-opening flow with immediate feedback and reward reveal | | Randomized reward distribution | Configurable loot tables and probability-weighted outcomes | | Crypto payments | Deposit and checkout via NOWPayments | | User accounts | Registration, authentication, balances, and inventory management | | Transaction management | Full audit trail for deposits, purchases, openings, and payouts | | Admin dashboard | Platform operations: users, packs, rewards, transactions, and configuration | | Scalable architecture | Backend designed for horizontal growth and high-concurrency events |


Platform Workflow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   User      โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Crypto      โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Purchase   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Real-time   โ”‚
โ”‚   Account   โ”‚     โ”‚  Deposit     โ”‚     โ”‚  Pack       โ”‚     โ”‚  Pack Open   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚                    โ”‚                    โ”‚                    โ”‚
       โ”‚                    โ–ผ                    โ–ผ                    โ–ผ
       โ”‚             NOWPayments           Balance /           Randomized
       โ”‚             webhook               ledger update       reward grant
       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Admin     โ”‚  โ† monitors users, packs, odds, transactions, and platform health
โ”‚   Dashboard โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • Onboard โ€” User creates an account and completes authentication.
  • Fund โ€” User deposits via supported cryptocurrencies through NOWPayments.
  • Purchase โ€” User selects and buys a pack; balance is debited atomically.
  • Open โ€” Pack opening runs in real time; reward is drawn from the configured distribution.
  • Manage โ€” User views inventory and transaction history; admins oversee operations via the dashboard.

Architecture Highlights

Frontend (this repository)

  • Next.js App Router with responsive UI optimized for the pack-opening experience
  • Real-time updates via Socket.io during purchases, battles, and reveal flows
  • User-facing account, wallet, cart, battles, upgrader, rewards, and history views
  • Zustand for client state; HeroUI + Tailwind CSS for components and styling

Backend (full platform โ€” not in this repo)

  • RESTful APIs and WebSocket events for auth, payments, packs, and rewards
  • Idempotent payment webhook handling for NOWPayments callbacks
  • Server-side reward resolutionโ€”outcomes are determined on the backend, not the client
  • Structured logging and transaction records for auditability

Payments (NOWPayments)

  • Crypto deposit flow with IPN/webhook confirmation
  • Balance crediting only after verified payment status
  • Reconciliation support for admin and support workflows

Admin Operations

  • User lookup and account management
  • Pack and reward catalog configuration
  • Probability / loot-table management
  • Transaction and payment monitoring
  • Platform settings and operational controls

Design Principles

  • Performance โ€” Low-latency openings and responsive UI under load
  • Scalability โ€” Stateless services and data layers that scale horizontally
  • Security โ€” Server-authoritative rewards, validated webhooks, and protected admin routes
  • User experience โ€” Clear flows from deposit โ†’ purchase โ†’ reveal โ†’ inventory
  • Operational flexibility โ€” Admin tools to adjust catalog and monitor health without redeploys

Tech Stack

| Layer | Technology | | -------------------------- | ----------------------------------------------------------------------- | | Frontend | Next.js 16, React 19, TypeScript, Tailwind CSS 4, HeroUI, Framer Motion | | Client state | Zustand | | Real-time | Socket.io client | | HTTP | Axios | | Auth (UI) | Google OAuth (@react-oauth/google) | | Media uploads | Pinata IPFS (avatars, pack images) | | Backend (full platform) | Node.js API, PostgreSQL, server-side WebSockets | | Payments (full platform) | NOWPayments API |


Getting Started

Prerequisites

  • Node.js 18+ and npm
  • A running PackDraw backend API (from the full platform) for authenticated and live features
  • Optional: Pinata credentials for avatar/image uploads; Google Cloud OAuth client ID for Google sign-in

Installation

git clone https://github.com/<your-username>/packdraw.git
cd packdraw

npm install

Environment variables

Copy the example file and set your values:

cp env.example .env.local

On Windows, if .env.local is blocked, use env.local instead (as noted in env.example).

| Variable | Required | Description | | -------------------------------- | ---------------- | ---------------------------------------------------------------------------------- | | NEXTPUBLICAPI_URL | Yes | Backend API base URL including /api/v1 (e.g. http://localhost:3000/api/v1) | | NEXTPUBLICGOOGLECLIENTID | For Google login | OAuth 2.0 client ID from Google Cloud Console | | NEXTPUBLICPINATAAPIKEY | For uploads | Pinata API key | | NEXTPUBLICPINATAAPISECRET | For uploads | Pinata API secret | | NEXTPUBLICPINATAGATEWAYURL | Optional | IPFS gateway URL (defaults to Pinata) | | NEXTPUBLICPLATFORM_MARGIN | Optional | Platform margin for user-created packs (default 0.08) |

Example .env.local:

NEXTPUBLICAPI_URL=http://localhost:3000/api/v1
NEXTPUBLICGOOGLECLIENTID=yourgoogleclient_id
NEXTPUBLICPINATAAPIKEY=
NEXTPUBLICPINATAAPISECRET=
NEXTPUBLICPINATAGATEWAYURL=https://gateway.pinata.cloud/ipfs

Run locally

# Development (default: http://localhost:80)
npm run dev

Production build

npm run build npm start

Notes:

  • The dev script binds to port 80. On some systems that requires elevated permissions; if startup fails, run on another port, e.g. npx next dev --webpack --port 3000.
  • Point NEXTPUBLICAPI_URL at your backend. Without it, the UI renders but API calls and WebSockets will fail.
  • Google sign-in needs a valid NEXTPUBLICGOOGLECLIENTID and the redirect URI configured in Google Cloud Console.

Lint

npm run lint

Project Structure

packdraw/
โ”œโ”€โ”€ public/
โ”‚   โ””โ”€โ”€ assets/              # Images, icons, audio, avatars
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/                 # Next.js App Router pages
โ”‚   โ”œโ”€โ”€ components/          # UI by feature (packs, battles, account, modals, โ€ฆ)
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ api/             # REST client modules
โ”‚   โ”‚   โ”œโ”€โ”€ services/        # IPFS and other client services
โ”‚   โ”‚   โ””โ”€โ”€ websocket.ts     # Socket.io real-time client
โ”‚   โ””โ”€โ”€ store/               # Zustand stores
โ”œโ”€โ”€ env.example
โ”œโ”€โ”€ next.config.ts
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

Security Considerations

  • Server-side RNG โ€” Reward outcomes must never be computed or trusted on the client.
  • Webhook verification โ€” Validate NOWPayments IPN signatures and payment status before balance updates.
  • Idempotency โ€” Handle duplicate webhook deliveries without double-crediting accounts.
  • Admin access โ€” Role-based access control; admin routes protected and audited.
  • Rate limiting โ€” Apply limits on auth, payment, and pack-opening endpoints.
  • Secrets โ€” Never commit API keys; use environment variables and secret managers in production.

Demo

| Pack Store | Pack Opening | Admin Dashboard | | ------------ | ------------ | --------------- | | screenshot | screenshot | screenshot |

Live demo: Add link when deployed Workflow video: add link to your demo recording


Roadmap

  • Additional cryptocurrency support
  • Enhanced pack animations and sound design
  • Referral and loyalty programs
  • Public provably-fair verification (optional)
  • Mobile-optimized PWA experience
  • Analytics and reporting dashboards

About

This project was built as a production-oriented Web3 gaming platformโ€”combining instant engagement mechanics with reliable payment and account infrastructure. This public repo showcases the frontend implementation; the complete system includes backend services, admin tooling, and payment integration.

Related work:

  • Web3 platforms & custom blockchain integrations
  • DeFi applications
  • Crypto gaming & casino platforms
  • Prediction markets
  • NFT ecosystems

Contact & Collaboration

Interested in the full codebase, technical details, custom builds, or collaboration?


License

Specify your license here (e.g. MIT, proprietary, or "All rights reserved" for a portfolio/demo repository).


Built with a focus on performance, scalability, security, and real-world deployment.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท Sealva-Devs/Packdraw-Bet ยท Updated daily from GitHub