A minimal full-stack tracker for Stocks and Cryptocurrencies. Intended for use on external Raspberry Pi based displays (3.5inch) or within a browser. Created to be deployed at scale.
- 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 installcd client
npm run devRun in another terminal
cd server
npm run devnpm run buildRun Client Unit Tests with Vitest
npm run testLint Client with ESLint
npm run lintTo deploy with 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
.envfiles from the templates in/clientand/server -
Build the dockerfile within the
/clientdirectory
docker build -t kajgm/stocktracker-client .- Build the dockerfile within the
/serverdirectory
docker build -t kajgm/stocktracker-server .- Create a bridge network
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 mongoEnsure 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 set the $DISPLAY environment variable
export DISPLAY=:0- Run chromium in fullscreen mode
chromium-browser --kiosk --app=http://localhost:8080/ --start-fullscreen --incognitoAlternatively, you may need to append
nohupand&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