A minimal tracker for Stocks and Cryptocurrencies. Intended for use on external Raspberry Pi based displays (3.5inch) or within a browser.
- Please ensure the following software is installed
- (Optional) To display exchange-traded stock tickers (AAPL, MSFT, etc.), create a Finanical Modeling Prep API key
cd client
npm install
cd ../server
npm install
FMP_KEY="<your_api_key>"
cd client
npm run dev
Run in another terminal
cd server
npm run dev
npm run build
Run Client Unit Tests with Vitest
npm run test
Lint Client with ESLint
npm run lint
To deploy within Docker, please follow these steps:
-
Install Docker Engine
Tip: Run
sudo usermod -aG docker <user>
to avoid prefixing the following commands with sudo -
Create the
.env
files from the templates in/client
and/server
-
Build the dockerfile within the
/client
directory
docker build -t kajgm/stocktracker-client .
- Build the dockerfile within the
/server
directory
docker build -t kajgm/stocktracker-server .
- Create a network for these containers
docker network create -d bridge backend-net
- Run the client, server, and database containers
Note: If running on a raspberry pi, you will need to download an alternative mongodb image. Please see steps under Deployment on Raspberry Pi
docker run -d -p 8080:80 --name stocktracker-client --network backend-net --restart always kajgm/stocktracker-client
docker run -d -p 3000:3000 --name stocktracker-server --network backend-net --env-file=./.env --restart always kajgm/stocktracker-server
docker run -d --name mongodb-server --network backend-net -v stocktracker:/data/db --restart always mongo
Ensure the Docker deployment steps from above are followed on the target Raspberry Pi
-
Mongodb currently does not support the ARM architecure used on raspberry pis. Please use the alternative image provided by themattman mongodb-raspberrypi-docker
-
If running these commands over ssh, export the display
export DISPLAY=:0
- Run chromium in fullscreen mode
chromium-browser --kiosk --app=http://localhost:8080/ --start-fullscreen --incognito
Alternatively, you may have to append
nohup
and&
to run the command in the background (if executing via ssh):
nohup chromium-browser --kiosk --app=http://localhost:8080/ --start-fullscreen --incognito &
As an alternative, a startup script has been provided in the root directory ./startup.sh
. Ensure that the script is executable before running or referencing in any automated startup routine.
chmod +x <username> ./startup.sh