- Install docker desktop
Docker desktop download instructions found here
- in the root directory create a file named influxdb.env
touch influxdb.env
- In influxdb.env set the following environment variables
DOCKER_INFLUXDB_INIT_MODE=setup
DOCKER_INFLUXDB_INIT_USERNAME=avionics
DOCKER_INFLUXDB_INIT_PASSWORD=987654321
DOCKER_INFLUXDB_INIT_ORG=nakuja
DOCKER_INFLUXDB_INIT_BUCKET=telemetry
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=mysupersecrettoken
- In the root directory run:
docker compose up -d
- influxb dashboard is now availabe at localhost:8086
http://localhost:8086
- Sign in with username and password set in influxdb.env
username=avionics
password=987654321
- Everything is ready for use
- In the client directory, run:
npm install
installs the necessary dependencies for the client app
- In the node -server directory, run:
installs the necessary dependencies for the server app
In the node-server directory, run:
npm run prod
In the node-server directory, you can run:
npm run dev
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
- In the client directory create a .env.local file
touch .env.local
- Add the following values to the .env.local file
REACT_APP_SERVER_URL=ws://<server hostname or ip address>:<server port> or http://<server hostname or ip address>:<server port>
- In the node-server directory create a .env file
touch .env
- Add the following values to the .env file
BROKER_URL=mqtt://<broker hostname or ip address>:<broker port>
PORT=<server port>
ORIGIN=http://<client hostname or ip address>:<client port>
Suppose you are in the app directory /home/$USER/foo
- Create file, let's call it foo.service
touch foo.service
- In the file add
[Unit]
Description=Foo application
[Service]
User=<USER>
WorkingDirectory=/home/<USER>/foo
ExecStart=/usr/bin/npm run prod
Restart=on-failure
[Install]
WantedBy=multi-user.target
- Copy unit into systemd folder
sudo cp foo.service /etc/systemd/system
- Reload daemon
sudo systemctl daemon-reload
- Enable start on boot
sudo systemctl enable foo.service
Suppose you are in the app directory /home/pi/Desktop/base-station
- Create file, let's call it bs.service
touch bs.service
- In the file add
[Unit]
Description=Nakuja N2 base station software
[Service]
User=pi
WorkingDirectory=/home/pi/Desktop/base-station
ExecStart=/usr/bin/npm run prod
Restart=on-failure
[Install]
WantedBy=multi-user.target
- Copy unit into systemd folder
sudo cp bs.service /etc/systemd/system
- Reload daemon
sudo systemctl daemon-reload
- Enable start on boot
sudo systemctl enable bs.service