Basically it is as easy as running through the getting started guide on your remote server.
Be sure to do the .env files right when going through the getting started guide. Referring to the example environment you can see my .env files here:
API_IP=0.0.0.0 API_PORT=8000 DEBUG=FALSE
VITE_API_BASE=https://dascr.org/ VITE_API_URL=https://dascr.org/api VITE_WS_URL=wss://dascr.org/ws
Autostart backend using systemd
If you have successfully built the backend and the frontend you will have the backend binary in place and the public folder for serving with for example caddy2.
You can now use this
systemd service file to automate the startup of the backend binary like so:
[Unit] Description=DaSCR Board - Backend API After=network.target [Service] Type=simple User=patrick Group=patrick Restart=always RestartSec=5s Environment=API_IP=0.0.0.0 Environment=API_PORT=8000 WorkingDirectory=/home/patrick/projects/dascr-board ExecStart=/home/patrick/projects/dascr-board/dist/linux_amd64/dascr-board SyslogIdentifier=dascr-board [Install] WantedBy=multi-user.target
Save it at
sudo systemctl daemon-reload sudo systemctl start dascr-board sudo systemctl enable dascr-board
Now the service should be up and running and be started at system boot time automatically.
You can check running
sudo systemctl status dascr-board.
- Caddy2: You might wanna continue setting up caddy2 server to serve the frontend UI