|
| 1 | +# Jam-on-Tickets 🎫 |
| 2 | + |
| 3 | +A decentralized peer-to-peer ticket exchange platform with smart escrow integration, built with Next.js, React, and Web3 technologies. |
| 4 | + |
| 5 | +## 🌟 Features |
| 6 | + |
| 7 | +### Core Functionality |
| 8 | +- **Secure Ticket Exchange**: Peer-to-peer ticket trading with smart contract escrow |
| 9 | +- **Wallet Integration**: MetaMask and WalletConnect support |
| 10 | +- **IPFS Storage**: Decentralized ticket image and metadata storage |
| 11 | +- **Real-time Status Updates**: Live escrow status tracking |
| 12 | +- **Chat System**: Built-in messaging between buyers and sellers |
| 13 | +- **Mobile-First Design**: Responsive UI optimized for all devices |
| 14 | + |
| 15 | +### Smart Contract Features |
| 16 | +- **Escrow System**: Automated payment holding and ticket release |
| 17 | +- **Time-based Auto-release**: Automatic ticket release after payment confirmation |
| 18 | +- **Dispute Resolution**: Built-in cancellation and refund mechanisms |
| 19 | +- **Event Tracking**: Comprehensive transaction history and status updates |
| 20 | + |
| 21 | +### User Experience |
| 22 | +- **Intuitive Interface**: Clean, modern UI with smooth animations |
| 23 | +- **Advanced Filtering**: Search by event, venue, price, and date |
| 24 | +- **Real-time Notifications**: Toast notifications for transaction updates |
| 25 | +- **Status Indicators**: Visual feedback for all transaction states |
| 26 | + |
| 27 | +## 🚀 Tech Stack |
| 28 | + |
| 29 | +### Frontend |
| 30 | +- **Next.js 14**: React framework with App Router |
| 31 | +- **TypeScript**: Type-safe development |
| 32 | +- **Tailwind CSS**: Utility-first styling |
| 33 | +- **Framer Motion**: Smooth animations and transitions |
| 34 | +- **Lucide React**: Beautiful icons |
| 35 | + |
| 36 | +### Web3 Integration |
| 37 | +- **Ethers.js**: Ethereum library for smart contract interaction |
| 38 | +- **RainbowKit**: Wallet connection and management |
| 39 | +- **Wagmi**: React hooks for Ethereum |
| 40 | +- **IPFS**: Decentralized file storage |
| 41 | + |
| 42 | +### Smart Contracts |
| 43 | +- **Solidity**: Smart contract development |
| 44 | +- **Hardhat**: Development and testing framework |
| 45 | +- **OpenZeppelin**: Secure contract libraries |
| 46 | + |
| 47 | +## 📦 Installation |
| 48 | + |
| 49 | +1. **Clone the repository** |
| 50 | + ```bash |
| 51 | + git clone https://github.com/your-username/jam-on-tickets.git |
| 52 | + cd jam-on-tickets |
| 53 | + ``` |
| 54 | + |
| 55 | +2. **Install dependencies** |
| 56 | + ```bash |
| 57 | + npm install |
| 58 | + ``` |
| 59 | + |
| 60 | +3. **Set up environment variables** |
| 61 | + ```bash |
| 62 | + cp .env.example .env.local |
| 63 | + ``` |
| 64 | + |
| 65 | + Add your configuration: |
| 66 | + ```env |
| 67 | + NEXT_PUBLIC_INFURA_PROJECT_ID=your_infura_project_id |
| 68 | + NEXT_PUBLIC_INFURA_PROJECT_SECRET=your_infura_project_secret |
| 69 | + NEXT_PUBLIC_ESCROW_CONTRACT_ADDRESS=your_deployed_contract_address |
| 70 | + ``` |
| 71 | + |
| 72 | +4. **Run the development server** |
| 73 | + ```bash |
| 74 | + npm run dev |
| 75 | + ``` |
| 76 | + |
| 77 | +5. **Open your browser** |
| 78 | + Navigate to [http://localhost:3000](http://localhost:3000) |
| 79 | + |
| 80 | +## 🔧 Smart Contract Setup |
| 81 | + |
| 82 | +### Deploy the Escrow Contract |
| 83 | + |
| 84 | +1. **Install Hardhat** |
| 85 | + ```bash |
| 86 | + npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox |
| 87 | + ``` |
| 88 | + |
| 89 | +2. **Initialize Hardhat** |
| 90 | + ```bash |
| 91 | + npx hardhat init |
| 92 | + ``` |
| 93 | + |
| 94 | +3. **Deploy to your preferred network** |
| 95 | + ```bash |
| 96 | + npx hardhat run scripts/deploy.js --network <network-name> |
| 97 | + ``` |
| 98 | + |
| 99 | +4. **Update contract address** |
| 100 | + Copy the deployed contract address to your `.env.local` file. |
| 101 | + |
| 102 | +### Contract Functions |
| 103 | + |
| 104 | +```solidity |
| 105 | +// List a ticket for sale |
| 106 | +function listTicket(uint256 price, string memory imageHash, string memory metadata) |
| 107 | + external returns (uint256 ticketId) |
| 108 | +
|
| 109 | +// Create escrow for ticket purchase |
| 110 | +function createEscrow(uint256 ticketId) external payable returns (uint256 escrowId) |
| 111 | +
|
| 112 | +// Release ticket to buyer (seller only) |
| 113 | +function releaseTicket(uint256 escrowId) external |
| 114 | +
|
| 115 | +// Cancel escrow and refund buyer |
| 116 | +function cancelEscrow(uint256 escrowId) external |
| 117 | +``` |
| 118 | + |
| 119 | +## 🎯 Usage Guide |
| 120 | + |
| 121 | +### For Sellers |
| 122 | + |
| 123 | +1. **Connect Wallet**: Click "Connect Wallet" and authorize with MetaMask |
| 124 | +2. **List Ticket**: Click "Sell Ticket" and fill in ticket details |
| 125 | +3. **Upload Image**: Upload ticket screenshot or PDF (max 10MB) |
| 126 | +4. **Set Price**: Choose your preferred currency and price |
| 127 | +5. **Confirm Listing**: Review details and confirm the transaction |
| 128 | + |
| 129 | +### For Buyers |
| 130 | + |
| 131 | +1. **Browse Tickets**: Use search and filters to find tickets |
| 132 | +2. **Review Details**: Check seat information and seller details |
| 133 | +3. **Initiate Purchase**: Click "Buy Ticket" to start escrow |
| 134 | +4. **Confirm Payment**: Approve the transaction in your wallet |
| 135 | +5. **Wait for Release**: Seller will release the ticket after payment |
| 136 | + |
| 137 | +### Escrow Process |
| 138 | + |
| 139 | +1. **Payment Locked**: Buyer's payment is held in smart contract |
| 140 | +2. **Seller Notification**: Seller receives notification of payment |
| 141 | +3. **Ticket Release**: Seller releases ticket to buyer |
| 142 | +4. **Funds Released**: Payment automatically transferred to seller |
| 143 | +5. **Transaction Complete**: Both parties receive confirmation |
| 144 | + |
| 145 | +## 🔒 Security Features |
| 146 | + |
| 147 | +- **Smart Contract Escrow**: All payments held securely in smart contract |
| 148 | +- **Time-based Auto-release**: Automatic ticket release after confirmation |
| 149 | +- **Dispute Resolution**: Built-in cancellation mechanisms |
| 150 | +- **IPFS Storage**: Decentralized, tamper-proof file storage |
| 151 | +- **Wallet Verification**: Secure wallet connection and transaction signing |
| 152 | + |
| 153 | +## 📱 Mobile Support |
| 154 | + |
| 155 | +The application is fully responsive and optimized for mobile devices: |
| 156 | +- Touch-friendly interface |
| 157 | +- Mobile-optimized navigation |
| 158 | +- Responsive ticket cards |
| 159 | +- Mobile wallet integration |
| 160 | + |
| 161 | +## 🌐 Supported Networks |
| 162 | + |
| 163 | +- **Ethereum Mainnet**: Production deployment |
| 164 | +- **Polygon**: Low-fee transactions |
| 165 | +- **Arbitrum**: Fast and cost-effective |
| 166 | +- **Sepolia**: Testnet for development |
| 167 | + |
| 168 | +## 🛠️ Development |
| 169 | + |
| 170 | +### Project Structure |
| 171 | +``` |
| 172 | +src/ |
| 173 | +├── app/ # Next.js app router |
| 174 | +├── components/ # React components |
| 175 | +│ ├── TicketCard.tsx # Individual ticket display |
| 176 | +│ ├── TicketModal.tsx # Ticket listing form |
| 177 | +│ ├── FilterModal.tsx # Search filters |
| 178 | +│ ├── ChatModal.tsx # Buyer-seller chat |
| 179 | +│ └── EscrowStatus.tsx # Escrow status display |
| 180 | +├── lib/ # Utilities and services |
| 181 | +│ ├── contracts.ts # Smart contract integration |
| 182 | +│ └── ipfs.ts # IPFS file storage |
| 183 | +└── types/ # TypeScript type definitions |
| 184 | +``` |
| 185 | + |
| 186 | +### Available Scripts |
| 187 | + |
| 188 | +```bash |
| 189 | +# Development |
| 190 | +npm run dev |
| 191 | + |
| 192 | +# Build for production |
| 193 | +npm run build |
| 194 | + |
| 195 | +# Start production server |
| 196 | +npm start |
| 197 | + |
| 198 | +# Type checking |
| 199 | +npm run type-check |
| 200 | + |
| 201 | +# Linting |
| 202 | +npm run lint |
| 203 | +``` |
| 204 | + |
| 205 | +## 🤝 Contributing |
| 206 | + |
| 207 | +1. Fork the repository |
| 208 | +2. Create a feature branch (`git checkout -b feature/amazing-feature`) |
| 209 | +3. Commit your changes (`git commit -m 'Add amazing feature'`) |
| 210 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 211 | +5. Open a Pull Request |
| 212 | + |
| 213 | +## 📄 License |
| 214 | + |
| 215 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 216 | + |
| 217 | +## 🆘 Support |
| 218 | + |
| 219 | +- **Documentation**: [Wiki](https://github.com/your-username/jam-on-tickets/wiki) |
| 220 | +- **Issues**: [GitHub Issues](https://github.com/your-username/jam-on-tickets/issues) |
| 221 | +- **Discussions**: [GitHub Discussions](https://github.com/your-username/jam-on-tickets/discussions) |
| 222 | + |
| 223 | +## 🙏 Acknowledgments |
| 224 | + |
| 225 | +- [RainbowKit](https://rainbowkit.com/) for wallet integration |
| 226 | +- [IPFS](https://ipfs.io/) for decentralized storage |
| 227 | +- [OpenZeppelin](https://openzeppelin.com/) for secure smart contracts |
| 228 | +- [Tailwind CSS](https://tailwindcss.com/) for styling |
| 229 | + |
| 230 | +--- |
| 231 | + |
| 232 | +**Built with ❤️ for the Web3 community** |
0 commit comments