Inspiration

Have you ever found yourself constantly staring at the stock market, waiting for the perfect opportunity to sell your shares for maximum profit? After the Gamestop stock surged this year, many people were carefully watching the stock market, hoping to make a profit off of the craziness started by r/wallstreetbets.

However, watching the stock market all day is a huge waste of time. Instead of watching the stock market yourself, we decided to create an application which sends you a text message whenever a stock you’re interested in hits a certain target price.

What it does

The web application interface allows a user to register their phone number, along with the stocks they want to track. They can specify the target price of each stock, and whether they want to get notified by text message when the stock goes above or below the target price.

How we built it

Twilistocko was created with:

  • React.js for the frontend
  • Python Flask for the server backend
  • MongoDB for the database to keep track of tracked stocks

We used the following API’s:

  • Twilio to send users notifications when their stocks hit a certain target price
  • Finnhub to get real-time stock market data

Challenges we ran into

We couldn’t host the Flask server and the websocket that connected to Finnhub together. If the websocket was open, the thread was busy receiving the data from the websocket. To fix this, we used Python’s threading module to allow for multithreading. One thread hosted the Flask server, while the other thread handled the websocket from Finnhub.

Accomplishments that we're proud of

  • Figuring out a creative way to solve the issue of not being able to host a Flask server and websocket at the same time using multithreading
  • Creating a web application with React.js and Python Flask, hosted separately

What we learned

  • How to create a web application with a React.js frontend and Flask backend hosted separately
  • How to query from, insert into, and update values into a Mongo database
  • How to use websockets

What's next for Twiliostocks

  • Editing notifications for entries that are already listed
  • Making the website more user friendly

Acknowledgements

  • Several of LAHacks workshops, including the Twilio workshop hosted by @Lizzie.twilio
  • Discord mentors for their immediate help
  • Last but not least, Stackoverflow
Share this project:

Updates