Inspiration
Puerto Rico is already a land mind for disasters. Starting with Hurricane Maria in 2017, Earthquakes in 2020 and Hurricane Fiona in 2021. Although these natural disasters are part of Puerto Rico's location, they are going to keep happening more frequently due to climate change.
In the past disasters, the people of the island were underprepared to receive those challenges. They didn't know what was going on, they thought the situation was under control which led them to be underprepared to receive a category 1 Hurricane (for example, Fiona). Then, when help is sent out for disaster relief, either it never arrives or it takes too long arrive.
The people of Puerto Rico need to see what's going on in their island, see what incidents are happening, see when assistance is sent out and what its status is. Have their leaders make better informed decisions and where to allocate resources when these events happen, to minimize the impact of these incidents.
What it does
1) Our dApp provides a map of Puerto Rico for every user. This map shows all of the reported incidents as accurate markers. Meaning that the user can see current incidents based on geolocation.
2) Our map shows the stats of the current selected municipality, showcasing the Index of Preparedness(IOP) which is calculated with an overall sum of current incidents of the area and the status of all the different infrastructure(water, power, Roads, etc.).
3) Status Time Machine: Save snapshot of the daily status of the island on all its municipalities on IPFS.
4) Tracking for Federal assistance being sent out.
5) Reputation Gamification. The more reports a verified reporter does, levels up their prestige. This will reward the reporter with an NFT of the tier of prestige the user has unlocked(bronze, silver, gold, etc.). The NFT will have the users name and their leader board number. Platinum-12, means thats that user is the 12th person to reach platinum tier.
How we built it
For the backend we built a restful api with Firebase and used FireStore for the database. This api has an open endpoint that gets called every 12 hrs by using firebase Trigger that saves that history to IPFS with the help of Moralis SDK.
For the frontend we used React.js, vite, mantine, amplify for deployment and leaf-let for generating the map.
For Puerto Rico's geolocation and map data, we used TOP' s data to build a json file which we dumped to our FireStorage db as a collection of municipalities and then exposed to a public end point in our restful API. Then we call this endpoint in the front end to render the map, go the to selected locations, write reports to the locations and show the stats. Since this endpoint is public, any developer can use it. Here is the link to the endpoint:
Challenges we ran into
The main challenge was to work on this project with all of us having full time jobs and traveling for Thanksgiving.
Another challenge was learning about blockchain related technologies and decentralized technologies that we never used before. This includes Moralis, IPFS, OpenZeppelin, etc.
The data transformation was huge challenge since all the TOP data was weirdly formatted as plain text.
Accomplishments that we're proud of
We are proud that our dApp is functional. Users can register, login, verify account, make geolocated reports and see other users reports.
Also, we are proud that our PR status time machine is stored in IPFS. Here is one example: IPFS data for day 1
What we learned
We learned how to use Moralis SDK to connect and store data in IPFS. We learned how to render a map that is connected to a live Api, and how to create a smart contract to generate our NFT using OpenZeppelin
What's next for BetterInfra
To go beyond the mvp we would rebuild some parts of the web app client, add the admin user that can remove false reports, implement the time-machine visualization, create a dedicated mobile app with react-native for better phone support. Rebuild some parts of the api we created and add more features for the admins, also implement the NTFs badges.
Log in or sign up for Devpost to join the conversation.