During these 30 days, we’ll be working to create a full-stack RSVP dapp. Think of it as a web3-native Eventbrite, except attendees need to deposit ETH to RSVP and will get it back upon them checking in at the event.
Here’s what our smart contract should be able to handle:
Creation of a new event:
RSVP to an event:
Check in attendees:
Withdraw any remaining deposits from guests who didn’t check in and send them to the owner of the event:
As we’re writing our smart contract, we’re going to create custom events that will help us build our subgraph. Events are triggers that your frontend and subgraph can listen to, and this makes them perfect for conditionally executing code on the front end and conditionally indexing data.
The subgraph is what will allow us to create the ability to add a dashboard functionality, where users can see events they’ve created and/or attended. More on subgraphs later, but for now the important thing to note is that we have to expose data about the events that a user creates and RSVPs for via Solidity Events.
The events we’ll be creating:
We'll be diving into the specifics of building our subgraph after the smart contract section, but you should understand the role of a subgraph in your dapp as you're writing the smart contract to make sure that you're optimizing your contract for the on-chain information you want to show on your front end
The subgraph allows you to ask sophisticated questions about your data. The subgraph only has access to data we expose via Solidity events. For this reason, we're going to create custom events that expose data we'll ask questions about our data to get insights about the events our users are RSVP'd for, events that are in the future vs events that have already passed.
Now that we're in section 3 of the curriculum, first check to see if your question has already been answered in #section-3-help. If you don't see it there, drop your question along with any details that could help us help you :)
Writers: Cami