Inspiration
We all procrastinate. You open a textbook, and suddenly you're watching YouTube. We noticed that most focus timers are too easy to ignore.
So we asked a simple question: What if getting distracted had a real consequence?
We wanted to make a focus app that felt more like a game with actual stakes. And since this is for the DevSoc hackathon, we used the UNSW API to build something specifically for UNSW students.
What it does
Gambit is a focus timer with consequences. The idea is simple: Focus. Or Else.
Sign in with Discord and invite our bot to your server of choosing. Then, you start the timer. If you get distracted and switch tabs for too long, you fail the session.
When you fail, the app spins a roulette wheel to pick your punishment. It might be:
- A public message sent to a Discord channel.
- A new server nickname for 24 hours, like "Folded Under Pressure".
- An email sent to your accountability partner.
- A "redemption booking". Using the DevSoc API, Gambit finds and books a study room for you in the UNSW Library for the next day.
If you complete a session, your focus streak goes up and you climb the leaderboard.
How we built it
We built Gambit as a full-stack web app.
- Frontend: A React and TypeScript app built with Vite. We used
axiosto talk to our backend. - Backend: A Node.js and Express server. We used Passport.js for Discord login and a PostgreSQL database to store user info and sessions.
- APIs:
- We used the Discord API for login and to let our bot send messages and change nicknames.
- We used the DevSoc GraphQL API for our room booking feature. Our code finds a small, empty study room and then runs a request to book it.
- We used the SendGrid API to send the punishment emails.
- Deployment: We deployed the backend on Railway and the frontend on Vercel.
Challenges we ran into
We ran into a few challenges.
- The DevSoc API booking was tricky. We couldn't just call one endpoint. We had to first get a list of rooms, then check each room's schedule to find an empty slot, and then finally send the request to book it.
- We worried that a "punishment" app would be too stressful. To fix this, we added the roulette wheel to make it random. We also added "Lucky Escape" outcomes and the leaderboard so it wasn't all negative.
- Figuring out when a user "failed" was hard. At first, we failed them instantly if they switched tabs. That felt unfair, so we added a 3-minute grace period. This lets people quickly check a message or look something up without failing the session.
Accomplishments that we're proud of
- The roulette wheel feels like a fun and original idea. It makes the app more than just a timer.
- We're happy with how we used the DevSoc API. We didn't just show data from it- we used it to build an interactive feature that books a real room.
- We managed to build and deploy a full app in just 48 hours. It has user login, a database, and connects to three different APIs.
- We think we found a good balance between a serious focus tool and a fun game.
What we learned
We learned a lot during the hackathon. Technically, we got better at using Passport.js for OAuth2 and learned how to use GraphQL to work with a real-world API.
On the design side, we learned that it's important to make sure the app feels fair, even if it has "punishments". Changing the idea from a simple punishment to a game of chance was a key lesson for us.
What's next for Gambit - Focus. Or Else.
We have a few ideas for what to do next with Gambit.
- Add more punishments and rewards to the roulette wheel, maybe letting the community suggest them.
- Improve the leaderboards with weekly rankings and give out special Discord roles to the top users.
- Use the DevSoc API to pull in UNSW course codes. This would let us create leaderboards for specific classes.
- A desktop version of the app would be the next big step. That way, we could track if a user opens a distracting app, or a browser tab.
Log in or sign up for Devpost to join the conversation.