A decentralized event ticketing application built on Ethereum blockchain using React and Solidity.
- Event Creation: Artists can create events with customizable details
- Ticket Minting: Users can purchase tickets as NFTs
- Resale Market: Secondary market for ticket trading
- Seat Management: Automatic seat assignment for tickets
- Royalty System: 10% royalty on secondary sales
- Limit Protection: Maximum 5 tickets per address per event
- Frontend: React.js, ethers.js, react-hot-toast
- Backend: Solidity, Hardhat
- Blockchain: Ethereum (Sepolia Testnet)
- Smart Contracts: OpenZeppelin (ERC721, Ownable, ReentrancyGuard)
- Node.js (v14 or higher)
- MetaMask browser extension
- Sepolia testnet ETH
- Alchemy or Infura account
git clone <your-repo-url>
cd event-ticketing-dApp# Install root dependencies
npm install
# Install frontend dependencies
cd frontend
npm install
cd ..Create a .env file in the root directory:
# Your wallet's private key (without 0x prefix)
PRIVATE_KEY=your_private_key_here
# Your Alchemy/Infura Sepolia RPC URL
SEPOLIA_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR-API-KEY# Compile contracts
npx hardhat compile
# Deploy to Sepolia
npx hardhat run scripts/deploy-sepolia.js --network sepolia
# Update frontend configuration
node scripts/update-frontend-config.jscd frontend
npm startThe application will be available at http://localhost:3000
- Install MetaMask browser extension
- Add Sepolia testnet to MetaMask:
- Network Name: Sepolia Testnet
- RPC URL: Your Alchemy/Infura URL
- Chain ID: 11155111
- Currency Symbol: ETH
Visit Sepolia Faucet to get test ETH.
event-ticketing-dApp/
├── contracts/ # Smart contracts
│ └── EventTicket.sol
├── frontend/ # React application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── config/ # Contract configuration
│ │ └── context/ # Web3 context
│ └── public/
├── scripts/ # Deployment scripts
│ ├── deploy-sepolia.js
│ ├── update-frontend-config.js
│ └── setup-sepolia.js
├── hardhat.config.js # Hardhat configuration
└── README.md
- ERC721 NFT Standard: Each ticket is a unique NFT
- Event Management: Create and manage events
- Ticket Minting: Purchase tickets with ETH
- Resale System: List and buy tickets on secondary market
- Royalty System: 10% royalty on resales
- Seat Assignment: Automatic seat numbering
- Purchase Limits: Max 5 tickets per address per event
- ReentrancyGuard: Prevents reentrancy attacks
- Ownable: Access control for admin functions
- Input Validation: Comprehensive parameter checks
- Safe Math: Built-in overflow protection (Solidity 0.8+)
# Run tests
npx hardhat test- Connect MetaMask wallet
- Click "Create Event"
- Fill in event details (name, date, venue, price, max tickets)
- Submit transaction
- Event is now available for ticket sales
- Connect MetaMask wallet
- Browse available events
- Click "Buy Ticket" on desired event
- Confirm transaction in MetaMask
- Ticket NFT is minted to your wallet
- Go to "My Tickets"
- Click "List for Resale" on a ticket
- Set resale price
- Others can buy from "Resale Market"
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
- This is a testnet deployment for development purposes
- Never use real private keys in development
- Always test thoroughly before mainnet deployment
- Keep your private keys secure and never commit them to version control