Sample app that grabs real-time stock market data, allowing users to add funds, buy and sell shares.
To run the project locally, first clone the repository:
git clone git@github.com:luads/ls-stock-app.git
You will need to configure an Alpha Vantage API key on your environment file. First, copy the file, then add your key to the ALPHA_VANTAGE_API_KEY
param:
copy backend/.env backend/.env.local
vim backend/.env.local
Then to build and run the docker images, go inside the root folder and run:
make run
The UI will be available at http://localhost:5000, or simply run:
make open
To run the UI in development mode, you need to run the following commands:
cd frontend
npm install
npm run start
You can check the API docs here.
The project has isolated API and UI components. It also has a SQLite database layer and a Redis cache so the external API is not flooded with requests.
The deployment strategy was to push the container as is to Heroku. A free Redis add-on was enabled and attached to the API. If you have access to the deployment project, you can run a deploy by going inside the UI or API folders and running:
make deploy
This will build the image specifically for the production environment and push it to Heroku's Docker container repository.
A live version is available at https://ls-stock-ui.herokuapp.com.