Skip to content

Commit

Permalink
update readme with deployment steps
Browse files Browse the repository at this point in the history
  • Loading branch information
kajgm committed Jun 2, 2024
1 parent 1a42f70 commit 95703a0
Showing 1 changed file with 52 additions and 13 deletions.
65 changes: 52 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# stock-tracker
# Stock Tracker · [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kajgrant/stocktracker/blob/master/LICENSE) [![Node.js CI](https://github.com/kajgrant/stocktracker/actions/workflows/node.js.yml/badge.svg)](https://github.com/kajgrant/stocktracker/actions/workflows/node.js.yml) ![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)

A minimal tracker for stocks and cryptocurrency
A minimal tracker for Stocks and Cryptocurrencies. Intended for use on external Raspberry Pi based displays, or within a browser.

## Developed With

- [Node 18.18.0](https://nodejs.org/en)
- [Vue](https://vuejs.org/)
- [Vite](https://vitejs.dev/)

## Prerequisites

Please ensure the following software is installed on your system:

- [Node 18.x](https://nodejs.org/en/download)

## Project Setup

Expand All @@ -26,24 +38,51 @@ npm run build
npm run test:unit
```

### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
### Lint with [ESLint](https://eslint.org/)

```sh
npm run test:e2e:dev
npm run lint
```

This runs the end-to-end tests against the Vite development server.
It is much faster than the production build.
## Docker Deployment

But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments):
To deploy within Docker, please follow these steps

```sh
npm run build
npm run test:e2e
### Prerequisites

1. Install [Docker Engine](https://docs.docker.com/engine/install/)
2. Build the dockerfile

```
docker build -t <tag_name>/stocktracker .
```

### Lint with [ESLint](https://eslint.org/)
3. Run the dockerfile

```sh
npm run lint
```
docker run -d -p 8080:80 --name stock-tracker-1 <tag_name>/stocktracker
```

## Deployment on Raspberry Pi

Ensure the Docker deployment steps from above are followed on the target Raspberry Pi

1. Install chromium browser version 88

```
wget "http://archive.raspberrypi.org/debian/pool/main/c/chromium-browser/chromium-browser_88.0.4324.187-rpt1_armhf.deb"
wget "http://archive.raspberrypi.org/debian/pool/main/c/chromium-browser/chromium-codecs-ffmpeg-extra_88.0.4324.187-rpt1_armhf.deb"
apt install --no-install-recommends --allow-downgrades --allow-change-held-packages ./chromium-browser_88.0.4324.187-rpt1_armhf.deb ./chromium-codecs-ffmpeg-extra_88.0.4324.187-rpt1_armhf.deb
```

2. If running these commands over ssh, export the display

```
export DISPLAY=:0
```

3. Run chromium in fullscreen mode

```
chromium-browser --kiosk http://localhost:8080/ --start-fullscreen
```

0 comments on commit 95703a0

Please sign in to comment.