This part of the project was written with Angular and was generated with angular-cli.
Install Node.js 18x. Follow the instructions from https://github.com/nodesource/distributions
Clone the project
git clone https://github.com/strmark/kpiradio_frontend.gitInstall Angular cli
sudo npm install -g @angular/cliInstall dependencies
cd kpiradio_frontend
npm install --legacy-peer-depsRun the development server
ng serve --host 0.0.0.0Navigate to http://server_ip:4200/. The app will automatically reload if you change any of the source files.
Install nginx web server
sudo apt-get install nginxBuild the project to generate static files
ng build --configuration production --aotThe last command wil generate a "dist" folder. Place it in the nginx web server and give all right to the nginx user
sudo cp -R dist/piradio /var/www/piradio
sudo chown -R www-data: /var/www/piradioEdit the file default `sudo nano /etc/nginx/sites-available/default` and change the line
root /var/www/html;
with the following content
root /var/www/piradio;
And the line
location / {
try_files $uri $uri/ =404;
}
with the following
location / {
try_files $uri $uri/ /index.html;
}Pi Radio is now available from the address IP of your Raspberry Pi.