A decentralized application (DApp) for managing and purchasing event tickets on the Ethereum blockchain.
The Event Ticketing DApp allows users to create events, buy tickets for those events, and transfer tickets to other Ethereum addresses. The DApp is built using Solidity for the smart contract, React for the frontend, and Web3.js for interacting with the Ethereum blockchain.
- Create Event: Users can create new events by specifying the event name, date, ticket price, and the number of available tickets.
- Buy Ticket: Users can purchase tickets for existing events by specifying the event ID and the desired quantity of tickets. Payment is made in Ether.
- Transfer Ticket: Users can transfer their purchased tickets to other Ethereum addresses.
To run this project locally, follow these steps:
-
Clone the repository:
git clone <repository_url>
-
Navigate to the project directory:
cd event-ticketing-dapp
-
Install dependencies for the frontend:
npm install
-
Install Ganache GUI.
-
Now, create a project on Ganache GUI and pass on the path of truffle-config.js file
-
Compile & migrate the smart contract using Truffle.
cd truffle
truffle compile
truffle migrate
-
Start the development server:
cd client
npx webpack
npm start
-
Ensure you have MetaMask installed in your browser and connected to the desired Ethereum network (Ganache, in this case).
contracts/EventContract.sol
: Solidity smart contract for managing events and ticket transactions.src/App.jsx
: React component for the frontend UI and interaction with the smart contract.src/contracts/EventContract.json
: JSON file containing the compiled ABI and network information of the smart contract.
- Connect MetaMask to the desired Ethereum network (e.g., localhost for development or Rinkeby for testing).
- Create an event by filling out the event creation form and clicking "Create Event".
- Purchase tickets for an existing event by entering the event ID and desired ticket quantity, then clicking "Buy Ticket".
- Transfer tickets to another Ethereum address by entering the event ID, ticket quantity, and recipient address, then clicking "Transfer Ticket".
Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.
This project is licensed under the MIT License.
For any questions or inquiries, feel free to contact raise an issue. 🙂