Finding the right information online can be surprisingly difficult. From personal experience as both developers and more generally, it can be very frustrating not to find the answer to a problem online. Existing online forums do not offer sufficient guarantees to get an answer quickly.
What it does
A web application where users can ask questions with a financial incentive for participants to quickly answer!
How we built it
Our entire application is running on the ICP, the backend consisting of four different canisters:
The ledger and invoice canisters are used to conduct payments on the platform. We used the invoice canister implementation provided by the foundation (not officially released yet).
We have instantiated a graphql canister (see https://github.com/sudograph/sudograph) with our own schema. We have extended the default rust interface to prevent mutations from unauthorized callers. Only the market canister specifically is allowed to perform updates on the graphql database.
The market canister is written in Motoko. It updates the graphql database and interacts with the invoice canister. The heartbeat function is used internally to update the status of questions regularly.
The frontend canister interacts with the ledger, graphql, and the market canister. It uses Plug to authenticate calls to the ICP.
Challenges we ran into
Making graphql work was a bit fastidious at the beginning, especially because we wanted to have the backend logic written in Motoko, so we had to come up with an extra set of functions in the graphql canister that performs the JSON deserialization in rust. Writing tests and simulating scenarios was very challenging as well, especially when interacting with the ledger canister. We lost a lot of time on basic conversion issues, we ended up converting a (text) address to a blob manually by copying the output of a terminal command. Building the frontend was very time-consuming as well because we simply had little to no experience with it.
Accomplishments that we're proud of
Tackling all of the challenges! We're pretty proud of the final rendering of our application, but also of the code that is behind it. Using sudograph allowed us to build a solid backend that divides responsibilities, makes the code expandable, and allows for every kind of CRUD operation. This will allow us to quickly build new features!
What we learned
Coding for the internet computer is most of the time quite easy but can get very challenging from time to tie. But having overcome the challenges it feels great to have a product that we built on our own and that actually runs on a blockchain!
What's next for Leap
We want to keep working on the project implementing the next features we have in mind. We want to make the payment flow more robust, add a real arbitration mechanism with a proper incentive structure, be able to edit questions and answers, and polish the incentives and the user interface. Then we will officially launch it on mainnet!