Music streaming from YouTube for Raspberry Pi
This project is a work in progress.
First, move to the server folder cd radio
. Create a link to the development version of the config file.
ln -sf dev.env.toml config/env.toml
Vendor all modules.
go mod vendor
Compile and run the binary. Some packages are using cgo, which means gcc is required for compiling.
go build
./radio
Or simply run with go run main.go
. After running, the server listens for requests at localhost:8000.
The app will be started in development mode. To start the app in production mode, set the environment variable RADIO_ENV=prod
.
We are targeting arm64 processor architecture. First, build the docker image with all dependencies for cross-compiling.
make builder
Then, using this image, compile the radio server (make sure the modules are vendored).
make build_server
The compiled binary will be outputted to the artifacts
folder.
Build the client.
make build_client
If you want, you can also compile the server and the client with a single make build
.
Deploy the app.
make deploy
We are using SQLite for the database.
You can change configurations such as the port or database file name by editing the config/env.toml
file.