luads / ls-stock-app

Playground app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stock Exchange App

Sample app that grabs real-time stock market data, allowing users to add funds, buy and sell shares.

Running the project locally

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

Development mode

To run the UI in development mode, you need to run the following commands:

cd frontend
npm install
npm run start

API Endpoints

You can check the API docs here.

Overall architecture

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.

C4 Level 2 - Stock App

Deployment

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.

About

Playground app


Languages

Language:PHP 58.3%Language:TypeScript 37.3%Language:Dockerfile 1.4%Language:Makefile 1.3%Language:HTML 1.0%Language:Shell 0.4%Language:CSS 0.3%