Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akatakritos/keg-monitor
https://github.com/akatakritos/keg-monitor
express-js raspberrypi react temperature-monitoring
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/akatakritos/keg-monitor
- Owner: akatakritos
- Created: 2019-11-21T22:43:23.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T13:36:09.000Z (almost 2 years ago)
- Last Synced: 2023-06-05T16:37:02.836Z (over 1 year ago)
- Topics: express-js, raspberrypi, react, temperature-monitoring
- Language: TypeScript
- Size: 5.85 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 37
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Keg Maintenance Screen
![](pics/keg-monitor.jpg)
This little application is made from two projects:
- `keg-server`: An express.js server that manages the state of the current beers
and monitors temperature
- `keg-client`: A React application that displays the current beers and allows
an admin to manage them## Getting started
1. Clone this repo
1. run `npm install` in `keg-server`
1. run `npm install` in `keg-client`### Developing the server
Inside of the `keg-server` folder, run `npm run watch`. This will watch the
directory for changes, recompile the typescript, and restart the express serer
when anything changes. (Note: You may need to start the server from an
elevated command prompt to avoid write permission issues.)The routes are listed in `app.ts`.
Persistance uses `nedb` for a lightweight json-based database. Methods that
interact with the database should go in the appropriate repository inside the
`persistance` folder.On windows, a `FakeTemperatureMonitor` is configured to emit bogus temperatures
randomly. Otherwise, a `Ds18b20TemperatureMonitor` is configured to read
temperatures from the device file. If you are developing on a Mac this may be an
issue as it will identify your machine as linux and assume it can find the
device file. A bug is in the tracker.### Developing the client
Inside of `keg-client` run `npm start` to start the Create React App based run
time. It will monitor for file changes and reload the page.It assumes the keg-server is running. Follow the steps above to start the server.
Currently porting to React hooks.
# Deploying
## Production Builds
In `keg-client`:
```bash
$ npm run build
$ npm run copy
```This will compile the front end application and copy the assets to the public folder
of the serverIn `keg-server`:
```bash
$ npm run build-ts
```This will compile the application into the `dist` folder.
Copy the dist folder contents and the public folder to the pi: `~/keg`
## Starting the Pi
1. ssh to pi
2. run `~/clear-chrome-cache.sh`
3. Open screen
4. In one tab: `npm run start-prod` in `~/keg`
5. In one tab: `startx`
6. Disconnect and leave screen running