mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-22 16:35:14 +00:00
34 lines
1.0 KiB
Markdown
34 lines
1.0 KiB
Markdown
# go-scrobble
|
|
|
|
Golang based music scrobbler. MySQL 8.0+
|
|
|
|
Currently building on Node V15.X & Go V1.16.X
|
|
|
|
With a prebuilt binary - you will still need the migrations folder + web/build folder on prod.
|
|
|
|
Copy .env.example to .env and set variables. You can use https://www.grc.com/passwords.htm to generate a JWT_SECRET.
|
|
|
|
|
|
## Setup MySQL
|
|
create user 'goscrobble'@'%' identified by 'supersecurepass';
|
|
create database goscrobble;
|
|
grant all privileges on goscrobble.* to 'goscrobble'@'%';
|
|
|
|
## Local build/run
|
|
cp .env.example .env # Fill in the blanks
|
|
cd web && npm install && npm start
|
|
# In another terminal
|
|
go mod tidy
|
|
CGO_ENABLED=0 go run cmd/go-scrobble/*.go
|
|
|
|
Access dev frontend @ 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.
|
|
cp .env.example .env # Fill in the blanks
|
|
cd web npm install --production && npm run build
|
|
go build -o goscrobble cmd/go-scrobble/*.go
|
|
./goscrobble |