https://github.com/akmalhisyammm/ticketing-system-icp
A decentralized ticketing system built on the Internet Computer (IC) using Azle
https://github.com/akmalhisyammm/ticketing-system-icp
azle blockchain icp internet-computer smart-contract ticketing-system
Last synced: about 1 month ago
JSON representation
A decentralized ticketing system built on the Internet Computer (IC) using Azle
- Host: GitHub
- URL: https://github.com/akmalhisyammm/ticketing-system-icp
- Owner: akmalhisyammm
- License: mit
- Created: 2023-12-21T13:08:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-24T15:11:24.000Z (over 1 year ago)
- Last Synced: 2025-02-16T02:46:01.639Z (3 months ago)
- Topics: azle, blockchain, icp, internet-computer, smart-contract, ticketing-system
- Language: TypeScript
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ticketing System
This smart contract is a decentralized ticketing system built on the Internet Computer (IC) using Azle. The system allows organizer to create and sell tickets for their events in a secure, traceable, and transparent manner.
You can always refer to [The Azle Book](https://demergent-labs.github.io/azle/) for more in-depth documentation.
## Requirements
- [Node.js](https://nodejs.org/en/)
- [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/quickstart)## Installation
Clone this repository:
```bash
git clone https://github.com/akmalhisyammm/ticketing-system-icp.git
cd ticketing-system-icp
````dfx` is the tool you will use to interact with the IC locally and on mainnet. If you don't already have it installed:
```bash
npm run dfx_install
```Next you will want to start a replica, which is a local instance of the IC that you can deploy your canisters to:
```bash
npm run replica_start
```If you ever want to stop the replica:
```bash
npm run replica_stop
```Now you can deploy your canister locally:
```bash
npm install
npm run canister_deploy_local
```To call the methods on your canister:
```bash
npm run canister_call
```Assuming you have [created a cycles wallet](https://internetcomputer.org/docs/current/developer-docs/quickstart/network-quickstart) and funded it with cycles, you can deploy to mainnet like this:
```bash
npm run canister_deploy_mainnet
```## Methods
- **createUser**: This method is used to create a new user. There are two valid user roles, `organizer` for ticket seller and `participant` for ticket buyer. Please choose it wisely.
- **createEvent**: This method is used to create a new event. Only users with the `organizer` role can use this method.
- **createTickets**: This method is used to create new tickets. Only users with the `organizer` role can use this method.
- **getMe**: This method is used to retrieve the current user.
- **getEvents**: This method is used to retrieve all events.
- **getTicketsByEvent**: This method is used to retrieve all tickets for an event.
- **getMyTickets**: This method is used to retrieve all current user's tickets.
- **getMyTransactions**: This method is used to retrieve all current user's transactions.
- **buyTicket**: This method is used to buy a ticket. Only users with the `participant` role can use this method.
- **transferTicket**: This method is used to transfer owned ticket to another participant. Only users with the `participant` role can use this method.## License
This smart contract is licensed under MIT License. Please see the [LICENSE](./LICENSE) for more information.