Skip to content

var77/crevents

Repository files navigation

Contributors Stargazers MIT License


Logo

Crevents

Let your next event live on blockchain

View Demo · Report Bug · Request Feature

Crevents - Crypto Events

Crevents is a decentralized event management system compatible with EVM blockchains and is done using Solidity smart contracts.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

About The Project

Product Name Screen Shot

Crevents is an open source project demonstrating a usecase of blockchain for organizing and attending events.

Crevents allows event organizers to create and manage events using a decentralized platform.
The system uses a token-based ticketing system that allows event organizers to sell tickets directly to attendees, eliminating the need for intermediaries.
And attendees will get SBT tokens which are like NFTs, but can not be transferred.

Features

  • Create and manage events
  • Sell tickets directly to attendees
  • Set ticket prices and maximum number of participants
  • Whitelist registration to restrict event attendance to approved participants (WIP)
  • Check-in attendees using the event's smart contract
  • Get event ticket with attendee signature (to then use ecRecover for validating event without transaction)
  • Verify event QR code using ecRecover to get the address of attendee and check if he exists in participants list or no
  • View event information and attendance records

Built With

  • Solidity
  • React
  • NodeJS

Usage

ezgif.com-crop.1.mp4

Getting Started

To install and run the project locally follow the steps

Installation

Project is using nx for monorepo management.

Install dependencies

npm install
  1. Run local hardhat blockchain
npx nx serve smart-contracts
  1. Deploy smart contract on local hardhat blockchain
npx nx deploy smart-contracts
  1. Start front end
npx nx serve events-ui
  1. Run Cloudflare workers [optional]
npx nx run-many --target=serve --projects="image-uploader,metadata-server"

Then you should change tokenUriServer in Creator.sol to http://localhost:8989/ for metadata server.

For image uploader you should update UPLOAD_URL in FileUpload.tsx to http://localhost:8787/upload and HOST variable in packages/image-uploader/wrangler.toml

Cloudflare Workers

There are two workers image-uploader and metadata-server

Image Uploader Worker
This cloudflare worker is used to store event images. It is using R2 buckets to store images and Google Recaptcha v3 to protect againts spam.

Metadata Server Worker
This cloudflare worker is used to dynamically get data for event SBT tokens. Event smart contract is returning this workers URI + chainId + contractId + tokenId as tokenUri so it will look something like https://metadata.crevents.xyz/137/0x05242D4AC717Cdf38C36AF290F2b0DA99AA82c67/1.

This metadata server will call smart contract from corresponding RPC detected from chainId and take event information.
Then it will construct ERC721 standard json returning it to client, so wallets like metamask may show the event image for the token.
The json then will be cached in KV store.
Some RPCs URIs needs to be stored on secrets, check wrangler.toml for more information.

Change network on metamask

  1. If there's no localhost:8545 network, click add network and manually set address to localhost:8545
  2. Then import accounts you got when running hardhat blockchain to metamask

To Use recaptcha

cd projects/image-uploader
npx wrangler secret put RECAPTCHA_SECRET

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'feat(my feature): add some amazing feature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request to develop branch

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Varik Matevosyan - @D4RK7ET - varikmatevosyan@gmail.com

Project Link: https://github.com/var77/crevents

Donate

ETH: 0xB34F830271Bb5aF65E52D72f8E4E8307A16537E1
BTC: bc1qnxegen679nz6e6854xw89tgfgcd94sadz8yrc7