diff --git a/README.md b/README.md index 3118f93..44d2545 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,40 @@ Syncify is primarily written in Golang using: - [Tailwind CSS](https://tailwindcss.com/) This was my first time using Tailwind CSS and I must say, alongside Gomponents, it has made me reconsider my dislike of frontend development! + +## Running Locally + +### Spotify App + +You'll need your own Spotify app in their [developer console](https://developer.spotify.com/dashboard). From there you can grab an OAuth2 Client ID and Client Secret to users to log in. + +Then you fill them into a `.env` file in the root of the repo, see the [example .env file](example.env). + +### Option 1: Docker Compose + +The quickest option to get up and running is running the following: + +```shell +docker-compose build +docker-compose up -d +``` + +### Option 2: Manual + +1. Build the Tailwind CSS: + + ```shell + npm i && npm run build + ``` + +2. Export the variables in [example.env](example.env) e.g. + + ```shell + export CLIENT_SECRET=thisisdefinitelyasecret + ``` + +3. Start the server + + ```shell + go run . + ``` diff --git a/example.env b/example.env new file mode 100644 index 0000000..fd0ce9b --- /dev/null +++ b/example.env @@ -0,0 +1,9 @@ +LOG_LEVEL=info + +# Grab these from your own app at https://developer.spotify.com/dashboard +CLIENT_ID= +CLIENT_SECRET= + +# This should be the URL that users will use to reach the app +# It's used to generate the OAuth2 callback URL +URL=http://localhost:8000 diff --git a/package.json b/package.json index 1bd73fa..833fd8e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "tailwindcss": "^3.4.4" }, "scripts": { - "run": "npx tailwindcss -i stylesheet.css -o static/stylesheet.css", + "build": "npx tailwindcss -i stylesheet.css -o static/stylesheet.css", "watch": "npx tailwindcss -w -i stylesheet.css -o static/stylesheet.css" } }