piCRT is a Raspberry Pi-powered retro media player written in Go and Svelte, with a terminal-style UI, designed for automated video playback and remote control.
systemd
.cd ~
git clone https://github.com/yourusername/piCRT.git
cd piCRT
GOOS=linux GOARCH=arm64 go build -o server main.go
cd svelte-ui
npm install
npm run build
cd ..
scp -r server pi@<PI-IP>:/home/pi/piCRT/
scp -r svelte-ui/build pi@<PI-IP>:/home/pi/piCRT/build/
Or SSH into your Raspberry Pi and use the deployment script:
ssh pi@<PI-IP>
cd /home/pi/piCRT
./deploy-to-pi.sh
systemd
Servicesudo nano /etc/systemd/system/piCRT.service
Paste the following:
[Unit]
Description=piCRT Go Server
After=network.target
[Service]
ExecStart=/home/pi/piCRT/server
Restart=always
User=pi
WorkingDirectory=/home/pi/piCRT
StandardOutput=journal
StandardError=journal
Environment="PATH=/usr/local/bin:/usr/bin:/bin"
Environment=PICRT_MEDIA_PATH=/home/pi/media/
[Install]
WantedBy=multi-user.target
Save (Ctrl+X
, Y
, Enter
), then enable & start the service:
sudo systemctl daemon-reload
sudo systemctl enable piCRT
sudo systemctl start piCRT
http://<PI-IP>:5000/
in a browser.Use the provided script to sync files and restart the server:
./deploy-to-pi.sh
Or SSH into your Raspberry Pi and run:
ssh pi@<PI-IP>
cd /home/pi/piCRT
./deploy-to-pi.sh
sudo systemctl status piCRT # Check service status
journalctl -u piCRT --follow # View logs
Want to use a different media folder for development or testing? Just set the PICRT_MEDIA_PATH
environment variable when you run the server. This way, you don't have to edit the code to switch between your dev and production media folders.
Why?
How to use:
PICRT_MEDIA_PATH=/path/to/your/dev/media go run server.go
# or if running the built binary
PICRT_MEDIA_PATH=/path/to/your/dev/media ./server
set PICRT_MEDIA_PATH=C:\path\to\your\dev\media
go run server.go
$env:PICRT_MEDIA_PATH="C:\path\to\your\dev\media"
go run server.go
Environment=PICRT_MEDIA_PATH=/home/pi/media/
If you don't set it, the server defaults to /home/pi/media/
.
systemd
+ SSH + SCP