GoScrobble/README.md

34 lines
1.1 KiB
Markdown
Raw Normal View History

2021-03-23 06:07:39 +00:00
# go-scrobble
2021-03-24 09:28:05 +00:00
Golang based music scrobbler. MySQL 8.0+
2021-03-23 08:43:44 +00:00
2021-03-24 04:19:18 +00:00
Currently building on Node V15.X & Go V1.16.X
2021-03-24 09:28:05 +00:00
With a prebuilt binary - you will still need the migrations folder + web/build folder on prod.
2021-03-23 08:43:44 +00:00
2021-03-25 05:15:01 +00:00
Copy .env.example to .env and set variables. You can use https://www.grc.com/passwords.htm to generate a JWT_SECRET.
2021-03-23 08:43:44 +00:00
2021-03-24 09:28:05 +00:00
## Setup MySQL
2021-03-23 08:43:44 +00:00
create user 'goscrobble'@'%' identified by 'supersecurepass';
create database goscrobble;
grant all privileges on goscrobble.* to 'goscrobble'@'%';
## Local build/run
2021-03-25 05:15:01 +00:00
cp .env.example .env # Fill in the blanks
cd web && npm install && REACT_APP_API_URL=http://127.0.0.1:42069 npm start
2021-03-24 03:29:35 +00:00
# In another terminal
2021-03-23 08:43:44 +00:00
go mod tidy
2021-03-25 05:15:01 +00:00
CGO_ENABLED=0 go run cmd/go-scrobble/*.go
2021-03-23 08:43:44 +00:00
2021-03-24 09:28:05 +00:00
Access dev frontend @ http://127.0.0.1:3000 + API @ http://127.0.0.1:42069/api/v1
2021-03-23 08:43:44 +00:00
## Run local tests
2021-03-24 03:29:35 +00:00
go test test/*
## Prod deployment
We need to build NPM package, and then ship web/build with the binary.
2021-03-25 05:15:01 +00:00
cp .env.example .env # Fill in the blanks
cd web npm install --production && REACT_APP_API_URL=https://goscrobble.com npm run build
2021-03-24 03:29:35 +00:00
go build -o goscrobble cmd/go-scrobble/*.go
2021-03-25 05:15:01 +00:00
./goscrobble