Sample .env file
WEBCAM_USER=WEBCAM HTTP USER
WEBCAM_PASS=WEBCAM HTTP PASSWORD
WEBCAM_IMAGE_URL=e.g. http://192.168.178.777/image/jpeg.cgi
OSRAM_GATEWAY_BASE_IP=YOUR OSRAM GATEWAY IP e.g. 192.168.178.777
APP_BASE_URL=http://localhost:3000
OPEN_WEATHER_MAP_API_KEY=YOUR_OPENWEATHER_API_KEY
- Download or clone the repository.
- Install the dependencies with
yarn
.
Run yarn dev
and go to http://localhost:3000.
Build your React-Matic for production with yarn build
and then start the
server with yarn start
.
- first install raspian OS - https://www.raspberrypi.org/documentation/installation/installing-images/
- https://www.maclife.de/ratgeber/raspberry-pi-am-mac-einrichten-gehts-100113322.html
- activate SSH access - https://www.google.com/search?q=raspbian+activate+ssh&oq=raspian+ac&aqs=chrome.1.69i57j0l5.4483j1j7&sourceid=chrome&ie=UTF-8
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker pi
# reboot
sudo reboot
#try
docker run hello-world
#yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt-get install nodejs npm git yarn
yarn --version
npm --version
node --version
git clone https://github.com/michl-b/react-matic.git
- go to your app working directory and run the following commands.
- create .env file
nano .env
- pull, build and run container
git pull && yarn --network-timeout 1000000 && yarn build && docker build -t react-matic . && docker stop reactMatic || true && docker run --name reactMatic --rm -d -p 3000:3000 react-matic
sudo nano /etc/rc.local
#add line before exit 0
docker run --name reactMatic --rm -d -p 3000:3000 react-matic
# save and exit
#try
sudo reboot
- Build your React-Matic for production with
yarn build
- Build the image with
docker build -t react-matic .
- Start the container with
docker run -d -p 8080:3000 react-matic
- Go to http://localhost:8080
GET /api/osram/discover curl -X GET 'http://localhost:3000/api/osram/discover'
GET /api/osram/nodeStatus?mac={mac or friendlyMac} curl -X GET 'http://localhost:3000/api/osram/nodeStatus?mac=e1ffa200aa3eb07c'
GET /api/osram/nodeOnOff?mac={mac or friendlyMac}&on=0/1 curl -X GET 'http://localhost:3000/api/osram/nodeOnOff?mac=e1ffa200aa3eb07c&on=0' curl -X GET 'http://localhost:3000/api/osram/nodeOnOff?mac=e1ffa200aa3eb07c&on=1'
GET /api/osram/nodeBrightness?mac={mac or friendlyMac}&brightness=[0-100] curl -X GET 'http://localhost:3000/api/osram/nodeBrightness?mac=e1ffa200aa3eb07c&brightness=50'
GET /api/osram/nodeColor?mac={mac or friendlyMac}&red=[0-255]&green=[0-255]&blue=[0-255] curl -X GET 'http://localhost:3000/api/osram/nodeColor?mac=e1ffa200aa3eb07c&red=255&green=0&blue=0' curl -X GET 'http://localhost:3000/api/osram/nodeColor?mac=e1ffa200aa3eb07c&red=0&green=255&blue=0' curl -X GET 'http://localhost:3000/api/osram/nodeColor?mac=e1ffa200aa3eb07c&red=0&green=0&blue=255'
import lightTheme from '../styles/light-theme'
<Page theme={lightTheme}>
...
</Page>
import darkTheme from '../styles/dark-theme'
<Page theme={darkTheme}>
...
</Page>
Copyright (c) 2018 Michael Bartsch. See LICENSE for details.