GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Priyank-Adhav/Decentralized-Event-Ticketing: A decentralized event ticketing system that transforms tickets into verifiable NFTs with IPFS metadata, EIP-712 voucher redemption, and automated resale marketplace on Polygon blockchain.

BranchesTags
Open more actions menu

Latest commit

 

History

99 Commits
99 Commits

Folders and files

NameName
Last commit message
Last commit date
backend
backend
 
 
blockchain
blockchain
 
 
frontend
frontend
 
 
images
images
 
 
subgraph/ticket-nft-subgraph
subgraph/ticket-nft-subgraph
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 

Repository files navigation

Decentralized Event Ticketing

A comprehensive blockchain-based ticketing platform that transforms event tickets into verifiable NFTs on the Polygon network. This system provides secure, transparent, and decentralized ticket management with built-in resale marketplace, royalty collection, and access control features.

Table of Contents

  • Overview
  • Architecture
  • Technology Stack
  • Project Structure
  • Getting Started
  • Configuration
  • Deployment
  • Development

Overview

The Decentralized Ticketing System is a full-stack Web3 application that enables event organizers to create, manage, and sell tickets as non-fungible tokens (NFTs) on the blockchain. Each ticket is a unique ERC-721 token with metadata stored on IPFS, ensuring immutability and verifiability.

Key Capabilities

  • NFT-Based Tickets: Each ticket is a unique ERC-721 token with on-chain ownership
  • Voucher System: Secure EIP-712 signed vouchers for ticket redemption
  • Resale Marketplace: Built-in secondary market with automatic royalty collection
  • Access Control: Role-based permissions for organizers, gatekeepers, and marketplaces
  • IPFS Integration: Decentralized metadata storage via Pinata
  • The Graph Integration: Indexed blockchain data for efficient querying
  • Refund System: Automated refund processing before event dates
  • Check-In System: Gatekeeper role for marking tickets as used

System Architecture

Architecture Diagram

The system consists of four main components:

  1. Blockchain Layer: Smart contracts deployed on Polygon Amoy testnet
  2. Backend API: Express.js server handling ticket creation, voucher generation, and IPFS operations
  3. Frontend Application: React-based web interface for users and organizers
  4. Subgraph: The Graph protocol subgraph for indexing and querying blockchain events

Data Flow

  1. Organizer creates event and tickets through the backend API
  2. Ticket metadata is uploaded to IPFS via Pinata
  3. Backend generates EIP-712 signed vouchers for each ticket
  4. Users redeem vouchers on-chain, minting NFT tickets
  5. Subgraph indexes all blockchain events for efficient querying
  6. Frontend displays tickets and enables marketplace interactions

Technology Stack

Blockchain

  • Solidity: ^0.8.20
  • OpenZeppelin Contracts: Security-audited contract libraries
  • Network: Polygon Amoy Testnet (Chain ID: 80002)

Backend

  • Node.js: Runtime environment
  • Pinata: IPFS pinning service
  • Axios: HTTP client for API requests

Frontend

  • React: ^19.1.1 - UI library
  • TypeScript: Type-safe JavaScript
  • Ethers.js: ^6.15.0 - Blockchain interaction
  • Web3Modal: Wallet connection management
  • Tailwind CSS: Utility-first CSS framework
  • Framer Motion: Animation library

Subgraph

  • The Graph Protocol: Decentralized indexing protocol
  • AssemblyScript: Subgraph handler language
  • Graph CLI: Development and deployment tools

Project Structure

Decentralized-Event /
├── blockchain/                     # Smart contracts
│   ├── contracts/                  # Solidity sources
│   ├── migrations/                 # Truffle migrations
│   ├── scripts/                    # Admin & helper scripts
│   ├── test/                        # Contract tests
│   ├── build/                       # Compiled artifacts
│   └── truffle-config.js
│
├── backend/                        # Express API + IPFS + voucher service
│   ├── api/                        # Serverless entry (Vercel)
│   ├── services/                   # Voucher, IPFS, caching logic
│   ├── scripts/                    # Ticket creation utilities
│   ├── data/                       # Local cache
│   ├── server.js                   # Dev server
│   └── package.json
│
├── frontend/                       # React + Vite dApp
│   ├── src/
│   │   ├── components/             # Reusable UI
│   │   ├── pages/                  # App screens
│   │   ├── context/                # Web3 + Wallet contexts
│   │   ├── hooks/                  # Reusable hooks
│   │   ├── utils/                  # ABI, IPFS, subgraph helpers
│   │   ├── App.tsx
│   │   └── main.tsx
│   ├── public/
│   ├── vite.config.ts
│   ├── tailwind.config.js
│   └── package.json
│
├── subgraph/                       # The Graph subgraph
│   └── ticket-nft-subgraph/
│       ├── schema.graphql
│       ├── subgraph.yaml
│       ├── src/                    # Mapping functions
│       └── abis/
│
└── README.md

Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn package manager
  • MetaMask or compatible Web3 wallet
  • Polygon Amoy testnet MATIC tokens (for gas fees)
  • Pinata account (for IPFS storage)
  • The Graph Studio account (for subgraph deployment)

Installation

  1. Clone the repository
git clone https://github.com/Priyank-Adhav/Decentralized-Event-Ticketing
cd Decentralized_ticketing_system-1
  1. Install blockchain dependencies
cd blockchain
npm install
  1. Install backend dependencies
cd ../backend
npm install
  1. Install frontend dependencies
cd ../frontend
npm install
  1. Install subgraph dependencies
cd ../subgraph/ticket-nft-subgraph
npm install
# or
yarn install

Configuration

Blockchain Configuration

Create a .env file in the blockchain/ directory:

PRIVATE_KEY=your_private_key_here
AMOY_RPC_URL=https://rpc-amoy.polygon.technology/
SIGNER=0x... # Address that will sign vouchers
EVENT_TIMESTAMP=1735689600 # Unix timestamp
PAYEES=0x...,0x... # Comma-separated addresses
SHARES=70,30 # Comma-separated share percentages

Backend Configuration

Create a .env file in the backend/ directory:

PORT=3001
CONTRACT_ADDRESS=0x... # Deployed TicketNFT contract address
CHAIN_ID=80002
AMOY_RPC_URL=https://rpc-amoy.polygon.technology/
PRIVATE_KEY=your_private_key_here # For voucher signing

# MongoDB Configuration (MongoDB Atlas)
MONGO_URI=mongodb+srv://username:[email protected]/ticketing?retryWrites=true&w=majority

# IPFS Configuration (Pinata)
PINATA_JWT=your_pinata_jwt_token
# OR use API key/secret:
PINATA_API_KEY=your_api_key
PINATA_SECRET_KEY=your_secret_key
PINATA_GATEWAY_URL=https://gateway.pinata.cloud/ipfs

FRONTEND_URL=http://localhost:5173

Frontend Configuration

Create a .env file in the frontend/ directory:

VITE_BACKEND_URL=http://localhost:3001
VITE_CONTRACT_ADDRESS=0x... # Deployed TicketNFT contract address
VITE_CHAIN_ID=80002
VITE_RPC_URL=https://rpc-amoy.polygon.technology/
VITE_WALLET_CONNECT_PROJECT_ID=your_walletconnect_project_id

Subgraph Configuration

Update subgraph/ticket-nft-subgraph/subgraph.yaml with your contract address and start block:

source:
  address: "0xYourContractAddress"
  startBlock: 27855492

Deployment

1. Deploy Smart Contracts

cd blockchain

# Compile contracts
npm run compile

# Deploy to Polygon Amoy
npm run migrate:amoy

Save the deployed contract address for use in other components.

2. Configure Voucher Signer

Update the backend .env with the deployed contract address and ensure the PRIVATE_KEY matches the signer address configured in the contract.

3. Deploy Subgraph

cd subgraph/ticket-nft-subgraph

# Generate code
npm run codegen

# Build subgraph
npm run build

# Deploy to The Graph Studio
npm run deploy

4. Start Backend Server

cd backend

npm start

5. Start Frontend Application

cd frontend

# Development server
npm run dev

About

A decentralized event ticketing system that transforms tickets into verifiable NFTs with IPFS metadata, EIP-712 voucher redemption, and automated resale marketplace on Polygon blockchain.

ty-bt-frontend-dlbae0eb5-priyanks-projects-cd71d2c1.vercel.app

Topics

blockchainerc-721ipfsmarketplacenftpolygonticketingweb3

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.