Every time my friends and I say "Let's go out to eat," we always spend two hours huddling on street corners as we scroll endlessly on Google Maps. And then we eventually just decide to go to the nearest Starbucks. That struggle inspired me to develop an app that could bring small businesses and consumers together and keep them constantly engaging with one another.

What it does

Well, it started off as a simple referral system, because that's how I've always found the best family-owned restaurants: by recommendation. Then I realized that I could expand on that and create a system that's like carpooling, but for loyalty points. Why not have everyone work together towards a common goal while amping up their competitive spirit through mini challenges? I managed to implement the referral system and a little bit of "cooperative loyalty" through group goals. I wanted to incorporate some quirky challenges, like "200+ points for getting a receipt total that alternates between odd and even numbers," but I unfortunately ran out of time to work on the rest.

How I built it

Python and Flask are my go-to and I've been steadily improving for almost a year, so I implemented the majority of my backend there. I have precious little frontend experience and am not familiar with any frameworks, so I worked on the frontend in raw HTML, which was highly challenging (definitely learning React after this!).

Challenges I ran into

I don't know much JS or async, and the example code for the Web Payments SDK was almost entirely in JS and async. I had to figure out how to translate that into Python, which was definitely eye-opening. I also had to work around the Square APIs' inability to edit custom attribute fields; that was a challenge because I was working with variables like referral codes that I ended up storing in fields I hoped were little-used (sorry, reference-id...). I also found it a bit cumbersome that I couldn't access a customer's loyalty account ID directly from the Customers API, and instead had to find a customer's ID and then filter loyalty accounts based on that ID.

Accomplishments that I'm proud of

Honestly, I'm proud I managed to get a frontend to be at least 50% functional. I overlooked the most obvious frontend things, like "Oh, there needs to be a button to get them back to the homepage after they pay, or they'll just be stuck here..." which gave me a very powerful appreciation for frontend developers. I'm also glad that I learned so much about the Square API system. It was amazing to see how customers, orders, payments, and the like are all connected behind the scenes, and was something that I had never really thought about before.

What I learned

Idempotency is going to stick with me. After learning about it, I was pretty awed. This one relatively small string of bits is the only thing standing between you and instant credit card debt from clicking the "Checkout" button too many times.

What's next for Squared

Now that I have some more experience with the Square API system, I want to try programming the seller's/administrator's view. I also REALLY want to implement some funny (at least to me) challenges and maybe give this referral game concept to some people from my university and see what they make of it.

Built With

Share this project: