Skip to content

0xmikko/Ticket-Graph

Repository files navigation

Ticket-Graph

Decentralized tickets sale system

Live Demo: https://ticket-graph.herokuapp.com/
it could take up to 30 seconds sometimes cause project is deployed on free heroku dyno

Video: https://youtu.be/06e79YXQdKA

Screenshot 2019-05-24 at 02 05 08

Idea & inspiration

The core idea of this project is to show decentralized service where Ticket Graph users could buy tickets and event organizers could sell them. When user buys ticket his/her Ethereum address appears in the list of participants and if user has installed Ethereum wallet in mobile devices noting more to enter needed.

Screenshot 2019-05-24 at 02 07 09

User story

  1. Julia as a professional event organiser posted an event to system Graph Tickets about her Jazz concert, setting up location, date, price and quantity of tickets.
  2. John entered the site, chooses his location and found interesting events around him with additional information.
  3. John decided to buy a ticket. He simply press "Buy a ticket", pay in Ethereum and his address appears in participants list
  4. At the entrance Julia colleagues used IoT devices connected to The Graph API. This devices simply gets list of participant using one GraphQL request.
  5. John scanned QR-code by app, create a digital signature in his app and approve that his ethereum address is in the list and go to the concert.

The Graph API provides great opportunity to integrate decentralized systems with IoT devices and as result create new business models.

Smartcontract

Smartcontract for this project is very simplified. It has 2 methods only:

Post new event and provide all info:

postEvent(string memory _title, string memory _location, uint256 _date, string memory _imageUrl, uint32 _price, uint32 _qty) public

Buy tickets by sending money to smartcontract and event id.

function buyTicket(uint event_id) public payable

Data schema

To syncronize whole data between smartcontract data & end users via The Graph two @entities were created. TicketEvent is collcted all information about events and avaible tickets, Ticket schema is used to store information about users who bought tickets.

The Graph technology is used for searching through Events to provided selections based on user location, date and avaible tickets. Third-part services could use GraphQL requests to manage this data simply. I use Graph to filter Tickets by event id to show list of tickets buyers.

TicketEvent

type TicketEvent @entity {
  id: ID!
  title: String!
  location: String!
  date: Int!
  imageUrl: String!
  price: Int!
  qty: Int!
  owner: Bytes!
  
}

Ticket

type Ticket @entity {
  id: ID!
  event_id: Int!
  buyer: Bytes!
}

How Graph is utilized in this project

The Graph helps to provide API for smartcontract for third-patry services and IoT devices to check list of buyers and events.

What was done during hackathon

This project was created during hackathon from scratch including:

  1. Idea generation
  2. Writing and teswting smart contract
  3. Front end application development
  4. Deploying to Graph & Ropsten network & Heroku

Working version is on https://ticket-graph.herokuapp.com/ (it could take up to 30 seconds sometimes cause project deployed on free heroku dyno)

Future development

  • Finish searching bar for events
  • Provide function to withdraw money for organisers
  • Provide multiple ticket buying by one operation
  • Add automated testing for smartcontract
  • Add ratings to organisers
  • Develop recommendation system based on The Graph technology which organisers are trusted ones
  • Add addtional fields like genre and etc.
  • Add a featture to publish description and other info to IPFS.

Thanks for Graph & CoinList for this opportunity!

About

Decentralized tickets sale system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published