This part of the project is written with Spring-boot, H2 database, VLC, ALSA and the Quartz scheduler to provide the backend REST API.
This installation procedure will works on Raspian.
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get install git openjdk-17-jdk vlc libasound2-dev
Download maven from https://maven.apache.org/ and follow the installation instruction within binary tar or zip.
Clone the project
git clone https://github.com/strmark/piclodio4.git
Make the necessary folders
mkdir /home/pi/piclodio
mkdir /home/pi/piclodio/database
Copy the database to /home/pi/database
cd back
cp database/piclodio.db.* /home/pi/piclodio/database/
Start the VLC player on the Raspberry Pi and select the Alsa Audio Output as the Output module.
cd back
mvn install
mvn spring-boot:run
mvn package
=======
cp target/piclodio-0.0.1-SNAPSHOT.jar /home/pi/piclodio/
Create and open a Systemd service file for piclodio with sudo privileges in your text editor:
sudo nano /etc/systemd/system/piclodio.service
Place the following content (update the WorkingDirectory path depending on your installation)
[Unit]
Description=piclodio daemon
After=network.target
[Service]
User=pi
Group=pi
WorkingDirectory=/home/pi/piclodio
ExecStart=/usr/bin/java -jar piclodio-0.0.1-SNAPSHOT.jar
[Install]
WantedBy=multi-user.target
We can now start the service we created and enable it so that it starts at boot:
sudo systemctl daemon-reload
sudo systemctl start piclodio
sudo systemctl enable piclodio
The backend API should now be accessible on the port 8000 of the server.