The world today isn't just fun and games. Countries around the world have been impacted by the rapid spread of COVID-19, which has left many small businesses uncertain about their future; over 40% of these small businesses foresee a permanent shutdown in the next six months.
On the other hand, everyone loves a good game. What if you were able to slow the spread of COVID-19 and keep local businesses afloat, all while competing against your friends for money? There's never been a more perfect stay-at-home game than Shame Game.
What It Does
Shame Game allows users to start a round with friends, who compete to see who can remain at home the longest. Friends are eliminated from the round when they stray too far from their house — last one standing (sitting?) wins. Users can see where their friends are in the world and also have access to a feed of when friends leave their home (and thus lose a round); in essence, public shaming for the social good.
How We Built It
We managed to build the whole app using only Swift and Firebase/NodeJS. Firebase Authentication allowed for a smooth onboarding and login process, and all our data was stored in Firestore. We used Firebase Cloud Messaging to generate push notifications that were sent to users' devices, which provided users with meaningful updates about their friends' changes in location in addition to game updates. The client app was written in Swift, and we used the Google Maps Platform to allow users to see where their friends are. Lastly, the back-end logic was done using Firebase Cloud Functions (written in NodeJS); the client app was able to call these through the Firebase SDK for Cloud Functions.
Challenges We Ran Into
We spent a lot time on tasks that should have taken only a couple minutes. The first couple hours of the hacking period were spent trying to get authentication to work, since we had misunderstood from the Firebase documentation that the majority of it would be handled by the SDK. Later on, when setting up the Firebase Cloud Messaging, we had interpreted from the Firebase documentation that the Admin SDK would automatically handle the app credentials (since we were running it on a trusted environment); it turned out that this isn't the case, and after two hours we realized that we had to explicitly declare the credentials.
However, these mistakes were all dwarfed by us spending a full hour staring at a blank Google Map of the Bay Area, only to realize that we had flipped latitude and longitude.
Accomplishments That We're Proud Of
Our biggest takeaway from this hackathon was how much we all learned. It was the first time for some us to separate so distinctly the client and server, which allowed us to easily split tasks between group members. In addition, it was really interesting to learn about the Firebase Cloud Functions, which are written in NodeJS; not having to worry about hosting was a big plus, and it felt so good having to only type a single command in Terminal to deploy everything. Lastly, we were really proud to get iPhone notifications working; it was surprising and rewarding when the first notification came through, albeit after a couple hours of testing.
What We Learned
This was the first time using Firebase extensively for everyone. Our team had little prior NodeJS experience and no previous exposure to Firebase Cloud Functions, so it was a bit tricky at first learning about topics such as async callbacks, Promises, and the general Firestore syntax (e.g. DocumentReference vs. DocumentSnapshot); we eventually got the hang of it and were able to produce code much more quickly in the latter half of the hackathon. This was also everyone's first time doing mobile notifications, something that we believed was critical to the functionality of our app. We managed to achieve this using Firebase Cloud Messaging.
What's Next For Shame Game
In the future, we hope to expand the app's features; our initial idea was to have users/groups of friends "buy in" to a round, and the winner (whomever left their house last) would get to keep the whole prize pool; the only catch is that they have to spend it at a local small business by purchasing a gift card from them. SaveOurFaves has done an incredible job compiling restaurants in the Bay Area with links to purchase gift cards from them, and we toyed with idea of scraping their website to generate the list of small businesses the winner could pick from.