![Logo](https://user-images.githubusercontent.com/46714781/221361044-c1b0d871-95ef-49d2-bbf3-bb1fe084753c.png)
Stockr.io is an application that allows new traders to make informed decision about stock trading through Sentimental Analysis using Natural Language Processing.
This was a submission for iNTUITION v9.0 Hackathon 2023 (https://intuition.ieeentu.com), but contributors are welcomed to continue developing this project.
**Disclaimer: This is just a project for fun. DO NOT solely use this for financial advice.**
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Stockr.io is an application that allows new traders to make informed decision about stock trading through Sentimental Analysis using Natural Language Processing.
- Under "Pick a symbol", type in any stock ticker symbol.
- Click submit. The page will load for awhile.
- The results will shortly be shown on your screen: BUY, SELL or HOLD
It is not uncommon for common folks like you and I to be interested in dabbling in the stock market, eager to flip a profit. But for most of us, we do not know where to begin. With that in mind, the team at Stockr.io decided to implement an interactive application that allows users to input a ticker symbol of their choice and obtain relevant data about how valuable the stock is perceived through various news sources.
This project hacks various libraries and frameworks together in order to create a functioning application that is user-friendly. Read below for an explanation for an explanation of the overarching system behind this project:
- User visits web client, enters their input and clicks the "Submit" button.
- This sends a
POST
request to the backend web API. - The web API routes this data into a message queue.
- The Python NLP project listens to this queue, and removes the first item of the queue to process it.
- Once done processing, the Python program sends the output to the result queue.
- A web socket connected to both the web client and the result queue listens to this queue, and broadcasts the output back to the web client.
- Backend: C# .NET 6
- Frontend: React Nextjs
- Database: SQL Server (SQLEXPRESS)
- NLP: Python
- Message Queue: RabbitMQ
There is a total of four programs to be run in the CLI at the same time for this project to work properly. They may however run independently on its own:
- Web API:
Server/WebAPI
- Web socket:
Server/WebSocket
- Web client:
Client/helloworld-client
- Python NLP project:
sentiment-analyser/
You may also run the telegram bot (telegram/
), but this runs independently on its own.
- .Net 6: https://dotnet.microsoft.com/en-us/download
- npm
npm install npm@latest -g
- RabbitMQ: https://www.rabbitmq.com/download.html
- Once installed and run, go to
http://localhost:15672/
and create the following user:- user: helloworld
- password: iHMn#Q2tBAfCV8c
- This credentials correspond to those in the
appsettings.json
of the .Net solution.
- Once installed and run, go to
- SQL Server (Community): https://www.microsoft.com/en-sg/sql-server/sql-server-downloads
- Python3: https://www.python.org/downloads/
-
Clone the repo
git clone https://github.com/raihahahan/intuition-hackathon-helloWorld.git cd intuition-hackathon-helloWorld
-
C# dotnet server
cd Server
dotnet restore
- Nextjs Web client
cd Client
npm install
- Get your rapidapi keys from https://rapidapi.com/twelvedata/api/twelve-data1/. This is for the list of stock tickers.
- Create
.env.local
to the root of the WebClient folder and add the following lines:
NEXT_PUBLIC_RAPID_API_KEY=YOUR_API_KEY
NEXT_PUBLIC_RAPID_API_HOST=YOUR_API_HOST
- Python NLP project
cd sentiment-analyser
pip install -r requirements.txt
- Get your newsapi API keys from https://newsapi.org/register. This is to retrieve the news sources to be added as arguments to the NLP model.
- Add a
.env
file to the root of this Python project and add the following lines:
apiKey=YOUR_NEWSAPI_KEY
- Telegram bot
cd telegram
pip install -r requirements.txt
- Get your Telegram API key from https://core.telegram.org/api/obtaining_api_id.
- Add a
.env
file to the root of this Python project and add the following lines:
API_KEY=YOUR_TELE_API_KEY
- Open four terminals (5 if with Telegram bot. We will improve this as part of the roadmap using docker compose) and run the following commands for each:
- .Net Web API
cd Server/WebAPI
dotnet run
- .Net Web Socket
cd Server/WebSocket
dotnet run
- React Nextjs
cd Client/helloworld-client
npm run dev
- Python NLP project
cd sentiment-analyser
python3 src/main.py
- Python Telegram bot
cd telegram
python3 main.py
- Go to
localhost:3000
to access the local environment of the web client.
- Fix dockerization (issues with CORS)
- Fix non-deterministic behaviour of state in Web Client (loading state sometimes doesn't change upon receiving message from RabbitMQ via SignalR)
- Tidy up Models in backend so that we can wire up to a database (most likely SQL Server (Community)). We are currently using in-memory database.
- Authentication (OAuth2)
- Improve message queue implementation.
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.