Skip to content

Huat Did I Win? is a React web application for easily scanning TOTO, 4D, Singapore Sweep tickets for winnings using GCP Cloud Vision API. Core built in a day for Hack n' Roll 2021.

License

Notifications You must be signed in to change notification settings

Q-gabe/huat-did-i-win

Repository files navigation

Huat Did I Win

Checking if you hit the big one, made easy!

A Hack'n'Roll 2021 Submission by Team Silverhand (@Q-gabe). ♫

Huat Did I Win?

Listening to the radio, checking the newspaper and online sources are the few avenues available for punters in Singapore to check the Singapore Pools lottery results every week. However, upon buying many tickets, it is often easy to miss a number or two in our haste. Even with proper concentration, the tedium of entering the numbers one-by-one can quickly get loh soh (Singlish slang for longwinded).

Using GCP-provided Optical Character Recognition models, "Huat Did I Win", a pun using "Huat" which in Hokkien means "prosper", provides gamblers and easy way to simply scan their physical tickets for a quick litmus test for a windfall!

Demo

Try it now at HuatDidI.Win!

Preview

(Positive example sourced from this Mothership article of this lucky person.)

Disclaimer

In no way shape or form am I encouraging gambling even in legalized forms such as those avenues provided by Singapore pools by building and publicizing this application. This application is built mainly to solve a user experience problem that I encountered.

Getting Started

First, clone this repository, and run the Next.js development server:

git clone https://github.com/Q-gabe/huat-did-i-win.git
cd huat-did-i-win

npm install
# or
yarn

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

API routes can be accessed on endpoints served from pages/api.

In order to access the GCP Vision API, follow the setup guide from GCP documentation. Ticket recognition will not work without a service account for the server.

The json credentials for a GCP service account must be provided in base64 and set as the environment variable GCP_CREDENTIALS. You can manually do this by editing value of GCP_CREDENTIALS in the next.config.js file.

Technologies used

  • Typescript, React, Bootstrap
  • Next.js
  • GCP Vision API

Deployment

  • Vercel

Acknowledgements

  • Credits to my partner-in-crime Rachel for the incredible name of the web app.
  • Special thanks to my family for trying their luck at the recent $8 million prize pot and painstakingly using the Singapore pools website to enter every freaking $1 ordinary Toto bet. It was so infuriating to use that this idea was spawned.

License

MIT

About

Huat Did I Win? is a React web application for easily scanning TOTO, 4D, Singapore Sweep tickets for winnings using GCP Cloud Vision API. Core built in a day for Hack n' Roll 2021.

Topics

Resources

License

Stars

Watchers

Forks