mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-21 16:11:56 +00:00
cmd/go-scrobble | ||
init | ||
internal/goscrobble | ||
migrations | ||
test | ||
web | ||
.gitignore | ||
go.mod | ||
go.sum | ||
LICENSE | ||
README.md |
go-scrobble
Golang based music scrobbler. MySQL backend.
Currently building on Node V15.X & Go V1.16.X
Setup MySQL
create user 'goscrobble'@'%' identified by 'supersecurepass';
create database goscrobble;
grant all privileges on goscrobble.* to 'goscrobble'@'%';
Local build/run
cd web && npm install && npm start
# In another terminal
go mod tidy
CGO_ENABLED=0 MYSQL_HOST=127.0.0.1 MYSQL_USER=goscrobble MYSQL_PASS=supersecurepass MYSQL_DB=goscrobble go run cmd/go-scrobble/*.go
Access test frontend through http://127.0.0.1:3000 API http://127.0.0.1:42069/api/v1
Run local tests
go test test/*
Prod deployment
We need to build NPM package, and then ship web/build with the binary.
cd web npm install --production && npm run build
go build -o goscrobble cmd/go-scrobble/*.go
MYSQL_HOST=127.0.0.1 MYSQL_USER=goscrobble MYSQL_PASS=supersecurepass MYSQL_DB=goscrobble ./goscrobble